Relay Entity

API Documentation: [cpp] [python] [.NET] [LabVIEW]

The Relay entity is a simple class which allows the enabling and disabling of a specified relay.

Channel Enable (Get/Set)

relay [ index ] . setEnable => (unsigned char) enable
relay [ index ] . getEnable <= (unsigned char) enable

Enables the relay channel for the specified index

Get Voltage (Get)

relay [ index ] . getVoltage <= (unsigned char) voltage

Returns the voltage of the specified index.

Code Examples

C++

// All commands return aErr values when errors are encountered and aErrNone on
// success. Get calls will fill the variable with the returned value.

err = stem.relay[0].setEnable(1);
err = stem.relay[1].setEnable(1);

err = stem.relay[0].getEnable(&enable);
err = stem.relay[1].getEnable(&enable);

err = stem.relay[0].getVoltage(&voltage);
err = stem.relay[1].getVoltage(&voltage);

err = stem.relay[0].setEnable(0);
err = stem.relay[1].setEnable(0);

Python

err = stem.relay[0].setEnable(1);
err = stem.relay[1].setEnable(1);

result = stem.relay[0].getEnable()
print result.value

result = stem.relay[1].getEnable()
print result.value

voltage = stem.relay[0].getVoltage();
print voltage.value

voltage = stem.relay[1].getVoltage();
print voltage.value

err = stem.relay[0].setEnable(0);
err = stem.relay[1].setEnable(0);