Enter the ( Tc2_Sistema ). This powerful, often underutilized library provides a framework for designing robust, reusable, and highly structured control applications. It brings concepts from object-oriented programming (OOP) and state transition logic directly into the IEC 61131-3 environment of TwinCAT 3.
PROGRAM MAIN VAR RedCtrl : FB_RedundancyControl; SyncData : FB_SynchronizeData; Guard : FB_SwitchGuard; LocalData : ST_CriticalProcessData; (Your custom struct) RemoteData : ST_CriticalProcessData; END_VAR beckhoff sistema library
// Calculate Required PL based on risk assessment fbSistema_PLr( Severity := SEVERITY.SEVERE, // S2 Frequency := FREQ.LESS_THAN_1_HOUR, // F2 PossibilityOfAvoidance := AVOID.IMPOSSIBLE // P2 ); rRequiredPL := fbSistema_PLr.PLr; // Returns PLr = e Enter the ( Tc2_Sistema )
fbEStop( Enable := TRUE, Config := stConfig, Result := eStop_Result, bCalculate := TRUE // Rising edge triggers calculation ); PROGRAM MAIN VAR RedCtrl : FB_RedundancyControl; SyncData :
Beckhoff has done the heavy lifting of TCP/IP synchronization and election logic. Your job is simply to decide what data to synchronize and when to hand over the keys.
You can find the Beckhoff SISTEMA library files (typically with a .slb or .ssplib extension) through the following official channels: