Signal Entity

See the Signal Entity for generic information.

group SignalEntity

Interface to digital pins configured to produce square wave signals. This class is designed to allow for square waves at various frequencies and duty cycles. Control is defined by specifying the wave period as (T3Time) and the active portion of the cycle as (T2Time). See the entity overview section of the reference for more detail regarding the timing.

void signal_setEnable(unsigned int *id, struct Result *result, const int index, const unsigned char enable)

Enable/Disable the signal output.

The result parameter will output the following fields:

Parameters:
  • id – ID assigned through “module_createStem”

  • result – Output object containing result code.

  • index – The index of the entity in question.

  • enable – True to enable, false to disable

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

Get the Enable/Disable of the signal.

The result parameter will output the following fields:

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 signal_setInvert(unsigned int *id, struct Result *result, const int index, const unsigned char invert)

Invert the signal output.

Normal mode is High on t0 then low at t2. Inverted mode is Low at t0 on period start and high at t2.

The result parameter will output the following fields:

Parameters:
  • id – ID assigned through “module_createStem”

  • result – Output object containing result code.

  • index – The index of the entity in question.

  • invert – True to invert, false for normal mode.

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

Get the invert status the signal output.

Normal mode is High on t0 then low at t2. Inverted mode is Low at t0 on period start and high at t2.

The result parameter will output the following fields:

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 signal_setT3Time(unsigned int *id, struct Result *result, const int index, const unsigned int t3_nsec)

Set the signal period or T3 in nanoseconds.

The result parameter will output the following fields:

Parameters:
  • id – ID assigned through “module_createStem”

  • result – Output object containing result code.

  • index – The index of the entity in question.

  • t3_nsec – Integer not larger than unsigned 32 bit max value representing the wave period in nanoseconds.

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

Get the signal period or T3 in nanoseconds.

The result parameter will output the following fields:

  • error: Common EntityClass Return Values common entity return value

  • value: Integer not larger than unsigned 32 bit max value representing the wave period in nanoseconds.

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 signal_setT2Time(unsigned int *id, struct Result *result, const int index, const unsigned int t2_nsec)

Set the signal active period or T2 in nanoseconds.

The result parameter will output the following fields:

Parameters:
  • id – ID assigned through “module_createStem”

  • result – Output object containing result code.

  • index – The index of the entity in question.

  • t2_nsec – Integer not larger than unsigned 32 bit max value representing the wave active period in nanoseconds.

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

Get the signal active period or T2 in nanoseconds.

The result parameter will output the following fields:

  • error: Common EntityClass Return Values common entity return value

  • value: Integer not larger than unsigned 32 bit max value representing the wave active period in nanoseconds.

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.