Movatterモバイル変換


[0]ホーム

URL:


Jump to content
WikipediaThe Free Encyclopedia
Search

IEC 61131-3

From Wikipedia, the free encyclopedia
Industrial standard for programmable logic controllers
This articlerelies largely or entirely on asingle source. Relevant discussion may be found on thetalk page. Please helpimprove this article byintroducing citations to additional sources.
Find sources: "IEC 61131-3" – news ·newspapers ·books ·scholar ·JSTOR
(March 2017)

IEC 61131-3is the third part (of 10) of theinternational standardIEC 61131 forprogrammable logic controllers. It was first published in December 1993[1] by theIEC; the current (fourth) edition was published in May 2025.[2]

Part 3 ofIEC 61131 deals with basic software architecture andprogramming languages of the control program withinPLC. It defines three graphical and two textual programming language standards:

Data types

[edit]

Elementary Data Types (basic)

[edit]
  • Bit Strings – groups of on/off values
    • BOOL - 1 bit (0,1)
    • BYTE – 8 bit (1 byte)
    • WORD – 16 bit (2 byte)
    • DWORD – 32 bit (4 byte)
    • LWORD – 64 bit (8 byte)
  • 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 asIEEE 754-2008)
    • REAL – (4 byte)
    • LREAL – (8 byte)

Elementary Data Types (Date and Time)

[edit]
Duration literals
UnitDescription
dDay
hHour
mMinute
sSecond
msMillisecond
usMicrosecond
nsNanosecond
  • Duration[3]
    • TIME – (implementer specific). Literals in the form of T#5m90s15ms
    • LTIME – (8 byte). Literals extend to nanoseconds in the form of T#5m90s15ms542us15ns
  • Date
    • DATE – calendar date (implementer specific)
    • LDATE – calendar date (8 byte, nanoseconds since 1970-01-01, restricted to multiple of one day)
  • Time of day
    • TIME_OF_DAY / TOD – clock time (implementer specific)
    • LTIME_OF_DAY / LTOD – clock time (8 byte)
  • Date and time of Day
    • DATE_AND_TIME / DT – time and date (implementer specific)
    • LDATE_AND_TIME / LDT – time and date (8 byte, nanoseconds since 1970-01-01)

Elementary Data Types (Character / Character string)

[edit]
STRING escape sequences
Escape sequenceProduces
$$$
$''
$Llinefeed
$Nnewline
$Ppage (form feed)
$Rreturn
$Ttab
$xxhex value
  • Existing
    • CHAR – Single-byte character (1 byte, limited to characters 0 to 255 of ISO/IEC 10646)
    • WCHAR – Double-byte character (2 byte, limited to characters 0 to 65535 of ISO/IEC 10646)
    • STRING – Variable-length single-byte character string. Literals specified with single quote, 'This is a STRING Literal'
    • WSTRING – Variable-length double-byte character string. Literals specified with a double quote, "This is a WSTRING Literal"
  • New in version 4 of the standard
    • UCHAR – Single character encoded according to UTF-8
    • USTRING - Variable-length character string in which each character is encoded according to UTF-8

Generic Data Types

[edit]

Only available for the input / output/ in-out variables of system-defined Program Organization Units (POUs, see below)

  • ANY
  • ANY_DERIVED
  • ANY_ELEMENTARY
    • ANY_MAGNITUDE
      • ANY_NUM
        • ANY_REAL: LREAL, REAL
        • ANY_INT
          • ANY_UNSIGNED: ULINT, UDINT, UINT, USINT
          • ANY_SIGNED: LINT, DINT, INT, SINT
      • ANY_DURATION: TIME, LTIME
    • ANY_BIT: LWORD, DWORD, WORD, BYTE, BOOL
    • ANY_CHARS
      • 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

[edit]
  • 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 samevariable.
  • 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.

Variables

[edit]

Variable attributes: RETAIN, CONSTANT, AT

  • Global
  • Direct (local)
  • I/O Mapping – Input, Output, I/O
  • External
  • Temporary

Configuration

[edit]
  • Resource – Like aCPU
  • Tasks – Can be multiple perCPU.
  • Programs – Can be executed once, on a timer, on an event.

Program organization unit (POU)

[edit]
  • Functions
    • Standard: ADD, SQRT, SIN, COS, GT, MIN, MAX, AND, OR, etc.
    • Custom
  • Function Blocks
    • Standard:
    • Custom – Libraries of functions can be supplied by a vendor or third party.
  • Programs

Configuration, resources, tasks

[edit]
  • Configuration – processing resources, memory for IO, execution rates, number of tasks.

Object oriented programming (OOP)

[edit]
  • The 3rd revision of the standard describes how to implement OOP within the application programming

References

[edit]
  1. ^Stevic, Tom (5 May 2017)."A very short history of PLC programming platforms". Control Design. Retrieved11 September 2021.
  2. ^"IEC 61131-3:2013". International Electrotechnical Commission (IEC). Retrieved11 September 2021.
  3. ^"Time Duration Literals (IEC 61131-3)".

External links

[edit]
  • PLCopen
  • [1] IEC 61131-3:2025 Programmable controllers – Part 3: Programming languages
  • CODESYS – an implementation independent of device manufacturers, includes object oriented programming (OOP) as an option
  • de:STEP 7 implementation for Siemens devices, only
IEC
ISO/IEC
Related
Retrieved from "https://en.wikipedia.org/w/index.php?title=IEC_61131-3&oldid=1308024925"
Categories:
Hidden categories:

[8]ページ先頭

©2009-2025 Movatter.jp