This article relies largely or entirely on a single source. (March 2017)
IEC 61131-3 is the third part (of 10) of the open international standard IEC 61131 for programmable logic controllers, and was first published in December 1993 by the IEC. The current (third) edition was published in February 2013.
- Ladder diagram (LD), graphical
- Function block diagram (FBD), graphical
- Structured text (ST), textual
- Instruction list (IL), textual (deprecated in 3rd edition of the standard)
- Sequential function chart (SFC), has elements to organize programs for sequential and parallel control processing.
- Elementary Data Type
- Bit Strings – groups of on/off values
- INTEGER – whole numbers (Considering byte size 8 bits)
- SINT – signed short integer (1 byte)
- INT – signed integer (2 byte)
- DINT – signed double integer (4 byte)
- LINT – signed long integer (8 byte)
- USINT – Unsigned short integer (1 byte)
- UINT – Unsigned integer (2 byte)
- UDINT – Unsigned double integer (4 byte)
- ULINT – Unsigned long integer (8 byte)
- REAL – floating point IEC 60559 (same as IEEE 754-2008)
- REAL – (4 byte)
- LREAL – (8 byte)
- TIME – (Size is not specified)
- LTIME – (8 byte)
- DATE – calendar date (Size is not specified)
- LDATE – calendar date (Size is not specified)
- Time of day
- TIME_OF_DAY / TOD – clock time(Size is not specified)
- LTIME_OF_DAY / LTOD – clock time (8 byte)
- Date and time of Day
- DATE_AND_TIME / DT – time and date(Size is not specified)
- LDATE_AND_TIME / LDT – time and date(8 byte)
- Character / Character string
- CHAR – Single-byte character (1 byte)
- WCHAR – Double-byte character (2 byte)
- STRING – Variable-length single-byte character string
- WSTRING – Variable-length double-byte character string
|$P||page (form feed)|
- Generic Data Types – Only available for the input / output/ in-out variables of system-defined Program Organization Units (POUs, see below)
- ANY_REAL: LREAL, REAL
- ANY_UNSIGNED: ULINT, UDINT, UINT, USINT
- ANY_SIGNED: LINT, DINT, INT, SINT
- ANY_DURATION: TIME, LTIME
- ANY_BIT: LWORD, DWORD, WORD, BYTE, BOOL
- ANY_STRING: STRING, WSTRING
- ANY_CHAR: CHAR, WCHAR
- ANY_DATE: DATE_AND_TIME (DT), DATE_AND_TIME(LDT), DATE, TIME_OF_DAY (TOD), LTIME_OF_DAY(LTOD)
- User-defined Data Types
- Enumerated data type
- Enumerated data type with named value
- Subrange data type – puts limits on value i.e., INT(4 .. 20) for current
- Array data type – multiple values stored in the same variable.
- Structured data type – composite of several variables and types.
- Directly derived data type – type derived from one of the above types to give new name and initial value as a type.
- References – a kind of strongly typed pointer. Arithmetic operation of the value of this type is prohibited.
Variable attributes: RETAIN, CONSTANT, AT
- Direct (local)
- I/O Mapping – Input, Output, I/O
- Resource – Like a CPU
- Tasks – Can be multiple per CPU.
- Programs – Can be executed once, on a timer, on an event.
Program organization unit (POU)
- Standard: ADD, SQRT, SIN, COS, GT, MIN, MAX, AND, OR, etc.
- Function Blocks
- Custom – Libraries of functions can be supplied by a vendor or third party.
Configuration, resources, tasks
- Configuration – processing resources, memory for IO, execution rates, number of tasks.
Tom Mejer Antonsen, "PLC Controls with Structured Text (ST), 2018, ISBN: 978-87-4300-241-3, ISBN: 978-87-4300-242-0