MUX_GENERIC(9) | HAL Component | MUX_GENERIC(9) |
mux_generic - choose one from several input values
loadrt mux_generic config="bb8,fu12...."
This component is a more general version of the other multiplexing
components. It allows the creation of arbitrary-size multiplexers (up to
1024 entries) and also supports differing data types on the input and output
pins. The configuration string is a comma-separated list of code-letters and
numbers, such as "bb4,fu12".
This would create a 4-element bit-to-bit mux and a 12-element
float-to-unsigned mux. The code letters are b = bit, f = float, s = signed
integer, u = unsigned integer. The first letter code is the input type, the
second is the output type. The codes are not case-sensitive. The order of
the letters is significant but the position in the string is not. Do not
insert any spaces in the config string. Any non-zero float value will be
converted to a "true" output in bit form. Be wary that float
datatypes can be very, very, close to zero and not actually be equal to
zero.
Each mux has its own HAL function and must be added to a thread separately. If neither input nor output is of type float then the function is base-thread (non floating-point) safe. Any mux_generic with a floating point input or output can only be added to a floating-point thread.
Andy Pugh
GPL
2013-05-27 | LinuxCNC Documentation |