6. HX3040 Redundancy
267
Redundant and Non-Redundant Symbolic Variables
Besides the direct representation variables (%I, %Q) which are automatically allocated, the user can
explicitly declare symbolic variables, inside of POUs or GVLs. The maximum size allowed for
redundant symbolic variables allocation is 512kbytes.
ATTENTION:
Symbolic variables must not be mistaken with symbolic variables addressed through the AT
directive. These are mere symbolic names assigned to direct representation variables (%I, %Q and
%M), using the “AT” declaration. Thus, AT variables do not allocate any symbolic variables
memory.
Symbolic variables are redundant in the following cases:
When declared in POUs of “program” type created in the user application, exceptionally for the
NonSkippedPrg and NonSkippedProtPrg programs.
When declared in redundant GVLs created in the user application.
Symbolic variables are not redundant in the following cases:
When declared in the NonSkippedPrg and NonSkippedProtPrg programs, which have been
already described.
When declared in POUs of “function” type. Note that these kind of POUs would normally
allocate variables on the pile (non-static), which consequently would not need to be redundant.
Even aware that the user may declare static variables (VAR STATIC) inside the POUs of
“function” type, this is not a proper programming practice. Such static variables, in case they are
created, will be considered non-redundant.
When declared in POUs of “function block” type. In order to allocate memory the mere
declaration of a “function block” is not enough, but its “instantiation”.
Note that function blocks instances when declared inside POUs of program type or inside GVLs,
behave as symbolic variables; in other words, they allocate redundant memory. As the symbolic
variables, when function block instances are declared in the programs NonSkippedPrg and
NonSkippedProtPrg, or when the GVL is not marked as redundant, such instances are non-redundant.
Multiple Mapping
If the user wishes to map the variables of redundancy command in more than one communication
port (COMx or NETx) it is necessary to implement a control process within the application.
The control logic to be implemented must write in the variables of redundancy command based on
the value (commands) coming from each communication port (COMx or NETx). Besides that, the
control logic must restart the variables of the communication ports, 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;
END_VAR
: BOOL;
// Logic to put the local CPU in StandBy
IF var_StandBy_command_Ethernet_relation = TRUE THEN
DG_HX3040_01.RedCmdLoc.bStandbyLocal:=TRUE;
var_StandBy_command_Ethernet_relation:=FALSE;
END_IF
IF var_StandBy_command_Serial_relation = TRUE THEN
DG_HX3040_01.RedCmdLoc.bStandbyLocal:=TRUE;
var_StandBy_command_Serial_relation:=FALSE;