Configure Hardware in your TwinSAFE Project

In this section you will configure hardware devices in TwinCAT and Verify your TwinSAFE project. If you don’t have a project yet make sure to check out Create TwinSAFE project.

Requirements:

  • TwinCAT 3 Engineering Edition on a computer (full install,including XAE shell option).
  • Ethernet port on the computer (either integrated or via external USB dongle)

Create EtherCAT topology in TwinCAT

There are two ways to create a topology in TwinCAT:

  • Scan for EtherCAT devices.
  • Create a topology yourself by selecting components from the EtherCAT Library.

Scan for EtherCAT devices.

  1. Remove the EtherCAT connector from the Motorcortex controller and put it in the network adapter of the computer that runs TwinCAT.
  1. In the top bar go to TwinCATRestart TwinCAT (Config Mode)

  1. Go to the Solution Explorer, IOdevices, right click and select Scan.

  1. Next TwinCAT will show an overview of all available devices. Select the ones with EtherCAT in the name and continue.

  1. Next TwinCAT Free Run has to be activated.

  1. After the scan is completed, you will have an overview like below. In Solution ExplorerDevices, you will get a folder with Device # (EtherCAT) with in there your EtherCAT topology.

Add components from ESI Files (Optional)

If the physical devices are not available, it is also possible to create the topology yourself.

  1. In the Solution Explorer, IOdevices, right click and select Add New Item. TwinCAT will show an overview of all devices it has in its library.

  1. Select the device you want to add. Repeat the steps above until you topology is complete.

Add physical inputs and outputs and select target system

Next step is too add the physical safe-inputs and safe-outputs that come from the EtherCAT devices. You can only do this after connecting and scanning the devices. Only the devices with Safe-Inputs/Outputs have to be added.

Select target system

select the Target System, which is another name for the Safety PLC, which is also the FSoE Master.

  1. In the Go to Solution Manager, SafetyGCC_Safety_VxxxGCC_Safety_Vxxx ProjectTarget System

  1. Select the Target System which is the type of safety module where the safety logic will run on.
  2. After that, select the Physical Device, press the `Physical Terminal for Mapping button where you select which Safety device in the EtherCAT topology will be used as Safety PLC.
  3. Last make sure the Map Serial Number & Map Project CRC and Take over Standard Alias Device names boxes are checked.

Alias devices

Adding alias devices to the Safety project.

  1. Go to Solution Manager, SafetyGCC_Safety_VxxxGCC_Safety_Vxxx ProjectAlias DevicesFSoE. Here are your alias devices stored.

  2. Right click and select import Alias-Device.(s)

  1. Select the safety devices you want to add to this project.

  1. In the Solution Explorer Double click the added alias device and check if the FSoE safety address is correct and linked to the Physical Device. To take over the dip-switch address, click on the refresh icon left of the field Dip Switch and press on the green left-pointing arrow next to FSoE address to copy it there.

  2. Check the Linking Mode:

  • In case that safety device is not the safety PLC (FSoE master) where the project is stored, select Automatic.

  • Some Beckhoff safety devices have integrated TwinSAFE logic (e.g. EL1918), which means that you do not need an additional safety PLC (e.g. EL6910), but you can let the logic also run locally on that device. In that case, select “local” for Linking Mode.

  1. Check the connection tab:
  • Some Beckhoff safety devices have integrated TwinSAFE logic (e.g. EL1918), which means that you do not need an additional safety PLC (e.g. EL6910), but you can let the logic also run locally on that device. This example has Inputs that have to mapped. make sure you check the info data you want to read out with Motorcortex on these devices.

Creating signals for communication with Motorcortex

It is possible to send data to and receive data from the Safety PLC. This can be done via so-called standard variables. These signals will also be available to Motorcortex.

  1. In the Solution Explorer, Solution Manager, SafetyGCC_Safety_VxxxGCC_Safety_Vxxx ProjectStandardData you will find the FromSafetyPLC (For Outputs) & ToSafetyPLC(For Inputs) folders.

  2. Right click the folder you want to add a in/output and to Choose the option Add multiple standard variables.

  1. It is important to keep track of the order of the variables, since otherwise they might be in the wrong order in Motorcortex. If you delete a variable, all will shift one up. It is not possible to add a new one and rename it.
Name Order in TwinCAT Order in Motorcortex
i00ErrorAcknowledgement.sds Input byte 0, bit 0 Output byte 0, bit 0
i01Run.sds Input byte 0, bit 1 Output byte 0, bit 1
i02NoEstop.sds Input byte 0, bit 2 Output byte 0, bit 2
i03WatchdogPulse.sds Input byte 0, bit 3 Output byte 0, bit 3
i04WatchdogPulse.sds Input byte 0, bit 4 Output byte 0, bit 4
Name Order in TwinCAT Order in Motorcortex
o00STONotActive.sds Output byte 0, bit 0 Input byte 0, bit 0
o01SWEStopOk.sds Output byte 0, bit 1 Input byte 0, bit 1
o01WatchdogOk.sds Output byte 0, bit 2 Input byte 0, bit 2
o02EStopButtonsOK.sds Output byte 0, bit 3 Input byte 0, bit 3
o02InRun.sds Output byte 0, bit 4 Input byte 0, bit 4
o02FBErr.sds Output byte 0, bit 5 Input byte 0, bit 5
o02ComErr.sds Output byte 0, bit 6 Input byte 0, bit 6
o02ItherErr.sds Output byte 0, bit 7 Input byte 0, bit 7
o02ComStartUp.sds Output byte 1, bit 1 Input byte 1, bit 1
o02FBDeactive.sds Output byte 1, bit 2 Input byte 1, bit 2
o02FBRun.sds Output byte 1, bit 3 Input byte 1, bit 3

Variable Mapping

The last step is to link the signals of your TwinSafeGroup(Safety program) to the hardware or standard variables.

  1. go to Solution Manager, SafetyGCC_Safety_VxxxGCC_Safety_Vxxx ProjectTwinSafeGroup group Next step is to define names to signals in the TwinSafeGroup1.sai Naming can be done by clicking on left of the input or right output and by starting to type.

  2. go in the top bar to viewOther WindowsVariable Mapping.

  1. in the lower menu you wil see the Variable Mapping menu appear. In this menu you can link your hardware or standard variables to your Twinsafe Group

  1. Start linking the variables to the inputs and outputs. If an variable cannot be found, it might already be used: click on “Used and unused” to find it.In order to link multiple inputs/outputs to a variable, use the Ctrl button.

Verify project

Last step is to go to TwinSAFE → Verify Complete Safety Project.

Typical errors are:

  • Dip-switches not matching the FSoE address (set the correct values)
  • Double used FSoE addresses (set the correct values)
  • Target system not reachable/not found in case your EtherCAT devices are not connected (connect TwinCAT to the EtherCAT devices again)

The next step is to download the safety project to your Safety PLC. There are 2 ways to do this: Using Twincat Download TwinSAFE project to FSoE Master with TwinCAT or via the TwinSAFE Loader. Download TwinSAFE project to FSoE Master with TwinSAFEloader.