Relay Entity

group RelayEntity

RelayClass: 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 bEnable)

Set the enable/disable state.

Returns common entity return values

Parameters:
  • id – ID assigned through “module_createStem”

  • result – Object containing aErrNone on success. Non-zero error code on failure.

  • index – The index of the entity in question.

  • bEnable – False or 0 = Disabled, True or 1 = Enabled

void relay_getEnable(unsigned int *id, struct Result *result, const int index)

Get the state.

Returns common entity return values

Parameters:
  • id – ID assigned through “module_createStem”

  • result – Object containing aErrNone and the requested value on success. Non-zero error code on failure. False or 0 = Disabled, True or 1 = Enabled

  • 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.

Returns common entity return values

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 – Object containing aErrNone and the requested value on success. Non-zero error code on failure. 32 bit signed integer (in micro Volts) based on the boards ground and reference voltages.

  • index – The index of the entity in question.