The State Mapper channel maps the input channel into a discrete state output channel based on a set mapping conditions. Define each mapping condition in terms of a minimum input value, a maximum output value, and the associated output state value. The number of mapping conditions must be 32 or less.
NOTE
The State Mapper channel can consume significant CX23-R computational resources depending on the sample rate and the number of mapping conditions defined.
Name: Each computed channel must have a unique name and contain valid characters (single and double quotes not permitted). If changed, all references to the channel change automatically. If removed, all references to the channel remain and you must manually remove if no longer required.
Input Channel with sample rate: Input channel (any non-sink channel).
Measurand: Quantity being measured or the type of measurement associated with the computed channel.
Units: Physical units of measurement for the computed channel.
Range min and max: Expected extreme values of computed channel.
Use default output value: Default output option to output a default value when the input channel does not meet any of the mapping conditions. If not selected, the output remains in its existing state.
Default out (always): Default value for the output. The channel outputs the value if the first input sample does not meet any mapping conditions. Also, when using default out, the channel outputs the default value throughout the test run when the input does not meet any mapping conditions.
Latch Period (secs): Time in seconds that the input channel must consistently map to the same output state before the output state switches. The latch period is similar to a duty cycle on the output state preventing the output state from switching for at least this period of time. This feature can eliminate state switching transients in the output channel data stream. If the latch period is 0.0, then the output state switches on each sample.
State Mapper Values: Define the state mapper conditions. There are several interfaces to enter this information.
The toggle button enables you to switch between interfaces when entering state mapper values. No matter which interface you are in, switching keeps what you have already entered and reformats it according to the new interface you select.
By default, use a Spreadsheet Interface (grid) to enter the mapping conditions. There are 32 rows allocated to enter all the conditions. Each row contains three units: Min, Max, and Value that represent a condition. Click Editor to switch to a free format text editor.
In the text editor interface, you can edit the state mapper conditions in a simple text editor where the respective values for a condition display on a single line. Separate each value by at least one space. There is no limit to the number of conditions you can enter, but anything over 32 creates an error and you need to fix it. Click Grid to switch to the grid interface.
Click Clear to clear the state mapper values.
To maintain backwards compatibility with the TCE interface, click Import to open the browser’s file chooser where you can select a previously saved/created file. This is an ASCII file where each line must represent a condition and contain three values separated by space or tab. The three values are Min, Max, and Values in that order.
Consider mapping an input channel that generates angular position in the range of 0 to 360 degrees into an output channel that specifies which 60 degree sector the input channel is in. Use the following mapping conditions where x is the input and y is the output.
Min | Max | Value |
---|---|---|
0 | 60 | 1 |
60 | 120 | 2 |
120 | 180 | 3 |
180 | 240 | 4 |
240 | 300 | 5 |
300 | 360 | 6 |
The grid interface for the above conditions:
The editor interface:
The ASCII file contents looks similar to those in the editor, but the spaces could be tabs.
No matter which editor is chosen, the results are the same. Any row where all the fields (Min, Max, and Value) are blank are ignored.