5. Initial Programming
254
Reset Process Command (IEC 60870-5-104)
This process reset command can be solicited by IEC 60870-5-104 clients. After answer the client, the
CPU start a rebooting process, as if being done an energizing cycle.
In case of redundant PLCs , the process reset command is synchronized with the non active PLC,
resulting the reboot of both PLCs.
The standard IEC 60870-5-104 foresee a qualification value pass (0..255) with the process reset
command, but this “parameter” is not considered by the CPU.
Programs (POUs) and General Variable Lists (GVLs)
MainPrg Program
The MainTask task is associated to one unique POU of program type, named MainPrg. The MainPrg
program is created automatically and cannot be edited by user.
The MainPrg proram code is the following, in ST language:
(*Main POU associated with MainTask that calls StartPrg, UserPrg/ActivePrg and NonSkippedPrg.
This POU is blocked to edit.*)
PROGRAM MainPrg
VAR
isFirstCycle : BOOL := TRUE;
END_VAR
IF isFirstCycle THEN
StartPrg();
isFirstCycle := FALSE;
ELSE
UserPrg();
END_IF;
MainPrg call other two POUs of program type, named StartPrg and UserPrg. While the UserPrg is
always called, the StartPrg is only called once in the PLC application start.
To the opposite of MainPrg program , that must not be modified, the user can change the StartPrg
and UserPrg programs. Initially, when the project is created from the wizard, these two programs are
created “empity”, but the user might insert code in them.
StartPrg Program
In this POU the user might create logics, loops, start variables, etc. that will be executed only one
time in the first CLP’s cycle, before execute UserPrg POU by the first time. And not being called
again during the project execution.
In case the user load a new application, or if the CLP gets powered off, as well as in Reset Origin,
Reset Cold and Reset Warm conditions, this POU is going to be executed again.
UserPrg Program
In this POU the user must create the main application, responsible by its own process control. This
POU is called by the main POU (MainPrg).
The user can also create additional POUs (programs, functions or function blocks), and called them
or instance them inside UserPrg POU, to ends of its program estruction. Also it is possible to call
functions and instace function blocks defineds in libraries.
GVL Disables
In “Disables” GVL, are declared the MODBUS Master/Client by symbolic mapping requisition
disabling variables. It is not mandatory, but it is recommended to use the automatic generation of
these variables, which is done clicking in the button “Generate Disabling Variables” in device
requisition tab. These variables are declared as type BOOL and follow the following structure: