Mux Entity

group MuxEntity

MuxClass: A MUX is a multiplexer that takes one or more similar inputs (bus, connection, or signal) and allows switching to one or more outputs. An analogy would be the switchboard of a telephone operator. Calls (inputs) come in and by re-connecting the input to an output, the operator (multiplexer) can direct that input to on or more outputs.

One possible output is to not connect the input to anything which essentially disables that input’s connection to anything.

Not every MUX has multiple inputs. Some may simply be a single input that can be enabled (connected to a single output) or disabled (not connected to anything).

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

Get the mux enable/disable status

Parameters:
  • id – The id assigned by the create stem vi.

  • result – Object containing aErrNone and the requested value on success. Non-zero error code on failure.

  • index – The index of the entity in question.

Returns:

Returns common entity return values

void mux_setEnable(unsigned int *id, struct Result *result, const int index, const unsigned char bEnable)

Enable the mux.

Parameters:
  • id – The id assigned by the create stem vi.

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

  • index – The index of the entity in question.

  • bEnable – true: enables the mux for the selected channel.

Returns:

Returns common entity return values

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

Get the current selected mux channel.

Parameters:
  • id – The id assigned by the create stem vi.

  • result – Object containing aErrNone and the requested value on success. Non-zero error code on failure.

  • index – The index of the entity in question.

Returns:

Returns common entity return values

void mux_setChannel(unsigned int *id, struct Result *result, const int index, const unsigned char channel)

Set the current mux channel.

Parameters:
  • id – The id assigned by the create stem vi.

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

  • index – The index of the entity in question.

  • channel – mux channel to select.

Returns:

Returns common entity return values

void mux_getChannelVoltage(unsigned int *id, struct Result *result, const int index, const unsigned char channel)

Get the voltage of the indicated mux channel.

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 – The id assigned by the create stem vi.

  • result – Object containing aErrNone and the requested value on success. Non-zero error code on failure.

  • index – The index of the entity in question.

  • microvolts – 32 bit signed integer (in microvolts) based on the board’s ground and reference voltages.

Returns:

Returns common entity return values

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

Get the configuration of the mux.

Parameters:
  • id – The id assigned by the create stem vi.

  • result – Object containing aErrNone and the requested value on success. Non-zero error code on failure.

  • index – The index of the entity in question.

Returns:

Returns common entity return values

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

Set the configuration of the mux.

Parameters:
  • id – The id assigned by the create stem vi.

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

  • index – The index of the entity in question.

  • config – integer representing the mux configuration either muxConfig_default, or muxConfig_splitMode.

Returns:

Returns common entity return values

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

Get the current split mode mux configuration.

Parameters:
  • id – The id assigned by the create stem vi.

  • result – Object containing aErrNone and the requested value on success. Non-zero error code on failure.

  • index – The index of the entity in question.

Returns:

Returns common entity return values

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

Sets the mux’s split mode configuration.

Parameters:
  • id – The id assigned by the create stem vi.

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

  • index – The index of the entity in question.

  • splitMode – integer representing the channel selection for each sub-channel within the mux. See the data-sheet for the device for specific information.

Returns:

Returns common entity return values