HaModControl (FB)
FUNCTION_BLOCK HaModControl EXTENDS AbbLConCA
HaModControl function block handles the AC500 high availability operation such as change over from primary to secondary CPU in case of an error with related diagnostics. Further it is used for data transfer between high availability CPUs. This is a mandatory function block for HA application. RuntimeError may occur during operation, but they will not generate Error output = TRUE. This allows the system to run and revert to an error free state.
Note
It is recommended to use only onboard Ethernet ports for Sync and Lifecom2 exchange between CPUs.
Note
When Dual sync is enabled, it is necessary to configure inputs IpAdrCpuASync, IpAdrCpuBSync, IpAdrCpuALifecom2, IpAdrCpuBLifecom2 with respective Ethernet port IP address, also applicable when CAN is used for Lifecom2
Note
If CAN is used for Lifecom2, maximum CAN cable length between CPUs must be less than 40 meters (Baud rate: 1 Mbit/s).
- InOut:
Scope
Name
Type
Initial
Comment
Inherited from
Input
EnableBOOLFALSE
A rising edge (Enable = TRUE) starts the operation, the output Busy goes to TRUE. All other inputs are read and considered continuously. A falling edge (Enable = FALSE) aborts the operation. During Aborting the Busy is still TRUE. Afterward all outputs are reset.
AbbLConCA
Output
BusyBOOLFALSE
Operation is running (while output Error is FALSE)
AbbLConCA
ErrorBOOLFALSE
Operation is stopped with error (while output Busy is FALSE). This output is TRUE for at least one cycle or until Enable is set to FALSE. The output ErrorID gives more details about the error.
AbbLConCA
Input
SyncSlotBYTE0
2: Not used anymore since AB2.6.0, can be left empty
SecSlotBYTE0
3: 3 for CAN as second lifecom, otherwise not used anymore since AB2.6.0, can be left empty
IpAdrCpuASyncSTRING(16)‘0.0.0.0’
4: IP Address(on which SYNC Communication is configured) of AC500 CPU connected to PLC A
IpAdrCpuBSyncSTRING(16)‘0.0.0.0’
5: IP Address(on which SYNC Communication is configured) of AC500 CPU connected to PLC B
IpAdrCpuALifecom2STRING(16)‘0.0.0.0’
6: IP Address(on which 2nd LifeCom Communication is configured) of AC500 CPU connected to PLC A
IpAdrCpuBLifecom2STRING(16)‘0.0.0.0’
7: IP Address(on which 2nd LifeCom Communication is configured) of AC500 CPU connected to PLC B
ManualChgOverBOOLFALSE
8: TRUE- Manual changeover from primary to secondary PLC
SupprChgOverBOOLFALSE
9: TRUE- Suppress changeover from primary to secondary PLC. If used this input should be activated in both the CPU at the same time else system may behave randomly.Suppress changeover feature is recommended to use only during network reconfiguration and not during any other switchover scenarios for example PLC STOPOutput
CfgErrorWORD0
3: Each bit of the word represents different configuration errors. CfgError is valid only when Error = TRUEBit0 - CI module configuration error,Bit1 - Sync Slot error, check the configured IP for sync slot,Bit2 - Sec Slot error, check the configured IP for lifecom2,Bit3 - IpAdrCpuASync invalid,Bit4 - IpAdrCpuBSync invalid,Bit5 - IpAdrCpuALifecom2 invalid,Bit6 - IpAdrCpuBLifecom2 invalid,Bit7 - Two or more IP addresses configured are identical.RuntimeErrorWORD0
4: Each bit of the word represents different Runtime errorsBit0 - CI module lost,Bit1 - Other CPU not active,Bit2 - Lifecom1 is lost(part of Sync),Bit3 - Lifecom2 is lost,Bit4 - Sync lost,Bit5 - Error in sync,Bit6 - Ethernet status,Bit7- Other PLC Lost communication to CI52x,Bit8- CAN_HEADER FB has error,Bit9- CAN_DATA FB has error,Bit10- fbGetOwnIP FB has errorBit11- Sync table has a difference, Remedy: Please check if the PLC A and PLC B has same project. Restart both the PLCsBit12- Sync along with Lifecom1 is stopped and Sync is activated with Lifecom2Bit13- Total number of sync data limit exceeded. Remedy: Reduce the data sync configured.Bit3 - Lifecom2 is lost RuntimeError will not be TRUE if the PLC is in STOP status. This is because Modbus is still responding even when PLC is in STOPCfgWORD0
5: Each bit of the word represents different ConfigurationBit0 - Sync via CAN enabled,Bit1 - Sync via UDP enabled,Bit2 - LifeCom2 via CAN is enabled,Bit3 - LifeCom2 via UDP is enabled,Bit4 - LifeCom2 via Modbus TCP is enabled,Bit5 - Initialization for Ethernet configuration,Bit6 - Sync via TCP enabled.
Methods:
B_CyclicAction
D_AbortAction
A_StartAction
C_CleaningAction
E_ResetAction
waitForSync
triggerAppl
waitInAppl
triggerSync
Structure:
HaModControl.A_StartAction(METH)HaModControl.B_CyclicAction(METH)HaModControl.C_CleaningAction(METH)HaModControl.D_AbortAction(METH)HaModControl.E_ResetAction(METH)HaModControl.S10_Initialisation(ACT)HaModControl.S21_VisuGeneral(ACT)HaModControl.S22_VisuForModbus(ACT)HaModControl.S23_VisuForLoggedAndRemoteCpuState(ACT)HaModControl.S24_VisuForConnectionStatus(ACT)HaModControl.S51_SwitchOverEventDriven(ACT)HaModControl.S52_SwitchOverManual(ACT)HaModControl.S73_StatusOutputs(ACT)HaModControl.triggerAppl(METH)HaModControl.triggerSync(METH)HaModControl.waitForSync(METH)HaModControl.waitInAppl(METH)