The leader in industrial automation and control solutions

PLC Data Registers

In Structured Text programs, PLC data registers can be used directly. Data registers can be used on the right or left side of an expression. Additionally, they can be used in functions. It is similar to PLC data registers, but there is a prefix between the data register type and address, which indicates a BOOL and WORD.

PLC Data Registers

ItemDescription
None1-bit data register
X1-bit data register
WWORD (16-bit) data register

PLC Data Registers Example

ExampleResult
MX00 := 1The value of M0.0 is 1 (turns M0.0 ON)
MX01 := 1The value of M0.1 is 1 (turns M0.1 ON)
DW100 := 100The value of D100 is 100
DW101 := 0X100The value of D101 is 0x100 (Hexadecimal)

Data register mapping:

  • X, Y, M, L, K, F: None, X, W
  • T, C, S: None, X
  • D: X, W
  • Z, TC, TS, CC, CS: W

Variables

A variable is a string made up of the accessible characters in a Structured Text program. There are two types of variables: Local Variable and Global Variable.

Local Variables are used within one Structured Text program. Global Variables can be used by any Structured Text program.

When registering Global Variables, it is possible to designate a specific PLC data register. Designating a specific PLC data register is known as memory allocation. If a PLC data register is not designated, internal memory will be allocated automatically.

Naming Rules

  • Characters allows: alphanumeric
  • Reserved WORDs cannot be used.
  • Maximum length of 32 bytes.
  • Variables are NOT case-sensitive

Variable Data Types

Name (Reserved)Data TypeBit Size
SINTShort Integer8
INTInterger16
DINTDouble Integer32
USINTUnsigned Short Integer8
UINTUnsigned Integer16
UDINTUnsigned Double Integer32
REALFloat/Real Number32
BOOLBoolean1
BYTEBit string length of 88
WORDBit string length of 1616
DWORDBit string length of 3232
ARRAYArray
STRUCTStruct