6. REDUNDANCY WITH NX3030 CPU
6.3.3.10. Redundant and Non-redundant Symbolic Variables
Besides the direct representation variables (%I, %Q and %M) which are allocated automatically, the user can explicitly
declare symbolic variables, inside of POUs or GVLs. The maximum size allowed for redundant symbolic variables allocation
is 512 kbytes.
ATTENTION
Symbolic variables must not be confused with AT variables. The AT variables are mere
symbolic names attributed to direct representation variables (%I, %Q and %M), using the
“AT” declaration. Thus, AT variables don’t allocate any symbolic variables memory.
Symbolic variables are redundant in the following cases:
When declared in POUs from the “program” type created in the user application, exceptionally the NonSkippedPrg
program
When declared in GVLs created in the user application and these GVLs marked as redundant
Symbolic variables aren’t redundant in the following cases:
When declared in the NonSkippedPrg program. This program has been described previously in the NonSkippedPrg
Program section
When declared in POUs from the “function” type. It can be observed this POUs normally must allocate variables only
on the stack (non static), which consequently don’t need to be redundant. If the user declares static variables (VAR
STATIC) inside the POUs from the “function” type, this will be considered bad programming. Such static variables, in
case they are created, will be considered non-redundant
When declared in POUs from the “function block” type. It can be observed the mere “function block” declaration
doesn’t allocate memory (what allocates memory is to turn a function block into as instance)
It must be observed that the function blocks instances, declared inside POUs from the program type or inside GVLs,
behave as symbolic variables, in other words, allocate redundant memory. In the same way symbolic variables, when function
block instances, are declared in the NonSkippedPrg program or when the GVL isn’t marked as redundant, such instances are
non-redundant.
6.3.4. Multiple Mapping
If the user desires to map the redundant command variables in more than one communication port (COMx or NETx) it’s
necessary the implementation of a control by the user within his own application.
The control logic to be implemented must write in the redundant command variables based on the variables (commands)
values from each communication port (COMx or NETx). Besides that, the control logic must restart the communication ports
command variables, as the redundancy control just restarts its own command variables.
The following is an example of this implementation:
VAR
var_StandBy_command_Ethernet_relation : BOOL;
var_StandBy_command_Serial_relation : BOOL;
var_Inactive_command_Ethernet_relation : BOOL;
var_Inactive_command_Serial_relation : BOOL;
var_TurnOn_command_Ethernet_relation : BOOL;
var_Turn_command_Serial_relation : BOOL;
END_VAR
//Logic to put the local PLC in StandBy
IF var_StandBy_command_Ethernet_relation = TRUE THEN
DG_NX4010.tRedundancy.RedCmdLoc.bStandbyLocal:=TRUE;
var_StandBy_command_Ethernet_relation:=FALSE;
END_IF
IF var_StandBy_command_Serial_relation = TRUE THEN
DG_NX4010.tRedundancy.RedCmdLoc.bStandbyLocal:=TRUE;
var_StandBy_command_Serial_relation:=FALSE;
END_IF
283