Join us today!
[Solved] Creating a TwinSAFE Project
This tutorial will demonstrate the creation of ESTOP function variant 1 (category 3, PL d) safety project. You can access to 'Application Guide TwinSAFE' document from this link.
Create a TwinCAT project and add an EtherCAT Master, EK1100 bus coupler, EL1004, EL6900, EL1904, EL2904, EL9011 safety terminals. Then right click on 'SAFETY', select 'Add New Item' to create a new safety project.
There will be 3 safety project options. The first option includes the ErrAck mappings, second option includes ErrAck mappings and Run mappings. Select the third option to create an empty project. Give it a name and click OK.
You can change the name or the target system on this window if you'd like. Confirm the selections and click OK.
Now we need to select the target system. Double click on the target system open the settings. Using the dropdown menu, select the safety target system. In this project, we have used EL6900.
To select the psychical device, click on the icon shown below and select Term 3 (EL6900).
If you have actually have the physical device, you can refresh the hardware address or transfer hardware address to the safe address. Hardware address is the dip switch addresses located on the safety terminal.
To add the ErrAck and Run mappings, right click on the TwinSAFE project, select 'Add', then New Item.
Select the second option to add both ErrAck and Run mappings.
We need to add more alias devices to link our variables from plc project to safety project. Right click on the 'Alias Devices' , select 'Add', then New Item.
Select '1 Digital Input (Standard)' for the External Device Monitoring (EDM) signal. This signal is used to ensure that external contactors controlled by the safety module outputs are able to interrupt the safety circuit. Add 'Reset' alias as well applying to same steps.
We can import alias devices into the project by right clicking the 'Alias Devices' and selecting 'Import Alias Devices' option.
On the open window, Click 'select all' to import EL1904 and EL2904 alias devices into the safety project.
Double click on the EL1904 and EL2904 alias devices and check the FSoE and dip switch addresses if the terminals are physically present.
We will now link the variables in the PLC program to the safety project. Add the code below in MAIN program and build the solution.
PROGRAM MAIN VAR //To safety alias devices QbSafetyErrAck AT%Q* : BOOL := FALSE; QbEStopReset AT%Q* : BOOL; bQSafetyRun AT%Q* : BOOL; bQEStopEDM AT%Q* : BOOL; //from safety terminal IbEStopReset AT%I* : BOOL; IbEStopEDM AT%I* : BOOL; fbDelay : TON; END_VAR bQEStopEDM := IbEStopEDM; QbEStopReset := IbEStopReset; IF bQSafetyRun THEN QbSafetyErrAck := TRUE; fbDelay(IN:=TRUE , PT:=T#75MS , Q=> , ET=> ); IF fbDelay.Q THEN QbSafetyErrAck := FALSE; END_IF END_IF
After the build, you can see the plc project inputs and outputs.
Go to Twinsafe project section again and double click on the EDM1.sds alias. Click on the icon shown below to open the link options. Select the EDM signal from the list. This will link the EDM signal in the PLC to the EDM1 alias device. Repeat this process for Reset, Run and ErrorAcknowledgement alias devices as well.
Reset and EDM signals in the PLC project are controlled through EL1004 terminal in this project. Go to PlcTask Inputs and double click on the reset input, click to 'Linked to' button and select first input of EL1004 terminal.
Link the EDM input as well.
To comply with category 3, PL d standard, safety parameters of EL1904 and EL2904 terminals must meet the conditions below:
You can check these parameters under the 'safety parameters' tab and modify them if necessary.
We will now add the Estop circuit for the project. Double click on the TwinSafeGroup1.sal and click the toolbox. Select the safeEstop circuit and drag and drop it on the network section.
To add variables, you can either click on the desired input and type the variable name there or you can type name under the properties in the 'Assigned Variable Name' section. Add the variables shown below:
You can also rename the Network name. Rename the network as 'ESTOP' and click on 'Variable Mapping' .
To link the variables, click on the three dot box and select the corresponding alias device.
Reset:
Estop signal is coming from the channel 1 and 2 of the EL1904 terminal:
Estop output will be linked to channel 1 of EL2904:
After the all the linking, we can verify and download the safety project. If the safety toolbar is not visible, you can enable it from the view menu.
Click on the multi download button and select the safety project.
Type the username 'Administrator' and the password 'TwinSAFE', select the project and click Next.
Confirm the final verification.
Type the password again.
Multi Download result will be shown.
You can click on the 'show online data' to see the status of the signals.
Log in the PLC and set the bQSafetyRun signal to TRUE In the MAIN program and then toggle the reset signal from the EL1004 terminal. You will see the Group Run status afterwards.
In case you want to say thank you !)
We'd be very grateful if you could share this community with your colleagues and friends. You can also buy us a coffee to keep us fueled 😊 This is the best way to say thank you to this project and support your community.
twinControls - https://twincontrols.com/
- 17 Forums
- 265 Topics
- 932 Posts
- 0 Online
- 688 Members