4 LABELS
4.2 Class
33
4
4.2 Class
The label class indicates how each label can be used from which POU.
The selectable class varies depending on the POU.
4.3 Data Type
Labels are classified into several data types according to the bit length, processing method, or value range.
The following two data types are provided.
• Elementary data type
• Generic data type (ANY)
Elementary data type
The following data types are available as the elementary data type.
Global label
Class Description Applicable POU
Program
block
Function
block
Function
VAR_GLOBAL Common label that can be used in program blocks and function blocks
VAR_GLOBAL_CONSTANT Common constant that can be used in program blocks and function blocks
VAR_GLOBAL_RETAIN Latch type label that can be used in program blocks and function blocks
Local label
Class Description Applicable POU
Program
block
Function
block
Function
VAR Label that can be used within the range of declared POUs
This label cannot be used in other POUs.
VAR_CONSTANT Constant that can be used within the range of declared POUs
This label cannot be used in other POUs.
VAR_RETAIN Latch type label that can be used within the range of declared POUs This label
cannot be used in other POUs.
VAR_INPUT Label that inputs to a function or a function block.
This label receives a value, and cannot be changed in POUs.
VAR_OUTPUT Label that outputs a value from a function or a function block
VAR_OUTPUT_RETAIN Latch type label that outputs a value from a function or a function block
VAR_IN_OUT Local label which receives a value, outputs it from a POU, and can be changed
in POUs
VAR_PUBLIC Label that can be accessed from other POUs
VAR_PUBLIC_RETAIN Latch type label that can be accessed from other POUs
Data type Description Value range Bit
length
Bit BOOL Represents binary status, such as ON or
OFF
0 (FALSE), 1 (TRUE) 1-bit
Word [Unsigned]/Bit String [16-bit] WORD Represents 16-bit 0 to 65535 16-bit
Double Word [Unsigned]/Bit String
[32-bit]
DWORD Represents 32-bit 0 to 4294967295 32-bit
Word [Signed] INT Handles positive and negative integer
values
-32768 to +32767 16-bit
Double Word [Signed] DINT Handles positive and negative double word
integer values
-2147483648 to +2147483647 32-bit
FLOAT [Single Precision] REAL Handles the portion after the decimal point
of the float (single precision)
Effective digits: 7 (after the decimal point:
6)
-2
128
to -2
-126
, 0, 2
-126
to 2
128
32-bit