240 6 State-of-the-Art PLC Configuration
In this example, run-time programs
Motion
,
Control
and
Lube
are created by
associating programs
ProgA
,
ProgB
and
ProgC
respectively with a task definition.
Program
Motion
and FB instance
FB1
(independent of program
Control
) are
executed on
CPU_Conveyor
as quick tasks (
T_Quick
).
FB2
of program
Control
is
executed on the same CPU (
CPU_001
) as a cyclic task (
T_Cyclic
). Program
Control is used here to define the run-time properties of the FB tasks involved.
Function block instances associated with tasks in this way are executed
independently of the program.
With every cyclic invocation of run-time program Control, the input parameter
InOut
is set to the value of variable
Start
. After termination of
Control
, the value of
output parameter
R_Val
is assigned the variable
ErrorCode
.
On
CPU_Hammer
(the second CPU), program
Lube
is executed as an interrupt-
driven task (
T_Interrupt
).
FB3
, being part of
ProgC
, automatically inherits the same
run-time behaviour.
In this example,
CPU_001
and
CPU_002
are not variables, but manufacturer-
defined names for the CPUs of
PLC_Cell1
.
6.5 Communication between Configurations and POUs
This section describes the means of exchanging data between different confi-
gurations and within one configuration, using shared data areas.
Such (structured) data areas are used for communication between different pro-
gram parts, for exchange of data, for synchronisation and to support diagnostics.
It is the aim of IEC 61131-3 to provide a standardised communication model and
thus enable the creation of well structured PLC programs, which facilitate commis-
sioning and diagnostics and provide better documentation.
Modularization of applications eases re-use, which helps to reduce the time
taken to develop new applications.
IEC 61131-3 defines several ways of exchanging data between different parts of a
program:
- Directly represented variables,
- Input and output variables, and the return value, in POU calls,
- Global variables (VAR_GLOBAL, VAR_EXTERNAL),
- Access paths (VAR_ACCESS),
- Communication blocks (IEC 61131-5),
- Call parameters.