Skip to content

Function Blocks

SPT Diagnostic

FB_Component_Safety_Base

(extends FB_ComponentBase, implements I_SafetyBase, I_SafetySimulation)

This FB provides the Basis for each Safety Diagnostic function block thereafter. Each Safety Diagnosis FB is a Component within the Framework and can be registered in EMs or Machine Modules.

By assigning SafetyReset the auxiliary function is triggered by executing the Method .Reset().

Quickstart
  1. Create instances for Safety Diagnostic FB on appropriate level, EM or Machine.

    1
    2
    3
    4
    SafetyGroupAutoReset    : FB_SafetyResetPulse;
    SafetyReset             : FB_SafetyResetPulse;
    SafetyGroup_Main        : FB_Component_Safety_Group       := (Name := 'Safety Group Main', SafetyReset := SafetyGroupAutoReset, AutoResetConnectionFaults := TRUE);
    SafetyEstop             : FB_Component_Safety_EstopFB     := (Name := 'E-Stop', DependenceFB := SafetyGroup_Main, SafetyReset := SafetyReset);
    

  2. Link Run/ErrorAcknowledgement for Safety Groups.

  3. Link State/Diag.

    The process image to link to will be shown under the selected Safety PLC Device (EL6910, EL2911,...) in the EtherCat Master.

FB_Component_Safety_Group

(extends FB_Component_Safety_Base)

Evaluate Safety Group status and provide Run bit required for each Safety Group.

This FB requires a SafetyReset assignment during initialization.

When property AutoResetConnectionFaults is set, the FB will trigger reset function continuously in case of error state.

FB_Component_Safety_AndOrFB

(extends FB_Component_Safety_Base)

FB_Component_Safety_ConnectionFB

(extends FB_Component_Safety_Base)

FB_Component_Safety_EdmFB

(extends FB_Component_Safety_Base)

FB_Component_Safety_EstopFB

(extends FB_Component_Safety_Base)

Property ActiveName can be used to change Alarm message from default pressed!.

FB_Component_Safety_MonFB

(extends FB_Component_Safety_Base)

Property ActiveName can be used to change Alarm message from default pressed!.

Property ActiveAlarm can be used to suppress the Alarm for Safety FB not OK.

FB_Component_Devices

(extends FB_ComponentBase, implements I_Diagnostic)

Reads all Devices available in runtime and assigns correct evaluating FB.

Each set amount of time the Diagnostic information is evaluated from e.g. EtherCat Masters.

This FB is required to be parameterized by the following Parameter Parameter_Diagnostic:

Parameter Function
UPDATE_TIME Start Diagnostic Run every xxx ms, T#0s = deactivated, update needs to manually occur via I_Diagnostic.Update()
DEVICES_MAX Max Devices in this System
ETHERCAT_MASTER_START_UP_TIME Time to Startup EtherCat Master Diagnostic at initial startup
ETHERCAT_MASTER_MAX Max EtherCat Masters
ETHERCAT_MASTER_SLAVE_MAX Max Slaves per EtherCat Master
ETHERCAT_MASTER_SYNC_UNIT_MAX Max Count of Sync Units per Master
ETHERCAT_MASTER_SYNC_UNIT_SLAVE_MAX Max Count of Slaves per Sync Unit

SPT EtherCat

FB_Component_EtherCatMaster

(extends FB_ComponentBase, implements I_EtherCatMaster)

Function Block to diagnose connected EtherCat Master. The FB will read the Master configuration, evaluate the states of each slave and the master itself. In case of an anomaly or fault it will be displayed as an Event.

Connection to the SPT Framework implementation is done via standard component handling ParentResponseDefinition and CurrentAlarmSeverity.

Quickstart
  1. Create instance of FB_Component_EtherCatMaster for each Master. E.g. EBus and X001.

     1
     2
     3
     4
     5
     6
     7
     8
     9
    10
    11
    12
    13
    14
    15
    16
    17
    18
        // EtherCat Diagnostics
        {attribute 'TcLinkTo' := '.EtherCatMaster.AmsNetID     := TIID^X001^InfoData^AmsNetId;
                                .EtherCatMaster.DevID        := TIID^X001^InfoData^DevId;
                                .EtherCatMaster.DevState     := TIID^X001^Inputs^DevState;
                                .EtherCatMaster.ChangeCount  := TIID^X001^InfoData^ChangeCount;
                                .EtherCatMaster.SlaveCount   := TIID^X001^Inputs^SlaveCount;
                                .EtherCatMaster.CfgSlaveCount:= TIID^X001^InfoData^CfgSlaveCount;
                                .FrmXWcState[0]              := TIID^X001^Inputs^Frm0WcState;
                                .FrmXWcState[1]              := TIID^X001^Inputs^Frm1WcState;
                                .FrmXWcState[2]              := TIID^X001^Inputs^Frm2WcState;
                                .FrmXWcState[3]              := TIID^X001^Inputs^Frm3WcState;
                                .FrmXWcState[4]              := TIID^X001^Inputs^Frm4WcState;
                                .FrmXWcState[5]              := TIID^X001^Inputs^Frm5WcState;
                                .FrmXWcState[6]              := TIID^X001^Inputs^Frm6WcState;
                                .FrmXWcState[7]              := TIID^X001^Inputs^Frm7WcState;
                                .FrmXWcState[8]              := TIID^X001^Inputs^Frm8WcState;
                                .FrmXWcState[9]              := TIID^X001^Inputs^Frm9WcState'}
        EtherCatMasterX001 : FB_Component_EtherCatMaster := (Name := 'X001');
    

  2. Link FB to the Master by replacing the automatic link attribute with the correct Master Name.

  3. Create an instance of FB_SyncUnitTask for each SyncUnit.

    If SyncUnit is servicing multiple Tasks, an instance is required for each sub section.

     1
     2
     3
     4
     5
     6
     7
     8
     9
    10
        {attribute 'TcLinkTo' := '.SyncUnitTaskInfo.WcState    := TIID^X000^SyncUnits^IO^PlcTask^WcState^WcState;
                                .SyncUnitTaskInfo.ObjectId   := TIID^X000^SyncUnits^IO^PlcTask^InfoData^ObjectId;
                                .SyncUnitTaskInfo.State      := TIID^X000^SyncUnits^IO^PlcTask^InfoData^State;
                                .SyncUnitTaskInfo.SlaveCount := TIID^X000^SyncUnits^IO^PlcTask^InfoData^SlaveCount'}
        SyncUnitStandardSlowTask : FB_SyncUnitTask(EtherCatMaster := EtherCatMasterX001);
        {attribute 'TcLinkTo' := '.SyncUnitTaskInfo.WcState    := TIID^X000^SyncUnits^HotConnect [Term 20 (EK1100)]^PlcTask^WcState^WcState;
                                .SyncUnitTaskInfo.ObjectId   := TIID^X000^SyncUnits^HotConnect [Term 20 (EK1100)]^PlcTask^InfoData^ObjectId;
                                .SyncUnitTaskInfo.State      := TIID^X000^SyncUnits^HotConnect [Term 20 (EK1100)]^PlcTask^InfoData^State;
                                .SyncUnitTaskInfo.SlaveCount := TIID^X000^SyncUnits^HotConnect [Term 20 (EK1100)]^PlcTask^InfoData^SlaveCount'}
        SyncUnitHotConnect : FB_SyncUnitTask(EtherCatMaster := EtherCatMasterX001) := (IsHotConnect := TRUE);
    

FB_SyncUnitTask

(extends FB_CyclicFB, implements I_SyncUnitTask)

This FB evaluates the SyncUnit assigned by the linked inputs. In case of the SyncUnit not providing valid input Data an event will be displayed with the affected Slaves.

The default event is displayed as Error. With parameter IsHotConnect the event will be a warning as disconnection is expected.

This FB can only be used along with FB_Component_EtherCatMaster which instance is passed into FB_SyncUnitTask via the constructor.