Encode

At the input, the function block consists of  pins inEnum and disable, and 9 input pins. The output pins are Out, Fire, and 6 output pins. This function translates enumeration of a digital value into different enumeration numbers, allowing standard and custom enumeration to be combined and used together. If a match between inEnum and one of the in values is found, then the appropriate output value is put into out and the fire line is true. If there is no match, then the inEnum is put to the out and fire is false. Disable disables all matching and allows the inEnum to be put to the out line.

Analog Inputs

Range
Input Name Low High Input Value Description
inEnum 0 255 unconnected val = 255
invalid val = 255
val matches an input value output = matching output value of the input
val matches two or more input values Output = matching first output value of the input
Disable 0 255 unconnected Val = 0
invalid Val = 0
Val not equal to  0 All mappings disable, pass input to output
Val equal to 0 Enable mappings
in 1,2,3 0 16777215.0 0xAABBCC
  • Input 1 value 0xAA maps to output 1 values
  • Input 2 value 0xBB maps to output 2
  • Input 3 value 0xCC maps to output 3
in 4,5,6 0 16777215.0 0xDDEEFF
  • Input 4 value 0xDD maps to output 4 values
  • Input 5 value 0xEE maps to output 5
  • Input 6 value 0xFF maps to output 6
in 7,8,9 0 16777215.0 0xGGHHII
  • Input 7 value 0xGG maps to output 7 values
  • Input 8 value 0xHH maps to output 8
  • Input 9 value 0xII maps to output 9
out 1,2,3 0 16777215.0 0xaabbcc
  • Input 1 value 0xaa maps to output 1 values
  • Input 2 value 0xbb maps to output 2
  • Input 3 value 0xcc maps to output 3
out 4,5,6 0 16777215.0 0xddeeff
  • Input 4 value 0xdd maps to output 4 values;
  • Input 5 value 0xee maps to output 5
  • Input 6 value 0xff maps to output 6
out 7 0 255 0xgg
  • Input 7 value 0xgg maps to output 7 values
out 8 0 255 0xhh
  • Input 8 value 0xhh maps to output 8 values
out 9 0 255 0xii
  • Input 9 value 0xii maps to output 9 values

Note: In123, In456, In789, Out 123,and Out456 are created by taking each individual input value (0-255) and convert to a hex byte (0x00 – 0xFF) and putting first value in Most Significant Byte, 2nd value in middle and 3rd value in Least Significant Byte. The end result gives an integer value that must be stored as a float. So if In1 is 1, In2 is 2 and In3 is 3 then the integer would be 0x010203=66051, and the float value stored as a parameter would be 66051.0. The tool prompts the user for individual in1.. out9 values and do the conversion both to and from the packed structure for the user.

Analog Outputs

Output Name Range Input Value Description
Low High
OUTPUT 0 255 See Description
  • If input matches a block mapping and disable is false, then output = block mapping. If input does not mach a block mapping or if disable is true, the output = input.
FIRE 0 1 See Description
  • If disable is false and input matches a block mapping then fire is true. If disable is true then fire is true.

For example, to map a standard HVAC enumeration into a custom enumeration, the standard HVAC enumeration and desired mapping is as follows:

In parameter Input Enumeration Out parameter Output Enumeration
In1 HVAC_AUTO                            0 Out1 COOL_MODE                 0
In2 HVAC_HEAT                            1 Out2 HEAT_MODE                  2
In3 HVAC_MORNING_WARM_UP                                                     2 Out3 HEAT_MODE                   2
In4 HVAC_COOL                           3 Out4 COOL_MODE                 0
In5 HVAC_NIGHT_PURGE            4 Out5 NIGHT_MODE                7
In6 HVAC_PRECOOL                    5 Out6 COOL_MODE                 0
In7 HVAC_OFF                               6 Out7 OFF_MODE                 255
In8 HVAC_TEST                              7 Out8 OFF_MODE                 255
In9 HVAC_EMERGENCY_HEAT  8 Out9 EMERG_HEAT                3
Block 2 passed through HVAC_FAN_ONLY                  9 Block2 not used Pass through (output =9)    (Does not require mapping because the output is the same as the input.)
Block2In1 HVAC_NUL                          255 Block2Out1 REHEAT_MODE              1

The first encode function block parameters are:

And the Second block:

The input pins for the first block are inEnum and disable. The output pins for the first block, Out and Fire provides the inputs to the input pins inEnum and disable of the second block. The final output is provided by output pins Out and Fire of the second block.