FB_HVACConvertEnum

FB_HVACConvertEnum 1:

This function block converts an Enum into an integer value and vice versa. This conversion is particularly suitable for Enums that are used as VAR_IN_OUT variables on function blocks.

VAR_INPUT

pEnum           : UDINT;
udiLenEnum      : UDINT;
pInt            : UDINT;
udiLenInt       : UDINT;

pEnum: Address of the enum to be converted. The address is determined with the ADR operator.

udiLenEnum: Number of bytes of which the data type Enum consists. The number is determined with the SIZEOF operator.

pInt:  Address the integer variable to be converted. The address is determined with the ADR operator.

udiLenInt: Number of bytes of which the data type Integer consists. The number is determined with the SIZEOF operator.

VAR_OUTPUT

bError           : BOOL;
eErrorCode       : E_HVACErrorCodes;

bError: This output indicates with a TRUE that there is an error. (The number of bytes of which the data types Integer or Enum consist is wrong.)

eErrorCode: Supplies the error number when the output bError is set. The following errors can occur in this function block: eHVACErrorCodes_Error_LEN_Int (43), eHVACErrorCodes_Error_LEN_Enum (44) (see E_HVACErrorCodes).

Requirements

Development environment

required library

required function

TwinCAT 3.1 build 4022.16 or higher

Tc2_HVAC V3.3.1.0

TF8000 | TC3 HVAC V1.0.0.0