Configuring the Class Encoder block

In this section we demonstrate how to configure the Class Encoder block.  To illustrate how this block may be configured we will assume we have a simple system with an indicator field, State.  The system has three states; Off, On and Standby and one Unknown state.  If State is equal to 0 the system is Off (i.e. Off is true (1) and all other states are false (0)), if State is equal to 1 the system is On (i.e. On is true (1) and all other states are false (0)) and if State is equal to 2 the system is on Standby (i.e. Standby is true (1) and all other states are false (0)).  For all other values of state, the system state is Unknown (i.e. Unknown is true (1) and all other states are false (0)).

Return to Overview of the Class Encoder block

To configure the Class Encoder block

  1. To open the block property page (the page on which the block configuration is specified), either double click on the block or right-click on the block and select Block Properties.  

  2. The field whose value is used to determine the system state is displayed in the Input field used box.

  3. To add a new Input value (i.e. one of the possible values that the input field can have, click on the New value button.  A default value (new_element0) is created in the Input Value list.

  4. Type 0 in the place of new_element_0.  Two New values (1 and 2) must be created in the same way.

  5. If it is necessary to change the value of a particular Input value, click on the Input value in question and press F2, then type the new value in its place.

  6. Now the output classes must be created (i.e. Off, On, Standby and Unknown).  Click on the New class button, a default class, field0 is created.  Type Off in place of field0.  Create the other classes; On, Standby and Unknown, in the same way.

  7. If it is necessary to change a particular Output class name, click on the Output class in question (in the Available output classes pane) and press F2, then type the new output class name in its place.

  8. Now the input values and output classes must be associated.  Click on an Input value, then click on its associated Output class in the Available output classes pane and then click on Associate.

  9. To specify the Unknown class as that class which must be used for all undefined input values, select Unknown from the Associated class for unknown input values drop down list.

  10. If the Unknown class must be hidden in the output port, i.e. it will not be an output from the encoder block, select Unknown from the Exclude redundant class from output drop down list.

  11. Click Apply to accept changes or OK to accept changes and close the block property page.

Return to top


Related topics:

  

CSense 2023- Last updated: June 24,2025