RedundancyManager (FB)¶
FUNCTION_BLOCK RedundancyManager
Check the status of redundant CODESYS PLCs with RROFINET Controllers.
Manage basic failure scenarios.
The function block has to be defined in an unsychronized data area.
The principle of PROFINET System Redundancy is a redundant pair of connections (called AR = Application Relation) between two separate controllers and a PROFINET Device.
One of the ARs is Primary, the other one is Backup.
Only the Primary AR has valid IO-Data.
In case of a failure, an immediate switch-over between the ARs takes place, so the IO-data will stay valid without bump.
The function block checks current status of the PLC redundancy and of the PROFINET Controllers.
It provides a basic failure handling:
- If the PLC Role is Active, then the PROFINET Controller will be Primary.
- If the PLC Role is Standby, then the PROFINET Controller will be Backup.
- If PLC Role is Standalone at startup time, then the PROFINET Controller on PLC 1 gets Primary.
- If PLC Role switches to Standalone (redundancy link is broken or other is PLC offline), then the PROFINET Controller will keep it’s current role.
- If a Primary Controllers ARs are aborted (complete shutdown or single AR abort), the Standby PLC will switch to Active and it’s PROFINET Controller will get Primary.
- If a PROFINET Controller is faulty, the PLC will be switched to Simulation.
- InOut:
Scope
Name
Type
Comment
Inout
controller
Output
xRedundancyActive
BOOL
CODESYS PLC Redundancy is activated.
PLC_ID
INT
PLC-ID = 1/2 if redundancy is activated.
RedundancyState
RDCY.RedundancyState
Current state of CODESYS PLC Redundancy.
xConnected
BOOL
Redundant PLCs can communicate via the configured redundancy link.
xSync
BOOL
Redundant PLCs are synchronized, for details see RedundancyState output.
xPrimary
BOOL
PROFINET Controller is Primary.
xBackup
BOOL
PROFINET Controller is Backup.