Professional Documents
Culture Documents
Description
Compliance
In/Out
The In/Out column uses the terms Support or No Support to denote whether a particular feature is either included
or not included. In some cases, supported features will include further explanation as described below.
An additional section may be provided within each table to offer further clarification or explanation of an individual
feature. This section will appear as follows and will be included at the end of each table where applicable.
MANUFACTURERS NOTE:
Page 1
Description
Compliance
Base Level
Base Level
In/Out
Support
Support
Support
Subscript delimiters
6a
6b
NOTE - When lower-case letters (feature 2) are supported, the case of letters shall not be significant in language
elements (except within terminal symbols as defined in annexes A and B, comments as defined in 2.1.5, string
literals as defined in 2.2.2, and variables of type STRING as defined in 2.3.1), e.g., the identifiers "abcd",
"ABCD", and "aBCd" shall be interpreted identically.
Table 2 - Identifier features
No.
Feature description
1
Upper case and numbers
Examples
IW215 IW215Z QX75 IDENT
Compliance
Base Level
In/Out
Support
Base Level
Support
Comments
Examples
(********************)
(* A framed comment *)
(********************)
Support
Compliance
In/Out
Base Level
Support
Compliance
In/Out
Feature description
Examples
Integer literals
Real literals
Page 2
Support
Support
Support
Support
Support
Support
In/Out
Support
Support
Support
Support
Support
Examples
T#14ms T#14.7s T#14.7m
T#14.7h t#14.7d t#25h15m
t#5d14h12m18s3.5ms
TIME#14ms time#14.7s
T#25h_15m
T#5d_14h_12m_18s_3.5ms
Compliance
In/Out
TIME#25h_15m
time#5d_14h_12m_18s_3.5ms
Prefix Keyword
DATE#
D#
TIME_OF_DAY#
TOD#
DATE_AND_TIME#
DT#
Page 3
Compliance
In/Out
Compliance
In/Out
D#1984-06-25
d#1984-06-25
TOD#15:36:55.36
tod#15:36:55.36
DT#1984-06-25-15:36:55.36
dt#1984-06-25-15:36:55.36
Page 4
Feature/textual example
Compliance
In/Out
Page 5
Initial value
Compliance
In/Out
Base Level
Support
Compliance
In/Out
Page 7
Variable usage
Compliance
In/Out
VAR
VAR_INPUT
VAR_OUTPUT
1. The VAR_EXTERNAL and VAR_GLOBAL keywords are implicitly supported through use of the global
variable tables. The VAR, VAR_IN, VAR_IN_OUT, and VAR_OUT keywords are explicitly supported in the
local variable table.
2. The AT keyword is implicitly supported in the global variable table through symbolic addressing.
Page 8
Page 9
Page 10
Feature
Representation
B
<name>
B
C
<name>
in
Compliance
In/Out
Base Level
Support
NOTE - If either of these features is supported for functions, it shall also be supported for function blocks as defined in
2.5.2, and vice versa.
MANUFACTURERS NOTE:
Formal parameter names are supported for parameterized subroutine calls. Parameters names declared in the local
variable table of the subroutine are shown within the representation of the calling subroutine instruction.
Feature
Representation
FF75
SR
S1 Q1
Compliance
In/Out
Base Level
Support
NOTE - If either of these features is supported for functions, it shall also be supported for function blocks as defined in
2.5.2, and vice versa.
MANUFACTURERS NOTE:
Formal parameter names, type names, and instance names are provided for standard function blocks. User declared
function blocks are not supported.
Page 11
Representation
Compliance In/Out
+---+
---O|
|--1
Negated input
Support
+---+
+---+
----|
|O--2
Negated output
+---+
NOTE - If either of these features is supported for functions, it shall also be supported for function blocks as defined
in 2.5.2, and vice versa.
Table 20 - Use of EN input and ENO output
No.
Feature
Example
+-------+
|
| ADD_EN |
+
| ADD_OK |
Use of "EN" and "ENO" +---||---|EN ENO|---( )---+
- REQUIRED for LD
|
|
|
|
(Ladder Diagram) language |
A---|
|---C
|
(see 4.2)
|
B---|
|
|
+-------+
|
+-------+
|
+
|
Use of "EN" and "ENO"
ADD_EN--|EN ENO|---ADD_OK
- OPTIONAL for FBD
A---|
|---C
(Function Block Diagram)
B---|
|
language (see 4.3)
+-------+
+-----+
A---| + |---C
FBD without "EN" and "ENO" B---|
|
+-----+
Compliance
In/Out
Support
Support
Example
Compliance In/Out
+-----+
| ADD |
ANY_NUM--|
|--ANY_NUM
ANY_NUM--|
|
1 Overloaded functions
Support
.
--|
|
.
--|
|
ANY_NUM--|
|
+-----+
+---------+
| ADD_INT |
INT--|
|--INT
INT--|
|
2 Typed functions
Support
. --|
|
. --|
|
INT--|
|
+---------+
NOTE 1 - If feature 2 is supported, the manufacturer shall provide a table of which functions are overloaded and
which are typed in the implementation.
NOTE 2 - User-defined functions cannot be overloaded.
MANUFACTURERS NOTE: Specific, individual types are only required for functions that are not overloaded.
These are typically non-standard IEC instructions. However, BLKMOVE, INCREMENT, and DECREMENT are
non-standard IEC instructions that provided overloaded support.
Page 12
2
3
4
Usage example
+---------+
* ---| *_TO_** |--- **
+---------+
(*) - Input data type, e.g., INT
(**) - Output data type, e.g., REAL
(*_TO_**) Function name,
e.g., INT_TO_REAL
+-------+
ANY_REAL--| TRUNC |--ANY_INT
+-------+
+-----------+
ANY_BIT--| BCD_TO_** |--ANY_INT
+-----------+
+----------+
ANY_INT--| *_TO_BCD |--ANY_BIT
+----------+
Notes Compliance
In/Out
1,2,5
Support
A:= TRUNC(B);
Support
A:= BCD_TO_INT(B);
Support
Support
A:= INT_TO_REAL(B);
A:= INT_TO_BCD(B);
NOTES
1. A statement of conformance to feature 1 of this table shall include a list of the specific type conversions supported, and a
2.
3.
4.
5.
6.
Page 13
Page 14
Usage example
A := SIN(B) ;
(ST language - see 3.3)
Description
Compliance
In/Out
General functions
1
2
ABS
SQRT
ANY_NUM
ANY_REAL
Absolute value
Square root
ANY_REAL
ANY_REAL
ANY_REAL
Natural logarithm
Logarithm base 10
Natural exponential
ANY_REAL
ANY_REAL
ANY_REAL
ANY_REAL
ANY_REAL
ANY_REAL
Logarithmic functions
3
4
5
LN
LOG
EXP
Trigonometric functions
6
7
8
9
10
11
SIN
COS
TAN
ASIN
ACOS
ATAN
Page 15
Support
Name
Usage example
A := ADD(B,C,D) ;
or
A := B+C+D ;
Symbol
(note 1)
Description
(notes 2 and 8)
Compliance
In/Out
Base Level
Base Level
Support
Support
Base Level
Base Level
Support
Support
ADD
MUL
+
*
SUB
DIV
MOD
17
EXPT
**
18
NOTES
MOVE
:=
1
2
3
Support
These symbols are suitable for use as operators in textual languages, as shown in tables 52 and 55.
The notations IN1, IN2, ..., INn refer to the inputs in top-to-bottom order; OUT refers to the output.
IN1 and IN2 shall be of generic type ANY_INT for this function. The result of evaluating this function
shall be the equivalent of executing the following statements in the ST language as defined in 3.3:
IF (IN2 = 0) THEN OUT := 0 ;
ELSE OUT := IN1 - (IN1/IN2)*IN2 ;
END_IF
4
5
6
7
8
9
IN1 shall be of type ANY_REAL, and IN2 of type ANY_NUM for this function. The output shall be of the
same type as IN1.
The result of division of integers shall be an integer of the same type with truncation toward zero, for
instance, 7/3 = 2 and (-7)/3 = -2.
When the named representation of a function is supported, this shall be indicated by the suffix "n" in the
compliance statement. For example, "12n" represents the notation "ADD".
When the symbolic representation of a function is supported, this shall be indicated by the suffix "s" in the
compliance statement. For example, "12s" represents the notation "+".
Usage examples and descriptions are given in the ST language defined in 3.3.
The MOVE function has exactly one input (IN) of generic type ANY and one output (OUT) of generic type
ANY.
MANUFACTURERS NOTE: The BOOL types specified within ANY_BIT are not supported. Boolean assignment
operations are performed using the various standard and non-standard boolean functions.
Page 16
Usage example
+-----+
| *** |
ANY_BIT--|IN
|--ANY_BIT
ANY_INT--|N
|
+-----+
(***) - Function Name
No.
Name
A := SHL(IN:=B, N:=5);
(ST language - see 3.3)
Description
Compliance
SHL
OUT := IN left-shifted by N bits, zero-filled on right
1
SHR
OUT := IN right-shifted by N bits, zero-filled on left
2
ROR
OUT := IN right-rotated by N bits, circular
3
ROL
OUT := IN left-rotated by N bits, circular
4
NOTE - The notation "OUT" refers to the function output.
Table 26 - Standard bitwise Boolean functions
Graphical form
In/Out
Support
Support
Support
Support
Usage examples
+-----+
ANY_BIT--| *** |--ANY_BIT
ANY_BIT--|
|
.
--|
|
.
--|
|
ANY_BIT--|
|
+-----+
(***) - Name or symbol
A := AND(B,C,D);
or
A := B & C & D;
No.
Name
Symbol
Description
Compliance In/Out
AND
& (note 1) OUT := IN1 & IN2 & ... & INn
5
Base Level
Support
OR
=1 (note 2) OUT := IN1 OR IN2 OR ... OR INn
6
Base Level
Support
XOR
=2k+1 (note 2) OUT := IN1 XOR IN2 XOR ... XOR INn
7
Support
NOT
OUT := NOT IN1 (note 4)
8
Base Level
Support
NOTES
1 This symbol is suitable for use as an operator in textual languages, as shown in tables 52 and 55.
2 This symbol is not suitable for use as an operator in textual languages.
3 The notations IN1, IN2, ..., IN n refer to the inputs in top-to-bottom order; OUT refers to the output.
4 Graphic negation of signals of type BOOL can also be accomplished as shown in table 19.
5 When the named representation of a function is supported, this shall be indicated by the suffix "n" in the
compliance statement. For example, "5n" represents the notation "AND".
6 When the symbolic representation of a function is supported, this shall be indicated by the suffix "s" in the
compliance statement. For example, "5s" represents the notation "&".
7 Usage examples and descriptions are given in the ST language defined in 3.3.
1. MANUFACTURERS NOTE: The BOOL types specified within ANY_BIT are not supported through
these functions. Boolean bitwise operations are performed using standard boolean AND/OR functions.
Boolean NOT bitwise operations are performed with input negation.
Page 17
2a
+-----+
| SEL |
BOOL--|G
|--ANY
ANY---|IN0 |
ANY---|IN1 |
+-----+
(Note
(Note
2b
(Note
:
(Note
(Note
(Note
(Note
+-----+
| MAX |
1)--|
|--ANY
: --|
|
1)--|
|
+-----+
+-----+
| MIN |
1)--|
|--ANY
--|
|
1)--|
|
+-----+
+-------+
| LIMIT |
1)--|MN
|--ANY
1)--|IN
|
1)--|MX
|
+-------+
+-----+
| MUX |
ANY_INT--|K
|--ANY
ANY--|
|
: --|
|
ANY--|
|
+-----+
Explanation/example
Binary selection:
OUT := IN0 if G = 0
OUT := IN1 if G = 1
Compliance
In/Out
Example:
A:=SEL(G:=0,IN0:=X,IN1:=5);
Extensible maximum function:
OUT := MAX {IN1,IN2, ...,INn}
Example:
A:=MAX(B,C,D) ;
Extensible minimum function:
OUT := MIN {IN1,IN2, ...,INn}
Example:
A:=MIN(B,C,D) ;
Limiter:
OUT:=MIN(MAX(IN,MN),MX)
Example:
A:=LIMIT(IN:=B,MN:=0,MX:=5);
Extensible multiplexer:
Select one of "N" inputs depending on input
K
Example:
A:=MUX(K:=0, IN0:=B,
IN1:=C, IN2:=D);
Would have the same effect as A:=B;
NOTES
1
2
3
These inputs can be of type ANY_BIT, ANY_NUM, STRING, ANY_DATE, or TIME. The type
conversion rules given in 2.5.1.4 shall be followed for these inputs.
The notations IN1, IN2, ..., INn refer to the inputs in top-to-bottom order; OUT refers to the output.
These symbols are suitable for use as operators in textual languages, as shown in tables 52 and 55.
Page 18
Usage examples
+-----+
(Note 1)--| *** |-- BOOL
:
--|
|
(Note 1)--|
|
+-----+
(***) - Name or Symbol
No.
Name
Symbol
GT
GE
EQ
LE
<=
LT
<
10
NE
<>
A := GT(B,C,D) ;
or
A := (BC) & (CD) ;
Description
Decreasing sequence:
OUT := (IN1IN2) & (IN2IN3)
& ...& (INn-1 > INn)
Monotonic sequence:
OUT := (IN1=IN2) & (IN2=IN3)
& ...& (INn-1 >= INn)
Equality:
OUT := (IN1=IN2) & (IN2=IN3)
& ...& (INn-1 = INn)
Monotonic sequence:
OUT := (IN1<=IN2) & (IN2<=IN3)
& ...& (INn-1 <= INn)
Increasing sequence:
OUT := (IN1<IN2) & (IN2<IN3)
& ...& (INn-1 < INn)
Inequality (non-extensible):
OUT := (IN1 <> IN2)
Compliance
In/Out
Base Level
Support
Base Level
Support
Base Level
Support
Base Level
Support
Base Level
Support
Base Level
Support
NOTES
These inputs can be of type ANY_BIT, ANY_NUM, STRING, ANY_DATE, or TIME. The type
conversion rules given in 2.5.1.4 shall be followed for these inputs.
2 The notations IN1, IN2, ..., IN n refer to the inputs in top-to-bottom order; OUT refers to the output.
3 All the symbols shown in this table are suitable for use as operators in textual languages, as shown in tables
52 and 55.
4 When the named representation of a function is supported, this shall be indicated by the suffix "n" in the
compliance statement. For example, "5n" represents the notation "GT".
5 When the symbolic representation of a function is supported, this shall be indicated by the suffix "s" in the
compliance statement. For example, "5s" represents the notation "".
6 Usage examples and descriptions are given in the ST language defined in 3.3.
MANUFACTURERS NOTE: Compare operations do not support EN inputs or ENO outputs. Only one boolean
output is provided.
Page 19
++
STRING|LEN|INT
++
Explanation/example
Compliance
In/Out
++
Leftmost L characters of IN
|LEFT|
Example:
STRING|IN|STRING
A:=LEFT(IN:='ASTR',L:=3);
ANY_INT|L|
is equivalent to A:='AST';
++
++
Rightmost L characters of IN
|RIGHT|
Example:
STRING|IN|STRING
A := RIGHT(IN:='ASTR',L:=3);
ANY_INT|L|
is equivalent to A:='STR';
++
++
|MID|
L characters of IN, beginning at the P-th
STRING|IN|STRING
Example:
A:=MID(IN:='ASTR',L:=2,P:=2);
ANY_INT|L|
is equivalent to A:='ST';
ANY_INT|P|
++
++
|CONCAT|
Extensible concatenation
STRING||STRING
Example:
A:=CONCAT('AB','CD','E');
:||
is equivalent to A:='ABCDE';
STRING||
++
++
|INSERT|
Insert IN2 into IN1 after the P-th character position
STRING|IN1|STRING
Example:
A:=INSERT(IN1:='ABC',IN2:='XY',P=2);
STRING|IN2|
is equivalent to A:='ABXYC';
ANY_INT|P|
++
++
Delete L characters of IN, beginning at
|DELETE|
the P-th character position
STRING|IN|STRING
Example
A:=DELETE(IN:='ABXYC',L:=2,
ANY_INT|L|
P:=3);
ANY_INT|P|
is equivalent to A:='ABC' ;
++
++
Replace L characters of IN1 by IN2,
|REPLACE|
Starting
at the P-th character position
STRING|IN1|STRING
Example:
STRING|IN2|
A:=REPLACE(IN1:='ABCDE',IN2:='X',
ANY_INT|L|
L:=2, P:=3);
ANY_INT|P|
is equivalent to A:='ABXE';
++
Find the character position of the beginning
++
of the first occurrence of IN2 in IN1. If no
|FIND|
occurrence of IN2 is found, then OUT := 0
STRING|IN1|INT
Example:
STRING|IN2|
A:=FIND(IN1:='ABCBC',IN2:='BC');
++
is equivalent to A:=2;
NOTE - The examples in this table are given in the Structured Text (ST) language defined in 3.3.
Page 20
Compliance
In/Out
Page 21
4a
4b
5a
5b
6a
6b
7a
7b
8a
8b
9a
9b
Example
VAR RETAIN
X:REAL;
END_VAR
VAR_OUTPUT RETAIN
X:REAL;
END_VAR
VAR RETAIN
TMR1:TON;
END_VAR
VAR_INPUT
X:INT;
END_VAR
VAR_IN_OUT
A:INT;
END_VAR
A:=A+X;
See figure 12
VAR_INPUT
I_TMR:TON;
END_VAR
EXPIRED:=I_TMR.Q; (*Note 1*)
See figure 11a
VAR_EXTERNAL
EX_TMR:TOF;
END_VAR
EX_TMR(IN:=A_VAR,PT:=T#10S);
EXPIRED:=I_TMR.Q;(*Note 1*)
See figure 11b
Page 22
Compliance
In/Out
NOTES
1 It is assumed in these examples that the variables EXPIRED and A_VARhave been declared of type BOOL.
2 The declaration of function block AND_EDGE in the above examples is equivalent to:
FUNCTION_BaseLevelOCKAND_EDGE
VAR_INPUTXCLK:BOOL;YCLK:BOOL;END_VAR
VARX_TRIG:R_TRIG;Y_TRIG:F_TRIG;END_VAR
X_TRIG(CLK:=XCLK);X:=X_TRIG.Q;
Y_TRIG(CLK:=YCLK);Y:=Y_TRIG.Q;
Z:=XANDY;
END_FUNCTION_BaseLevelOCK
See 2.5.2.3.2 for the definition of the edge detection function blocks R_TRIG and F_TRIG.
Table 34 - Standard bistable function blocks
No.
Graphical form
Function block body
Compliance In/Out
1
Bistable Function Block (set dominant) (Notes 1 and 2)
Base Level Support
+-----+
+-----+
S1----------| >=1 |--Q1
| SR |
+---+ |
|
BOOL--|S1 Q1|--BOOL
R---O| & |--|
|
BOOL--|R
|
Q1---|
| +-----+
+-----+
+---+
2
Bistable Function Block (reset dominant) (Notes 1 and 2)
Base Level Support
+---+
+-----+
R1----------O| & |--Q1
| RS |
+-----+ |
|
BOOL--|S Q1|--BOOL
S---| >=1 |--|
|
BOOL--|R1
|
Q1--|
| +---+
+-----+
+-----+
3
Semaphore with non-interruptible "Test and Set" (Notes 3, 4, 5 and 6 )
VAR
X : BOOL := 0;
+-----------+
END_VAR
|
SEMA
|
BUSY := X ;
BOOL--|CLAIM BUSY|--BOOL IF CLAIM THEN
BOOL--|RELEASE
|
X := 1;
+-----------+
ELSIF RELEASE THEN
BUSY := 0; X := 0;
END_IF
NOTES
1 The function block body is specified in the Function Block Diagram (FBD) language defined in 4.3.
2 The initial state of the output variable Q1 shall be the normal default value of zero for Boolean variables.
3 The function block body is specified in the Structured Text (ST) language defined in 3.3.
4 This function block is intended to be used for controlling access to operating system resources; therefore,
the first two statements in the function block body, namely,
BUSY := X; IF CLAIM THEN X := 1 ;
shall be non-interruptible.
5 User programs must co-operate in such a way that only the "owner" of a semaphore, that is, the most recent
entity to successfully assert a CLAIM on a non-BUSY semaphore, can RELEASE the semaphore.
6 Figure 13 shows a program fragment using a semaphore declared as VAR_GLOBAL to control access to a
printer resource, using SFC elements (see 2.6).
Page 23
Page 24
Compliance
In/Out
1.
All Q, QU, and QD counter outputs are provided as boolean parameters not powerflows.
1.
Compliance
Base Level
Base Level
In/Out
Support
Support
Base Level
Support
Page 25
+--------+
++ ++
+--------+
|
|
|| ||
|
|
--+
+-----++-++---+
+--------t0
t1
t2 t3
t4
t5
+----+
+----+ +----+
|
|
|
| |
|
--+
+---------+
+--+
+------------t0
t0+PT
t2 t2+PT t4 t4+PT
PT
+---+
+
+---+
:
/
|
/|
/
|
ET :
/
|
/ |
/
|
:
/
|
/ |
/
|
: /
|
/
|
/
|
0-+
+-----+
+--+
+--------t0
t1
t2
t4
t5
On-delay (TON) timing
IN
+--------+
+---+
+--------+
|
|
|
|
|
|
--+
+--------+
+---+
+------------t0
t1
t2 t3 t4
t5
+---+
+---+
|
|
|
|
-------+
+---------------------+
+------------t0+PT t1
t4+PT
t5
PT
+---+
+---+
:
/
|
+
/
|
ET :
/
|
/|
/
|
:
/
|
/ |
/
|
: /
|
/ |
/
|
0-+
+--------+
+---+
+------------t0
t1
t2 t3 t4
t5
Off-delay (TOF) timing
IN
+--------+
+---+
+--------+
|
|
|
|
|
|
---+
+--------+
+---+
+----------t0
t1
t2 t3 t4
t5
+-------------+
+---------------------+
|
|
|
|
---+
+---+
+-----t0
t1+PT t2
t5+PT
PT
+---+
+-----:
/
|
+
/
ET :
/
|
/|
/
:
/
|
/ |
/
:
/
|
/ |
/
0------------+
+---+
+--------+
t1
t3
t5
Page 26
Example
Horizontal/vertical connections:
ISO/IEC 646 plus character
6
Graphic or semigraphic horizontal/vertical connections
10
11
12
Base Level
Support
|
Graphic or semigraphic vertical lines
8
9
Support
Vertical lines:
ISO/IEC 646 vertical line character
Base Level
In/Out
Horizontal lines:
ISO/IEC 646 minus character
2
3
Compliance
|
--+-|
Support
|
|
-----||
|
Graphic or semigraphic line crossings without connection
|
|
Connected and non-connected corners:
--+
+--ISO/IEC 646 characters
|
--+-+ +--| | |
Graphic or semigraphic connected and non-connected corners
Blocks with connecting lines:
|
ISO/IEC 646 characters
+-----+
--|
|
|
|---|
|
+-----+
|
Graphic or semigraphic blocks with connecting lines
13
14
Page 27
-->OTTO>
>OTTO>--
Base Level
Support
Explanation
Compliance
In/Out
Unconditional Jump
1
2
1----LABELA
FBD Language
|
+----LABELA
|
LD Language
Support
Conditional Jump
3
X----LABELB
FBD Language
+---+
%IX20---| & |---NEXT
%MX50---|
|
+---+
NEXT:
+---+
%IX25---|>=1|---%QX100
%MX60---|
|
+---+
4
Support
| X
+-| |--->>LABELB
|
|
|
%IX20
%MX50
+---| |-----| |-->>NEXT
|
|
NEXT:
|
%IX25
%QX100 |
+----| |----+----( )---+
|
%MX60
|
|
+----| |----+
|
|
|
LD Language
Conditional Return
5
6
|
X
+--| |---<RETURN>
|
X---<RETURN>
LD Language
FBD Language
Support
Unconditional Return
7
8
END_FUNCTION
END_FUNCTION_Base
LevelOCK
|
+---<RETURN>
|
From FUNCTION
from FUNCTION_Base LevelOCK
Alternative representation in LD language
Page 28
Support