Relay Entity¶
See the Relay Entity for generic information.
- group RelayEntity
Interface to relay entities on BrainStem modules. Relay entities can be set, and the voltage read. Other capabilities may be available, please see the product datasheet.
-
void relay_setEnable(unsigned int *id, struct Result *result, const int index, const unsigned char enable)¶
Set the enable/disable state.
The result parameter will output the following fields:
error: Common EntityClass Return Values common entity return value
- Parameters:
id – ID assigned through “module_createStem”
result – Output object containing result code.
index – The index of the entity in question.
enable – False or 0 = Disabled, True or 1 = Enabled
-
void relay_getEnable(unsigned int *id, struct Result *result, const int index)¶
Get the state.
The result parameter will output the following fields:
error: Common EntityClass Return Values common entity return value
value: False or 0 = Disabled, True or 1 = Enabled
- Parameters:
id – ID assigned through “module_createStem”
result – Output object containing result code and the requested value if successful.
index – The index of the entity in question.
-
void relay_getVoltage(unsigned int *id, struct Result *result, const int index)¶
Get the scaled micro volt value with reference to ground.
The result parameter will output the following fields:
error: Common EntityClass Return Values common entity return value
value: 32 bit signed integer (in micro Volts) based on the boards ground and reference voltages.
Note
Not all modules provide 32 bits of accuracy. Refer to the module’s datasheet to determine the analog bit depth and reference voltage.
- Parameters:
id – ID assigned through “module_createStem”
result – Output object containing result code and the requested value if successful.
index – The index of the entity in question.