Variables
Variable is a string that is defined by the user, which is made up of the accessible characters in ST program.
There are two types of variables: Local Variable, which is only usable in one ST program, and Global Variable which is usable in any ST programs.
When registering Global variables, it is possible to designate a specific PLC device. Designating a specific PLC device is called memory allocation. If the PLC device is not designated, internal memory will be allocated automatically.
Since Local variables are only usable in one ST program, all Local variables use the automatically allocated internal memory
Naming Rule
The characters that are allowed are alphanumeric, Korean, and ‘ ‘ .
Reserved words cannot be used as a variable.
Maximum length of a variable is 32 bytes. (In case of using Korean only – Maximum 16 characters)
The variables are not case-sensitive.
Data Types
Data types and their sizes are as shown below.
Name (Reserved) | Data Type | Bit Size |
SINT | Short Integer | 8 |
INT | Integer | 16 |
DINT | Double Integer | 32 |
USINT | Unsigned Short Integer | 8 |
UINT | Unsigned Integer | 16 |
UDINT | Unsigned Double Integer | 32 |
REAL | Real Number | 32 |
BOOL | Boolean | 1 |
BYTE | Bit string of length 8 | 8 |
WORD | Bit string of length 16 | 16 |
DWORD | Bit string of length 32 | 32 |
ARRAY | Array | - |
STRUCT | Struct | - |