Join us today!

Creating a TwinSAFE...
 
Notifications
Clear all

[Solved] Creating a TwinSAFE Project

1 Posts
1 Users
0 Likes
1,314 Views
TwinControls
Posts: 71
Admin
Topic starter
(@beckhoffsupport)
Member
Joined: 2 years ago

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. 

additems

 

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.

selectproject

 

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

confirm

 

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.

selecttarget

 

To select the psychical device, click on the icon shown below and select Term 3 (EL6900). 

selectdevice

 

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. 

refresh

 

To add the ErrAck and Run mappings, right click on the TwinSAFE project, select 'Add', then New Item. 

addsafetyiomodules

 

Select the second option to add both ErrAck and Run mappings. 

addErrackandrunalias

 

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. 

addestopalias

 

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. 

addedm

 

We can import alias devices into the project by right clicking the 'Alias Devices' and selecting 'Import Alias Devices' option. 

importalias

 

On the open window, Click 'select all' to import EL1904 and EL2904 alias devices into the safety project. 

addiotree

Double click on the EL1904 and EL2904 alias devices and check the FSoE and dip switch addresses if the terminals are physically present. 

iotreeadded

 

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

 

build

 

After the build, you can see the plc project inputs and outputs. 

inputoutput

 

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. 

linkedm
linkededm

 

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. 

resetsignal

Link the EDM input as well. 

edminput

To comply with category 3, PL d standard, safety parameters of EL1904 and EL2904 terminals must meet the conditions below: 

category3plDstandard

 

You can check these parameters under the 'safety parameters' tab and modify them if necessary. 

el1904safetyparameters
el2904safetyparameters

 

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. 

twinsafegroup

 

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: 

addvarstoestop

 

You can also rename the Network name. Rename the network as 'ESTOP' and click on 'Variable Mapping' . 

renamenetworkselectvariablemapping

 

To link the variables, click on the three dot box and select the corresponding alias device. 

Reset:

assignresetalias

Estop signal is coming from the channel 1 and 2 of the EL1904 terminal: 

assignestopalias

Estop output will be linked to channel 1 of EL2904: 

estopout

 

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. 

twinsafeeditor

Click on the multi download button and select the safety project.

verifydownload

 

selectprojectdownload

 

Type the username 'Administrator' and the password 'TwinSAFE', select the project and click Next. 

usernamepw

 

Confirm the final verification. 

finalverify

 

Type the password again.

enterpwagain

 

Multi Download result will be shown. 

success

 

You can click on the 'show online data' to see the status of the signals. 

showonlinedata

 

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. 

running

 

Reply
Share: