Join us today!

Ignition OPC UA Ser...
 
Notifications
Clear all

Ignition OPC UA Server - TwinCAT OPC UA Client

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

In the previous tutorial, we have explained how to setup TwinCAT OPC UA Server and Ignition OPC UA Client. This time, we will set Ignition OPC UA Server and TwinCAT OPC UA Client. 

If you don't have Ignition installed already, you can download it here. You can open the Ignition gateway on your web browsing by typing localhost:8088/web .

 

Setting up Ignition OPC UA Server: 

On the Ignition gateway, select Config then Server Settings.

serversettings

 

Make the following changes and click save changes. More information about Ignition OPC UA Server settings can be found here

saveserverchanges

 

Ignition gateway needs to be restarted for the changes to take effect. You can open Services located at %windir%\system32\services.msc , find Ignition service in the list and restart it. 

restartignitiongateway

 

To add a new user to 'opcua-module' profile, go to Config, then  select 'Users,Roles'.  Click on 'More' and select manage users. 

manageusers

 

There's one default user exist already. We will add a new user also. Select add user. 

adduser

 

Set the username and the password as 'user' and check the ReadWrite role and save changes. 

saveuserchanges

 

To find out the OPC UA Server endpoint, go to Config and select OPC Connections. 

opcconnections

 

Click on 'More' option of Ignition OPC UA Server, then select endpoint. 

endpoint

 

Take a note of this endpoint somewhere, which we will be using later when configuring the TwinCAT OPC UA Client. 

configuredendpoint

 

go to Config and select OPC Connections again, and select Edit this time to change the Authentication settings. 

editserveruser

 

Change the username and password as below and save changes. 

changeopcuauser

 

Now we are done with setting up the Ignition OPC UA Server. We will add a simulator program of which tags we will browse in TwinCAT. Go to Config, select Device Connections. 

deviceconnections

 

Select Create new device. 

createnewdevice

 

Select the 'Programmable Device Simulator' and click Next. 

simulator

 

Name the simulator and click create new device. 

settingsforthedevice

 

To load a program into this simulator device, select More, then edit program. 

editsim

 

For this tutorial, we loaded the 'generic program' into it. Select a program, click Load Simulator Program. You will see all the tags in this program after loading the program. Save Program. 

saveprogram

 

It is a pretty extensive simulation program and as it can be seen below it has different types of variables already. 

simulatorprogramtags

 

 

Setting up TwinCAT OPC UA Client: 

Ignition OPC UA Server and simulator device setup is done and now we will setup the TwinCAT OPC UA Client. If the TF6100 OPC-UA-Client is not installed on your system, you can downlead it from here.  

opcuaclient

 

Create a TwinCAT project. Right click on 'Devices' and add new item. 

devices

 

Select the 'Virtual OPC UA Device' and click OK.

addvirtualopcuadevice

 

Right click on the Device 1(OPC UA Virtual) and select add new item. 

addclient

 

Select OPC UA Client and click OK. 

selectclient

 

Double click on Client#1 and type the endpoint URL that we noted earlier. Set the Identity Type as UserName and type the username and the password as 'user'. Click Select Endpoint. 

Ignition OPC UA Server settings for this tutorial are as below: 

Discovery URL: opc.tcp://localhost:62541/discovery
Endpoint URL: opc.tcp://localhost:62541
Endpoint Host Override:
Endpoint Security Mode: None
Endpoint Security Policy: None

 

endpointsettings

 

Increase the timeout and click Update. 

increasetimeout

 

It will bring up the available endpoints from the OPC UA Server. Select the first option(None,None) and click OK. 

addendpoint

 

It will automatically adjust the endpoint and security policies. Click Add nodes. 

addnodes

 

Trust the Ignition OPC UA Server certificate. 

trustcertificate

 

In the Select Nodes window, expand the simulator program(Test PLC) that we have created and select the tags that you wan to add into TwinCAT project. 'Enable Write' option allows users to write values to tags from TwinCAT. 'Add Status' adds timestamps and error codes info to the tags.

selectnodes

 

Double click on 'Write Enable' and set its value to enable client write permission in TwinCAT.

writeenable

 

Select a tag and check its value real-time. 

sinetag

 

You can write values to the writable tags. You can change the read/write permission settings of these tags in your simulator program on Ignition. 

write

 

You can change the polling rate under OPC UA Client settings if you need the a faster update cycle time for the tags. 

pollingrate

 

You can also see the OPC UA node information for the tags. 

tags

 

 Now that we have finished the setup of Ignition OPC UA Server and TwinCAT OPC UA Client, you can write a test program in TwinCAT, link your program variables to OPC UA tags and check the tag values on the Ignition side. 

 

 

Reply
Share: