Data Type Prefix

Standard Data Types

The data type prefix identifies the data type of variables and constants.

NOTE: The data type prefix can also be composite, for example, for pointers, references and arrays. The pointer or array is listed first, followed by the prefix of the pointer type or array type.

The IEC 61131-3 standard data type prefixes as well as the prefixes for the extensions to the standard are listed in the table.

Data type prefix

Type

Use (memory location)

Example

x

BOOL

boolean (8 bit)

xName

by

BYTE

bit sequence (8 bit)

byName

w

WORD

bit sequence (16 bit)

wName

dw

DWORD

bit sequence (32 bit)

dwName

lw

LWORD

bit sequence (64 bit)

lwName

si

SINT

short integer (8 bit)

siName

i

INT

integer (16 bit)

iName

di

DINT

doubled integer (32 bit)

diName

li

LINT

long integer (64 bit)

liName

uli

ULINT

long integer (64 bit)

uliName

usi

USINT

short integer (8 bit)

usiName

ui

UINT

integer (16 bit)

uiName

udi

UDINT

doubled integer (32 bit)

udiName

r

REAL

floating-point number (32 bit)

rName

lr

LREAL

doubled floating-point number (64 bit)

lrName

dat

DATE

date (32 bit)

datName

t

TOD

time (32 bit)

tName

dt

DT

date and time (32 bit)

dtName

tim

TIME

duration (32 bit)

timName

ltim

LTIME

duration (64 bit)

ltimName

s

STRING

character string ASCII

sName

ws

WSTRING

character string unicode

wsName

p

pointers

pointer

pxName

r

reference

reference

rxName

a

array

field

axName

e

enumeration

list type

eName

st

struct

structure

stName

if

interface

interface

ifMotion

ut

union

union

uName

fb

function block

function block

fbName

Examples

piCounter: POINTER TO INT;
aiCounters: ARRAY [1..22] OF INT;
paiRefCounter: POINTER TO ARRAY [1..22] OF INT;
apstTest   : ARRAY[1..2] OF POINTER TO ST_MotionStructure;
rdiCounter : REFERENCE TO DINT;
ifMotion   : IF_Motion;