Setting up an FSoE application with TwinCAT

By default, the STO and the SS1 are enabled on the drive. Unless they are configured correctly and released simultaneously, the drive will not allow any movement.

This guide gives you an example on how to configure the TwinCAT main device in order to operate the STO and the SS1 correctly.

Page contents:

Background

This guide provides step-by-step instructions for creating a basic Safety Application with EVS-S-NET using TwinCAT. The goal of the application is to trigger any desired Safety Function (STO, SS1, SLS…) when its respective pushbutton is pressed.

The example is using the following parts:

Component

Version

Description/link

Software

TwinCAT 3.1 TcXaeShell

4026.19

Link - Installed using TwinCAT Package Manager

MotionLab3

1.10.0

Link

Hardware

Computer with TwinCAT

-

Acting as EtherCAT master

EVS-S-NET-E

Hardware: B
Firmware: 2.9.1

Link - Everest S Safe drive

1012 - Safety Box

-

Link - FSoE interface, consisting of:

  • EK1100 - EtherCAT coupler

  • EL1918 - EtherCAT Terminal, 8-channel digital input, FSoE compatible

    • Buttons/switches connected to each input

  • EL9011 - EtherCAT Terminal, end cover

  • 24 VDC power supply

Previous Steps

This guide assumes that the drive has already been configured using MotionLab3-CoE (including optimized control loops and Safety-Related Application parameters) and focuses exclusively on the TwinCAT configuration and the subsequent MotionLab3-EoE connection.

Setup

FSoEBasicConnectionSetup.drawio.png

Connect the safety master with the safety inputs to the TwinCAT master and put the EVS-S-NET-E in daisy chain. The necessary inputs should be connected to the EL1918 channels to control different safety functions.

Steps

  • Put the ESI file of the EVS-S-NET-E in the device descriptors folder of TwinCAT (usually in C:\TwinCAT\3.1\Config\Io\EtherCAT).

  • Set up a basic project:

    • Create a new TwinCAT XAE Project.

    • Scan the network and check that all the devices are being identified.

image-20260108-085027.png
Notes for using an EL1918 instead of EL6900 and EL1904...

There is a known issue of the EL1918 that gives an error when using it in Local mode. The workaround provided by Beckhoff is to choose the previous ESI file (16) instead of the last (17). This must be done when adding the device to the EtherCAT network:

  • Right click on the EK1100 and select Add New Item…

  • Check Extended Information and Show Hidden Devices.

  • Search EL1918.

  • Select the version that ends with 16 instead of 17 and click OK.

image-20260108-085644.png
  • Select the Drive 3 (EVS-S-NET-E) and do the following:

  • Go to the Slots tab, delete the Slot 1 (FSoE) and add the Slot FSoE with Safety Project CRC

Difference between the 3 FSoE submodules:

As described in ETG.5120, the FSoE Connection Parameter Set is stored in the FSoE Master during the “Parameter” state of the FSoE protocol. Each FSoE submodule specifies the data exchanged between the configuration tool and the FSoE Master:

  • All submodules share the following parameters: Communication Parameter Length, Watchdog Time, and Application Parameter Length. In addition:

    • FSoE: Shares all safety-related application parameters (e.g., FSoE PDO-mapped elements, safety function configurations).
      → Note: Devices with numerous safety-related application parameters may exceed the FSoE Master’s memory capacity.

    • FSoE with SRA CRC: A checksum of the binary content of the SRA Parameter is calculated and shared with the FSoE Master.
      → However, this feature is currently not supported by TwinCAT.

    • FSoE with Safety Project CRC: A Project CRC is shared with the FSoE Master, reducing the need to transmit large amounts of data required by the previous two alternatives.

More information in SRA CRC workaround for TwinCAT

  • If you want to connect to MotionLab3 later:

    • Go to the EtherCAT tab go to Advanced Settings… → Mailbox → EoE, select IP Port → IP Address and manually enter 192.168.2.22:

      image-20260108-090047.png
    • Go to the Process Data tab and, inside PDO Assignment (0x1C12), unselect the PDO 0x1600 - this will avoid interferences when interacting with MotionLab3 (sending commands and enabling the motor):

      image-20260108-090424.png
  • Create two variables for running the project and error acknowledgement

    • In the solution explorer, right-click in SYSTEM/Tasks and select Add New Item.

    • Insert a TwinCAT Task With Image.

    • Right-click in the Outputs section of the newly created task, and select Add New Item.

    • Select Insert a new variable RUN with data type BIT and start address 0 bit.

    • Insert another variable named ERR_ACK with type BIT and start address 1 bit.

image-20241004-092924.png
image-20260108-085214.png
  • Add the Safety Application project.

    • In the Solution Explorer, right-click the SAFETY block and select Add New Item.

    • Choose TwinCAT Safety Project Preconfigured Inputs in the newly opened window and press Add.

    • In the following window, select Hardware Safety PLC as Target System and press Ok.

image-20260108-095012.png
  • Configure the Safety Master.

    • Right-click on Safety Application Project and select Properties.

    • On the Safety Master window, go to Target System and click the icon next to the Physical Device field.

    • Choose EL1918 in the newly opened window and press OK. Data in Target System should now show the actual configuration of the device (software version, serial number…).

image-20260108-095920.png


  • Add the safety drive.

    • In the Solution Explorer, locate the Alias Devices subfolder inside Safety Master Project.

    • Right-click on the icon and select Add/New Item.

    • In the newly opened window, click on AliasDevice Templates/Safety/EtherCAT/Novanta Drives in the tree view menu, choose 0x03B00000 - Safety drive (FSoE) and press Add.

image-20260108-100300.png
  • Configure the safety drive.

    • Double-click on the newly created Safety Drive entry in the Solution Explorer.

    • In the Safety Drive window, click the icon next to the Physical Device field.

    • Choose Module 1 (FSoE) the newly opened window and press OK. The Inputs and outputs should appear now in the Linked to field.

    • Ensure FSoE Address matches the value read in the Dip Switch field. If not, press the green arrow next to FSoE Address to update it.

image-20260108-101200.png
  • Set the FSoE mapping in the drive.

    • In the same Safety Drive window, select the Process Image tab.

    • One of the key features of Phase 2 is the dynamic mapping. It allows to configure custom FSoE mappings instead of relying on fixed configurations. To edit the mapping, select the Edit buttons of the Inputs and Outputs sections.

    • In this example we will control STO, SS1 and the first instance of SLS. Make sure to create a valid mapping using the FSoE frame construction rules:

      image-20260108-112627.png
    • Select the Safety Parameters tab and insert the corresponding Project CRC for your application, as defined in ETG.5120:

      image-20260108-135528.png
  • Add the safety inputs.

    • Repeat the same process for the drive but with the template EL1918 found in AliasDevice Templates/Safety/EtherCAT/Beckhoff Automation GmbH & Co.

image-20260108-101503.png
  • Configure the safety inputs.

    • Double-click on the newly created Safety Inputs entry in the Solution Explorer.

    • Choose Linking mode: Local.

We need to set the linking mode to Local due to the Beckhoff hardware in use. The EL1918 module has built-in TwinSAFE logic capabilities, so selecting “Local” means the safety logic runs directly on the device itself.

In contrast, when using an EL1904, you should choose Automatic, as this module does not include integrated safety logic and requires a separate device (such as the EL6900) to act as the safety master.

image-20260108-101827.png
  • Create a safety application.

    • Double-click on TwinSafeGroup1.sal in the Solution Explorer.

    • In the newly opened window, drag a safeDecouple block from the Toolbox window.

    • Right-click in the DecInX terminals of the safeDecouple block and select Add New Variable. Add as many variables as needed (in this example, we want to control STO, SS1 and a single instance of SLS, so we will need 3 variables).

    • Repeat for DecOutX, using as many variables as needed.

image-20260108-110817.png
  • Link the safety application with actual inputs and outputs.

    • Go to the Variable mapping tab and choose as input for button_1, button_2 and button_3 the signals coming from channels 1 to 3 of the EL1918.

    • In the same area, choose as output for sto_var, ss1_var and sls_var the corresponding commands of the EVS-S-NET.

image-20260108-113225.png
  • Link the RUN and ERR_ACK variables.

    • Double click in Run.sds in the Solution Explorer.

    • In the Linked to field, select the previously created RUN variable.

    • Repeat for ErrorAcknowledgement.sds with the ERR_ACK variable.

image-20260108-113317.png
  • Validate the Safety Project.

    • Go to TwinSAFE/Verify Complete Safety Project and check that no errors are being reported and a Verification Process successful message appears on the bottom of the window.

  • Download the Safety Project to the Safety Master.

    • Go to TwinSAFE/Multi-Download Safety Project(s) and follow the steps of the guide.

    • The user is Administrator and the password TwinSAFE.

  • Run the Safety Project.

    • Click on Activate configuration and accept to Restart in Run Mode.

    • Select the view of the TwinSafeGroup1.sal and click TwinSAFE/Show Online Data.

    • The group should be in STOP/ERROR-STOP state and both slaves in Data state.

image-20260108-141512.png
  • Enable the safe logic.

    • Right-click on the RUN variable and select Online Write '1'.

    • The group should be in RUN state and the Variable Mapping tab should show real-time data.

image-20260108-141556.png
  • The STO, SS1 and SLS-1 should now respond to the pushbutton states.