Join us today!

Creating a TwinSAFE...
 
Notifications
Clear all

[Solved] Creating a TwinSAFE Simulation Project

3 Posts
3 Users
2 Reactions
4,151 Views
twinControls
Posts: 115
Admin
Topic starter
(@twincontrols)
Member
Joined: 2 years ago

This tutorial will demonstrate the creation of ESTOP function variant 1 (category 3, PL d) safety simulation project. 

Create a TwinCAT project, then right click on 'SAFETY', select 'Add New Item' to create a new safety project. 

additem

 

There will be 3 safety project options. The first option includes the ErrAck mappings, second option includes ErrAck mappings and Run mappings. Select the second option to create a project with ErrAck mappings and Run mappings. Give it a name and click OK.

selectsecond

 

You can change the name or the target system on this window if you'd like. Confirm the selections and click OK. 

confirmconfigs

 

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 EL6910.

selecttargetsystem

 

To select the simulation device, click on the icon shown below and select 'External Device'. 

externaldevice

 

Leave the AMS Net ID as it is and click OK. 

enteramsnetid

 

To add the safety input and output terminals, right click on Alias Devices and select 'Add', then 'New Item'. 

addnewitemaliasdevice

 

Select the Beckhoff Automation on the left menu, choose the EL1904 4 channel digital inputs card. Click Add. 

addEL1904digitalinputs

 

Now add the EL2904 4 channel digital outputs card as well. 

addEL2904digitaloutputs

 

Set the FSoE address of the EL1904 input card. 

fsoeadressinputcard

 

Set the FSoE address of the EL2904 output card.

fsoeadressoutputcard

 

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. 

addestop

 

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 input variables shown below:

addvariables

 

To link the variables, go to the 'Variable Mapping' tab, then click on the three dot box and select input for the safety variable. Select the EL1904 'input channel 3' for Reset. 

variablemapping

 

Select the EL1904 'input channel 1' for EStop1 and the EL1904 'input channel 2' for EStop2.

addestopsmapping

 

Add 'EStopOut' varible the EStop circuit. 

addoutput

 

Map the 'EStopOut' varible to EL2904 'output channel 1'. 

mappoutput

 

Enable the 'Safety toolbar' by going go to View -> Toolbars -> TwinCAT Safety. 

addsafetytoolbar

 

Save the project and you will see that 'Debug Safety Project' will become active. Click to start it. 

saveproject

 

Click Run to start running the logic. 

run

 

Now we need to set the Group RUN signal. Select the 'GroupPort_RunStop' Signal in the variable mapping section and double click on the 'Online Value' to set it to TRUE. 

runsignal

 

We can see that Group goes in RUN state, but the EStop is active. Set the EStop signals to TRUE. 

setestopsignals

 

Reset is needed for the EStop block. Double click to set the Reset variable online value to TRUE. 

resetneeded

 

EStop block state transition indicator becomes Red and Green which indicates that the block is waiting for 'Reset' signal to go low to turn on the EStop output. Double click to set the Reset variable online value to FALSE. 

fallingedgeresetneeded

 

Now we can see that EStop is cleared and the safety output is on. 

estopcleared

 

Reply
2 Replies
Posts: 1
(@srinath-ramachandran)
New Member
Joined: 1 year ago

Hi @twinControls, thank you for the nice tutorial to simulate TwinSAFE safety logic. Is it possible to link PLC variables and run simulation locally? 

Reply
Posts: 1
(@r2k-in-the-vortex)
New Member
Joined: 11 months ago

Do not attempt to simulate safety for EL6900, it does not work, the debug project button never becomes active.

It has to be one of the newer modules such as EL6910

Reply
Share: