Professional Documents
Culture Documents
Instantiation......................................................................................................................................5
i
Chapter contents : IEC 61131 Basics
IEC 61131−3 and your programming system
Program and function block instances in the instance tree................................................29
Variable declaration keywords for program and FB instances...........................................30
ii
What is IEC 61131?
The standard IEC 61131 has been established to standardize the multiple languages, sets of
instructions and different concepts existing in the field of automation systems. The great variety of
PLC concepts has led to an incompatibility between the different PLC platforms and manufacturers.
The result was a great effort to be made for training, hard− and software investments.
IEC 61131 standardizes the programming languages, the interfaces between PLC and
programming system, the sets of instructions and the handling and structuring of projects. The
advantage of using IEC 61131 conform PLCs and programming systems is a portability of all
platforms and the use of same concepts reducing costs for automation systems.
The main changes that have come with IEC 61131−3 are:
1
Configuration elements in IEC 61131−3
An IEC 61131−3 conform PLC programming system reflects the hardware structure by
configuration elements. These configuration elements are basically configurations, resources and
tasks.
IEC 61131−3 describes different time scheduling models which results in different task types:
• Default task. Each resource can contain one default task. The default task is the task with
the lowest priority (lower than cyclic tasks) and is not time scheduled. After executing it
completely the system waits for a defined idle time. If then no cyclic task or any other task
with a higher priority has to be processed, the default task is executed again
automatically. This means that the default task is always executed (apart from the
necessary pre−defined idle period between two invocations), as long as no task with a
higher priority runs.
• Cyclic tasks are activated in a certain time interval and the program is executed
periodically.
• System tasks are called automatically by the PLC operating system if an error or a
change of the operational state of the PLC occurs. They are also known as system
programs or SPGs.
Each task has a certain priority. In so called preemptive scheduling systems, an active task with
low priority is interrupted immediately, when a task with higher priority becomes active due to a
certain event. In systems with non−preemptive scheduling, task interruptions by tasks with higher
priority are not possible.
2
POUs in IEC 61131−3
Overview
According to IEC 61131−3 program organization units or POUs are the language elements of a
PLC program. They are small, independent software units containing the program code. The name
of a POU must be unique within the project.
• programs
• function blocks (FBs)
• functions
Each POU consists of two different parts: The variables declaration part and the code body part.
Both are designated as 'Worksheets'. In the declaration part all local variables are declared. The
instruction or code body part of a POU contains the instructions, programmed in the desired
programming language.
Function POUs
Functions are POUs with multiple input parameters and exactly one output parameter. Calling a
function with the same values returns always the same result. Return values can be single data
types. Within a function it is possible to call another function but not a function block or a program.
Recursive calls are not allowed. The abbreviation for functions is FU.
IEC 61131−3 describes standard functions. Depending on the used hardware and PLC type
possibly not all standard functions are available or firmware functions are provided.
For detailed information about IEC 61131−3 standard functions please refer to the
Function/Function block Online Help. For that purpose you can either select the menu item '? >
Help on FB/FU' or call the context sensitive help topic out of the Edit Wizard.
3
Program POUs
IEC 61131−3 describes standard function blocks. Depending on the used hardware and PLC type
possibly not all standard function blocks are available or firmware function blocks are provided. All
FBs (IEC−defined, firmware FBs and user defined FB POUs) can easily be inserted into the code
body of a calling POU using the Edit Wizard. Each called FB has to be declared in the local
variables worksheet of the calling POU. Calling a FB in another POU is designated as instantiation.
For detailed information about IEC 61131−3 standard function blocks please refer to the
Function/Function block Online Help. For that purpose you can either select the menu item '? >
Help on FB/FU' or call the context sensitive help topic out of the Edit Wizard.
Program POUs
Programs POUs usually contain a logical combination of function/function block calls. The behavior
and use of programs are similar to function blocks. Programs have input and output parameters
and they can have an internal memory. Recursive calls are not allowed.
Programs must be associated to tasks. The following figure shows a default task with two
programs:
4
Instantiation
IEC 61131−3 provides the possibility of instantiation. Instantiation means that a function block is
defined once and can be used several times.
This applies to all FBs: User defined FBs (developed in a FB POU), IEC defined FBs and firmware
FBs.
As function blocks always have an internal memory it is necessary to store their values for each
time the function block is used to a different memory area. This is done using instance names. The
instance name is declared in the variable declaration of the POU where the function block is going
to be used. Each instance has an associated identifier and contains the input and output
parameters.
The following example shows the FB instance declaration for the function block 'FB_exam'. This
declaration must be contained in the local variables worksheet of the calling POU.
VAR
drive1 : FB_exam;
drive2 : FB_exam;
END_VAR
The function block 'FB_exam', of which the code body has either been defined somewhere in the
project or is contained in a library, has got two instances. The instance name of the first instance is
'drive1', of the second 'drive2'. In the corresponding code body worksheet you can use the function
block 'FB_exam' twice, entering in both cases the correct instance name.
A function block can be instantiated in other function blocks or in program POUs. Instance names
are created automatically whenever a function block is inserted using the Edit Wizard.
Programs can only be instantiated within resources. Program instances are created by associating
a program to a task and entering an instance name in the corresponding dialog. See topic Instance
Tree.
Functions are called without instantiation because they do not have an internal memory.
5
Programming languages in IEC 61131−3
IEC 61131−3 defines the syntax of 5 programming languages and describes their representation
and language elements. We distinguish two textual and three graphical languages.
In IL code bodies jumps and labels can be used. When processing the code, the program jumps
from the line containing the jump to the line with the label. Comments can be inserted to improve
the comprehensibility of the code.
An expression is a construct which returns one value for the execution of statements. Expressions
consist of operators and operands. The operators have to be applied to the operands in the way
that the operator with the highest precedence is followed by the operators with the next lower
precedence. Operands in ST can be literals, variables or names of functions. Operands are used
together with operators in expressions.
When developing large networks, connectors can be used to improve the layout of the element's
structure in the worksheet. Connectors simply replace connection lines. Additionally jumps can be
used: For realizing jumps two objects have to be inserted in the same worksheet: a jump and label
(which is the target for the jump). Returns can be inserted to go back to a calling POU. Comments
can be inserted to improve the comprehensibility of the code.
6
Sequential Function Chart (SFC)
from the left to the right. Coils store the incoming value. Both, contacts and coils, are assigned to
Boolean variables.
Contacts and coils are connected via lines and they are bounded on the left and on the right with
power rails. The state of the left power rail is considered ON all the time. The right rail is optional. In
addition to serial connections, parallel branches can be created. Parallel branches are also called
wired−Ors.
The set of connected objects is called LD network. Comments can be inserted to improve the
comprehensibility of the code.
An action block consists of an action and the corresponding action qualifier. Action qualifiers
specify how an action is affected by the step it is associated to. While a step is active, the
associated action is executed according to its action qualifier. The action can either be a Boolean
variable or an IL/ST/LD/FBD code body (called 'detail').
A transition represents the condition on that the process continues with the next step. If a transition
becomes TRUE the preceding step is executed once again and the succeeding step becomes
active. A transition can either be a Boolean variable or a directly connected Boolean expression in
FBD or LD. It is also possible to edit the code to be executed in an additional code body named
detail.
The set of connected objects is called SFC network. A SFC network must have one initial step
which is the first step to be executed when the SFC POU is called. Simultaneous branches
(executed simultaneously) or alternative branches (executed alternatively) can be inserted in the
SFC network.
7
Data types in IEC 61131−3
Data types determine the format, bitsize, possible value range and initial value of variables.
8
Generic data types
up to
+1.7976931348623158
E+308
The use of elementary data types depends on your hardware. Please refer to your hardware
documentation for the supported data types.
The data type STRING is also an elementary data type but it does not belong to the above
mentioned group. Its format in the memory depends on your PLC type.
With your runtime system the data type STRING has the following structure:
Byte 0−1 offset to maximum length (0 corresponds to 80)
Byte 2−3 current length
Byte 4−83 characters
Byte 84 zero terminator
ANY
ANY_NUM
ANY_REAL
REAL, LREAL
ANY_INT
DINT, INT, SINT
UDINT, UINT, USINT
ANY_BIT
DWORD, WORD, BYTE, BOOL
STRING
TIME
9
User defined data types
The use of data types depends on your hardware. Please refer to your hardware documentation for
restrictions concerning generic data types.
Array data types include several elements of one data type. An array can be used to declare
several elements of the same type with only one line in the type declaration.
User defined strings are STRING data types with a variable number of characters. When declaring
a user defined string, the length is set in brackets behind the data type as it is shown in the
example.
The use and (memory) format of user defined data types depend on your PLC type. Please refer to
your hardware documentation concerning the use of these data types.
Declaring arrays
Array data types include several elements of the same data type. An array can be used to declare
several elements of the same type with only one line in the type declaration. Example for the
declaration of an array data type:
TYPE
END_TYPE
In the example the data type 'graph' contains 23 elements of the data type 'INT'. All elements of an
array are stored continuously one after another in the PLC memory. Each particular element within
the array can be accessed via its array index.
In order to use an array you first have to declare the array in the type declaration of the data type
worksheet as shown above. Subsequently you can declare a variable of this data type in the
variable worksheet of the POU where the the array is going to be used (please refer to the 'Variable
declaration' example below).
Multi−dimensional arrays
10
User defined data types
TYPE
graph : ARRAY [1..10] OF INT;
my array : ARRAY [1..3] OF graph;
END_TYPE
Variable declaration:
VAR
var1 : my_array;
var2 : INT;
END_VAR
In the code body a single element in an array of an array is accessed using two indexes:
var2 := var1[1][3];
Initializing arrays
Arrays can be initialized by assigning a value to each array element. As already mentioned above,
each single element is accessed using its index. The initialization of an array can be done while
editing the code body.
Variable declaration:
VAR
graph : ARRAY [1..10] OF INT;
END_VAR
graph[1]:=7;
graph[2]:=1092;
.
.
.
graph[10]:=13;
It is not necessary to initialize all elements of an array. If no initial value is used, the array element
is initialized with the default initial value of the element's data type when starting the program
execution.
11
Programming example for an array
Arrays can be used for describing related data belonging to the same automation object. Let us
imagine that a process changes an input value every 3 seconds and that it would be necessary to
store each of these input values to compare them with set points. This means, all input values are
of the same data type. In this case it is useful to declare an array because its values can be easily
compared using an iteration statement (e.g. a FOR loop). The single components of the array can
be accessed using the array index.
Type declaration
TYPE
graph : ARRAY[1..23] OF INT;
set_point : ARRAY[1..23] OF INT;
END_TYPE
Variable declaration
VAR
input : graph; (* incoming values of the machine *)
values : set_point; (* values to compare with *)
i : INT :=1; (* variable for array index *)
run : BOOL :=TRUE;
ERROR : BOOL;
timer : FB_TIMER; (* declare FB instance *)
END_VAR
Code body in ST
timer (pt:=t#3s;in:=run);
IF timer.Q THEN (* provide input values to array 'graph' *)
input[i] := %IW0; (* assign input value to array *)
run := 0; (* edge detection to start timer again *)
i := i+1; (* higher array index *)
ELSE
run :=1; (* count up *)
END_IF;
IF i = 23
FOR i:=1 TO 23 BY 1 DO
IF input[i] <> values[i] THEN (* comparing array 'graph' to 'set point' *)
ERROR := TRUE;
END_IF;
END_FOR;
i := 1;
END_IF;
12
Structured data type
Declaring structures
Structured data types include several elements of the same or of different data types.
TYPE
machine :
STRUCT
x_pos : INT;
y_pos : INT;
depth : INT;
rpm : UINT;
END_STRUCT;
END_TYPE
In the example the structured data type 'machine' consists of the components x_pos, y_pos, depth
and rpm. All components describe the characteristics of the machine.
Programming example
Structures should be used if data describing the same object have to be declared. For example a
drilling machine drills several holes in one workpiece. For each hole to be drilled the following
information are required: Position (x/y coordinates), depth and drill revolutions per minutes. The
actual values vary for each drill−hole but the used variables are always the same. So we would
declare a structure consisting of four components for the position (x and y), depth and revolutions
per minute. For each hole different values can be assigned to the components. The function block
for the drilling process is just working on the same variable being a structure.
Arrays of structures
TYPE
machine:
STRUCT
x_pos : REAL;
y_pos : REAL;
depth : INT;
rpm : INT;
END_STRUCT;
my array : ARRAY[1..10] OF machine;
END_TYPE
13
String data type
An application example for arrays of structures could be a transfer line with several drilling
machines. Via the array index the concrete drilling machine can be accessed and via the structure
components the different values for drilling can be assigned.
TYPE
graph : ARRAY[1..10] of INT;
drive :
STRUCT
rpm : INT;
inputs : IN_BOOL;
performance : graph;
END_STRUCT;
END_TYPE
Initializing structures
Structures can be initialized by assigning the values to the components while editing the code body
declaration. An example is shown in the following figure:
Variables declaration:
VAR
var1 : machine;
first : BOOL :=TRUE;
END_VAR
IF first THEN
var1.x_pos := REAL#1.3E+2
var1.rpm := 3000;
...
first := FALSE;
END_IF
...
User defined string data types are strings with a variable number of characters. Declaring a user
defined string the length is set in parentheses behind the data type.
TYPE
STRING10 : STRING(10)
14
String data type
END_TYPE
15
Variables in IEC 61131−3
This topic contains general information about variables as it is described in the IEC standard.
According to IEC 61131−3 variables are used for programming instead of direct addressing inputs,
outputs or flags. In IEC 61131−3 different types of variables are described: Symbolic variables,
directly represented and located variables.
Scope of variables
The scope of a variable determines in which POUs it can be used. Possible scopes are local and
global. The scope of each variable is defined by the location where it is declared (local or global
variables worksheet) and the variable keyword used for the declaration.
Local variables: If a variable can be only used within one POU it is called a local variable. In those
cases it is declared in the variables worksheet of the corresponding POU using one of the variable
declaration keywords VAR, VAR_INPUT or VAR_OUTPUT. Function block instances are treated
similar to local variables, i.e. instance names have to declared using in the local variables
worksheet using the keyword VAR.
Global variables: If a variable can be used within the whole project it is called a global variable. It
has to be declared using the keyword VAR_GLOBAL in the global declaration and as
VAR_EXTERNAL in each POU where it is used.
Symbolic variables
Symbolic variables are declared with a symbolic name and a data type. An initial value is optional.
The programming system stores a symbolic variable to a free memory area in the PLC memory
which is not known to the user. Symbolic variables can be declared as retentive variables using the
keyword 'RETAIN'.
The following example shows a variable declaration of two local symbolic variables:
VAR
var1 : BOOL;
var2 : INT;
END_VAR
The second example shows the declaration of a global variable in the global variables worksheet:
VAR_GLOBAL
SampleVar : BOOL;
END_VAR
In order to use this variable in a POU, it must additionally be declared in the local variables
16
Directly represented and located variables
VAR_EXTERNAL
SampleVar : BOOL;
END_VAR
When declaring input and output parameters for a function block POU, the variable declaration
keywords VAR_INPUT and VAR_OUTPUT must be used.
A location declaration consists of the keyword AT, the percent sign "%", a location prefix, a size
prefix and the name of the logical address.
Directly represented and located variables can be declared in the global variable worksheet using
VAR_GLOBAL or in programs.
The following tables shows the location and size prefix for directly represented and located
variables:
Location Description
prefix
I Physical input
Q Physical output
Size Description
prefix
17
Retentive variables
Variables of the data type LREAL can currently not be declared as direct represented variables.
Like symbolic variables, located variables can also be declared as retentive variables and they can
be initialized.
It is recommended to declare I/Os as global variables. In the global variable declaration they should
be declared as located variables and in the VAR_EXTERNAL declaration of the POU they should
be declared as symbolic variables. The typing effort in case of address changes is reduced in this
way.
In the following example such a declaration of located global variables in the global variables
declaration is shown:
VAR_GLOBAL
END_VAR
In order to use these global located variables in a POU, they must additionally be declared in the
local variables worksheet of this POU as follows:
VAR_EXTERNAL
var1 : BOOL;
var2 : BYTE;
var3 : DWORD;
END_VAR
VAR
AT %QB 7 : BYTE;
END_VAR
Retentive variables
The value of a so−called retentive variables remains stored, even if power is switched off. After a
warm start the last value of the variable will be used.
Retentive variables are declared using the additional keyword RETAIN as it is shown in the
following example:
18
Initializing variables
VAR RETAIN
END_VAR
In this example the variable has the initial value 'TRUE' which is used when the PLC performs a
cold start. In case of a warm start the current value of the variable is used.
The keyword RETAIN can be used in combination with the keywords VAR, VAR_OUTPUT and
VAR_GLOBAL. It is not possible to declare retentive variables with the keywords VAR_INPUT and
VAR_EXTERNAL.
Please observe the information concerning the way, the programming system handles changed or
new inserted retain variables when downloading or patching projects and performing a PLC warm
start.
Initializing variables
According to IEC 61131−3 an initial value can be assigned to a variable. This means that a variable
which is going to be used for the first time in the PLC program is used with this initial value. The
initial value is optional. If no initial value is used, the variable is initialized with the default initial
value of the data type or with the retained value in case of retentive variables. Initial values can be
defined in conjunction with all declaration keywords except VAR_EXTERNAL.
Initial values have to be inserted at the end of the declaration line of the variable using ':=' as it is
shown in the following example:
VAR
END_VAR
The initial value has to fit to the data type. It is not possible to use e.g. the data type BOOL and an
initial value '5'. In this case the system displays an error message.
19
Initializing variables
VAR for declaring local variables (symbolic, directly represented and located)
and for declaring function block instances. The keyword can be used
with the keyword 'RETAIN' for declaring retentive variables.
VAR_INPUT for declaring symbolic variables which are inputs of functions, function
blocks and programs. Using the a VAR_INPUT variable a value can be
handed over to the POU which is read−only when the POU is executed.
VAR_OUTPUT for variables which are outputs to function blocks and programs. Using
the a VAR_OUTPUT variable an output value can be handed over e.g.
to other POUs. The variable can be read and written when the POU is
executed. The keyword can be used with the keyword 'RETAIN' for
declaring retentive variables.
VAR_IN_OUT typically for complex data types such as strings, arrays and structures.
The address of an input/output variable is passed by reference. The
variable can be read or written.
VAR_EXTERNAL for the local declaration of a global variable (only symbolic variables) in
the POU where it is used (see description of keyword VAR_GLOBAL).
The value of an VAR_EXTERNAL variable is supplied by the related
VAR_GLOBAL declaration. Its value can be modified by the POU.
For declaring program instances or function block instances, you have to use additional variable
declaration keywords:
VAR_GLOBAL_PG, VAR_GLOBAL_FB, VAR_EXTERNAL_PG and VAR_EXTERNAL_FB.
These keywords are IEC extensions.
20
Literals in IEC 61131−3
Literals can be used to enter external representation of data. Literals are necessary for the
representation of numeric, character strings and time data. Every time you have to enter values,
you have to use literals.
Numeric literals
The numeric literals which can be used are shown in the following table:
Type Examples
Literals used in variable worksheets as well as INT and BOOL literals can be used without
keyword. Examples:
For INT#16#ff you can use 16#ff.
For BOOL#FALSE you can use FALSE.
In variable declarations you can use "var1 : DINT :=10", but in the code body you have to use "LD
DINT#10". The same applies to LREAL: When entering an LREAL literal using the variable dialog,
for example "0.0" is sufficient. However, in the code body an LREAL constant has to be entered as
"LREAL#0.0".
21
Character string literals
Type Examples
Duration literals
Duration data can be represented in hours, minutes, seconds, milliseconds and in combination of
these formats.
Type Examples
Type Examples
Date DATE#1996−01−24
date#1996−01−24
D#1996−01−24
d#1996−01−24
Time of TIME_OF_DAY#15:36:55.36
day time_of_day#15:36:55.36
TOD#15:36:55.36
tod#15:36:55.36
22
IEC 61131−3 and your programming system
Your programming system is a standard programming system for IEC designed PLCs and
traditional PLCs. It is based on the standard IEC 61131−3 and includes the full range of IEC
features.
Each project consists of libraries, data types, POUs and the set of configuration elements
(configurations, resources, tasks and programs) which are contained in the subtree 'Physical
Hardware'.
Firmware libraries are libraries containing POUs prepared by the PLC manufacturer. The file
extension for firmware libraries is *.fwl.
User libraries are projects which were created before and from which you want to reuse POUs or
data types. The file extension for user libraries is *.mwt. If a project is created with an earlier
system version younger than 1.3.6.14, the project file name has the extension *.pwt. Projects which
are created with a version before 1.3.6.14 cannot be announced as libraries.
Libraries have an own subtree in the project tree. You can either display the complete project tree
or only the subtree 'Libraries' by clicking on the tab 'Libraries' at the bottom of the project tree.
23
POUs in your programming system
• A description worksheet which contains text entered by the PLC application programmer
serving for documentation purposes. These worksheets are optional.
Note: It is possible to use the description worksheet as context sensitive help if you are
calling help on a user defined function or FB (e.g. when working with the Edit Wizard). For
detailed information please refer to the topic Calling help on FU/FB in the topic list below.
• One variables grid worksheet containing the declaration of the local variables and function
block instances.
• One or several code body worksheet(s) containing the actual code, edited one of the
available programming languages.
24
Data types in your programming system
In case of a POU in the programming language SFC some more worksheets can be edited: action
and transition worksheets.
If a code worksheet is opened, you can easily open the related variables grid worksheet by either
selecting the menu item 'Open Variables Worksheet' in the submenu 'View' or by clicking on the
icon 'Variables Worksheet' in the toolbar:
25
Variables in your programming system
or
Depending on the used hardware it is possible that manufacturer defined data types are provided.
Please refer to your hardware documentation.
These worksheets are realized as variables grids. Declarations are not entered as plain text (as
described in the IEC) but in the form of a table which makes declarations considerably easier to
handle. Each table row contains one variable or instance declaration, each table column contains
one variable property (declaration item). This way the table reflects the declaration syntax
according to IEC 61131. The variable declaration keywords described by the standard are
contained in the column 'Usage', variables do not have to be combined within declaration blocks
which avoids syntax errors.
VAR RETAIN
26
Configuration elements in your programming system
END_VAR
You can
• either declare variables while editing code using a variables dialog. Using this method, the
new variable is inserted in the code body worksheet and the declaration is autoinserted
into the variables grid at the same time. Therefore it is not necessary to open the variables
grid worksheet.
• or declare variables directly in the variables grid worksheet (see figure above) by inserting
a new entry in the variables grid and specifying the variable properties. Having declared a
variable in the grid, it can be inserted in the code body worksheet using the variables
dialog.
The programming system allows to use DIN qualifiers in IEC variable names. For that purpose, the
checkbox 'Use DIN identifier' must be checked in the 'Options' dialog, tab 'Build' (called via the
menu item 'Extras > Options'). However, some rules have to be observed when using DIN
identifiers. Please read the related topic.
27
Identifier
A project may contain one or several configurations. In each configuration one or several resources
can be declared. Within each resource several tasks with their associated programs can run.
For a description of specific configuration elements available for your PLC type please refer to the
topics in the PLC Help referenced below or to your hardware documentation.
Identifier
Identifiers can consist of letters, digits and underscores. The identifier has to begin with a letter or
an underscore. Upper and lower case can be mixed.
For identifiers different lengths are allowed, as shown in the following table:
28
Program and function block instances in the instance tree
The programming system allows to use DIN qualifiers in IEC variable names. For that purpose, the
checkbox 'Use DIN identifier' must be checked in the 'Options' dialog, tab 'Build' (called via the
menu item 'Extras > Options'). However, some rules have to be observed when using DIN
identifiers. Please read the related topic.
Program and function block instances are useful if you have e.g. two identical machines controlled
by the same PLC but connected to different I/Os. You can edit the PLC program in the subtree
'Logical POUs' as normal and instantiate twice the program and/or function blocks. Each instance
works with the data of its own global variable declaration.
The instance tree shows all instances used in your project as it is shown in the following example.
The instance tree is made visible by clicking with the left mouse button on the tab 'Instances' at the
bottom of the project tree.
In this example one program instance of the program 'FBD' is used in the task 'T_100ms'. The
function block 'TLC' has been instantiated in the program 'FBD'.
• It is not possible to instantiate a function block within a function block. Function blocks can
only be instantiated in programs.
29
Variable declaration keywords for program and FB instances
• The instance name which is used in the instance tree/subtree 'Physical Hardware' has to
correspond to the instance name used in the subtree 'Logical POUs'.
VAR_EXTERNAL_PG for the local declaration of a global variable (only symbolic variables) in
the program POU where it is used (see description of keyword
VAR_GLOBAL_PG). The value of an VAR_EXTERNAL_PG variable is
supplied by the related VAR_GLOBAL_PG declaration. A variable of
this type cannot be initialized. Its value can be modified when executing
the program POU.
VAR_EXTERNAL_FB for the local declaration of a global variable (only symbolic variables) in
the function block POU where it is used (see description of keyword
VAR_GLOBAL_FB). The value of an VAR_EXTERNAL_FB is supplied
by the related VAR_GLOBAL_FB declaration. A variable of this type
cannot be initialized. Its value can be modified when executing the
function block POU.
30