Mode-Dependent Channels in MAX
Mode-dependent channels allow a portion of a message to be used for different information. The information contained in the portion of the message depends on a mode channel value. Channels valid only on certain mode value are called mode-dependent channels.
For example, Byte 0 in the 5 byte message is the mode channel. When byte 0 contains the value 0, byte 1 and 2 contain a 16 bit intel signed value representing velocity. When byte 0 contains the value 1, byte 0 is an 8 bit unsigned value representing temperature and byte 2 is an 8 bit signed value representing pressure. Bytes 3 and 4 of the message contain time information and are not mode dependent.
To create mode-dependent channels in MAX, complete the following instructions.
- Right-click on a message and create a multiplexer.
- Define the properties of the mode channel in the Multiplexer Properties dialog. Click OK when you're finished.
- Right-click the multiplexer item that appears in the Configuration tree and select Create Mode to define the value of the mode channel (mode value).
- Right-click a mode item that was created in the configuration tree and select Create Channel to create the channels that are only valid when the mode-channel contains the specified mode value.
The channels of different modes in the same multiplexer may overlap each other. The new mode-dependent channels should appear as objects in the MAX configuration tree, similar to the new channels in the image below.