Mux Entity¶
API Documentation: [cpp] [python] [.NET] [LabVIEW]
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 (multiplexor) 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 mux entities can simply be a single input that can be enabled (connected to a single output) or disabled (not connected to anything).
Channel (Set/Get)¶
mux [ index ] . setChannel => (unsigned char) channel
mux [ index ] . getChannel <= (unsigned char) channel
Gets/Sets the currently selected channel
Enable/Disable (Set/Get)¶
mux [ index ] . setEnable => (unsigned char) enable
mux [ index ] . getEnable <= (unsigned char) enable
Enables/Disables the mux.
Get Channel Voltage (Get)¶
mux [ index ] . getChannelVoltage <= ((unsigned char) channel, (unsigned char) voltage)
Returns the voltage of the supplied channel.
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.mux[0].getChannel(&channel);
err = stem.mux[0].setChannel(1);
err = stem.mux[0].setEnable(1);
err = stem.mux[0].setEnable(0);
err = stem.mux[0].getChannel(1, &voltage);
err = stem.mux[0].setChannel(3);
Reflex¶
//Get calls will fill the variable with the returned value.
stem.mux[0].getChannel(&channel);
stem.mux[0].setChannel(1);
stem.mux[0].setEnable(1);
stem.mux[0].setEnable(0);
stem.mux[0].getChannel(1, &voltage);
stem.mux[0].setChannel(3);
Python¶
result = stem.mux[0].getChannel(&channel);
print result.value
err = stem.mux[0].setChannel(1)
err = stem.mux[0].setEnable(1)
err = stem.mux[0].setEnable(0)
voltage = stem.mux[0].getChannel(1)
print voltage.value
err = stem.mux[0].setChannel(3)