6. Redundancy with NX3030 CPU
314
POUs from the Program Type with Redundant Symbolic Variables
The user can declare redundant symbolic variables in POUs from the program type, with exception of
the NonSkippedPrg POU where the symbolic variables declared are considered redundant.
In order to define a new POU as redundant, it must be marked in the Redundancy Configuration
object after its creation, in the project devices tree. By default, all POUs created by the user are,
initially, redundant.
ATTENTION:
For good practice it’s recommended to avoid the AT directive use in POUs which have redundant
symbolic variables declaration to prevent variable mapping in non-redundant areas.
Breakpoints Utilization in Redundant Systems
For redundant systems it’s recommended to use breakpoints only in the Active half-cluster, with the
other half-cluster deactivated. If not, when the application execution reaches a breakpoint, the Stand-
by breakpoint will take over the Active state, switching off the Active PLC.
MODBUS Instances Managing in Redundant System
The MODBUS instances are independent from the redundancy, thus they must be managed in the
application, when it’s up to the user to choose which instances must be enabled/disabled when a PLC
goes to Non-Active state.
The example below, inserted in a NonSkippedPrg program, executes the verification of the PLC
current state and in case it’s in Non-Active state, disables the MODBUS RTU instances master and
slave and the MODBUS Ethernet Server instance:
VAR
eRedStateLocal : REDUNDANCY_STATE;
eRedStateLocal_old : REDUNDANCY_STATE;
END_VAR
// Local PLC current state reading
eRedStateLocal := DG_NX4010.tRedundancy.RedDgnLoc.sGeneral_Diag.eRedState;
// Has the local PLC state changed?
IF eRedStateLocal <> eRedStateLocal_old THEN
IF eRedStateLocal = REDUNDANCY_STATE.ACTIVE THEN
// The local PLC has entered the Active state
Diagnostics.DG_MODBUS_RTU_Slave.tCommand.bRestart := TRUE;
Diagnostics.DG_MODBUS_RTU_Master.tCommand.bRestart := TRUE;
Diagnostics.DG_MODBUS_Server.tCommand.bRestart := TRUE;
ELSE
// The local PLC has entered the Not Active state
Diagnostics.DG_MODBUS_RTU_Slave.tCommand.bStop := TRUE;
Diagnostics.DG_MODBUS_RTU_Master.tCommand.bStop := TRUE;
Diagnostics.DG_MODBUS_Server.tCommand.bStop := TRUE;
END_IF
// Saves the last state of the local PLC
eRedStateLocal_old:= eRedStateLocal;
END_IF
Limitations on a Redundant PLC Programming
On a redundant PLC there are some limitations regarding its half-cluster programming. These
limitations are treated in the subsections below.
Limitations in Redundant GVLs and POUs
In a redundant GVL or a POU from the program type the following limitations must be respected for
a correct functioning of the half-clusters:
ï‚· Do not use variables from the type VAR_TEMP
ï‚· Do not mix variable types (VAR, VAR_RETAIN, VAR_PERSISTENT, etc.). Only one type
must be used in each GVL or POU