Encode Function Block

The Encode function translates enumerations of a digital value into different enumeration numbers, allowing standard and custom enumerations to be combined and used together. If InEnum and one of the In values match, appropriate output value is calculated and Fire = "true". If there is no match, Output = InEnum and Fire = "false". Disable stops the function and InEnum = Output..

Figure 1: Encode Function Block

Figure 2: Encode Property Sheet

Inputs

Input Name

Description

Fire

If input InEnum matches with any input In1 to In9, then output Fire = 1.

Numeric: Binary value, 0-1.

InEnum

If the value of InEnum is not matching with any of the In1 to In9 values, Output = InEnum and FIRE = "false". If Disable is "true" the Output value = InEnum.

Numeric: 32 Bit Floating value 0-255, Default: Null

Disable

Function disable (InEnum = Output).

Numeric: Binary value 0-1, Default: Null

In1

Numeric: 32 Bit Floating value 0-255, Default: Null

In2

Numeric: 32 Bit Floating value 0-255, Default: Null

In3

Numeric: 32 Bit Floating value 0-255, Default: Null

In4

Numeric: 32 Bit Floating value 0-255, Default: Null

In5

Numeric: 32 Bit Floating value 0-255, Default: Null

In6

Numeric: 32 Bit Floating value 0-255, Default: Null

In7

Numeric: 32 Bit Floating value 0-255, Default: Null

In8

Numeric: 32 Bit Floating value 0-255, Default: Null

In9

Numeric: 32 Bit Floating value 0-255, Default: Null

Table 1: Inputs of Encode Function

Outputs

Output Name

Description

Out1

If InEnum = In1, Out = In1.

Numeric: 32 Bit Floating value 0-255, Default: Null

Out2

If InEnum = In2, Out = In2.

Numeric: Binary value 0-255, Default: Null

Out3

If InEnum = In3, Out = In3.

Numeric: 32 Bit Floating value 0-255, Default: Null

Out4

If InEnum = In4, Out = In4.

Numeric: Binary value 0-255, Default: Null

Out5

If InEnum = In5, Out = In5.

Numeric: 32 Bit Floating value 0-255, Default: Null

Out6

If InEnum = In6, Out = In6.

Numeric: Binary value 0-255, Default: Null

Out7

If InEnum = In7, Out = In7.

Numeric: 32 Bit Floating value 0-255, Default: Null

Out8

If InEnum = In8, Out = In8.

Numeric: Binary value 0-255, Default: Null

Out9

If InEnum = In9, Out = In9.

Numeric: Binary value 0-255, Default: Null

Table 2: Outputs of Encode Function

Parameters

Parameter Name

Description

In1

(In & Par)

Numeric: 32 Bit Floating value 0-255, Default: Null

In2

(In & Par)

Numeric: Binary value 0-1, Default: Null

In3

(In & Par)

Numeric: 32 Bit Floating value 0-255, Default: Null

In4

(In & Par)

Numeric: 32 Bit Floating value 0-255, Default: Null

In5

(In & Par)

Numeric: 32 Bit Floating value 0-255, Default: Null

In6

(In & Par)

Numeric: 32 Bit Floating value 0-255, Default: Null

In7

(In & Par)

Numeric: 32 Bit Floating value 0-255, Default: Null

In8

(In & Par)

Numeric: 32 Bit Floating value 0-255, Default: Null

In9

(In & Par)

Numeric: 32 Bit Floating value 0-255, Default: Null

Out1 Par

If InEnum = In1, Out = In1.

Numeric: 32 Bit Floating value 0-255, Default: Null

Out2 Par

If InEnum = In2, Out = In2.

Numeric: Binary value 0-255, Default: Null

Out3 Par

If InEnum = In3, Out = In3.

Numeric: 32 Bit Floating value 0-255, Default: Null

Out4 Par

If InEnum = In4, Out = In4.

Numeric: Binary value 0-255, Default: Null

Out5 Par

If InEnum = In5, Out = In5.

Numeric: 32 Bit Floating value 0-255, Default: Null

Out6 Par

If InEnum = In6, Out = In6.

Numeric: Binary value 0-255, Default: Null

Out7 Par

If InEnum = In7, Out = In7.

Numeric: 32 Bit Floating value 0-255, Default: Null

Out8 Par

If InEnum = In8, Out = In8.

Numeric: Binary value 0-255, Default: Null

Out9 Par

If InEnum = In9, Out = In9.

Numeric: Binary value 0-255, Default: Null

Out Save

Master Sync Enabled: If you set it to "true" the last output will be set as output for one cycle after the controller restarts. The application can use it to return to the same state before the controller restart.

Out: To enable or disable the Out feature.

Fire: To enable or disable the Fire feature.

Table 3: Parameters of BacnetNumericInput Function

Examples

  1. If the value of InENum is not matching with any of the In1 to In9 values, Output = InENum and Fire = "false".

    InENum = 15, Output = 15, Fire = "false".

  2. If the value of InENum is not matching with any of the In1 to In9 values, Output = InENum and If Disable = "true", Output = InENum.

    InENum ==15, Output = 15, Disable = "true", Fire = "true".

  3. To map a standard HVAC enumeration into a custom enumeration, the standard HVAC enumeration and desired mapping is as shown as below.

    InEnum = 4, i.e. HVAC_NIGHT PURGE, Output is in NIGHTMODE=7

Refer to General Description for general information about IRM N4 Function Blocks.