Hey there, for once I am the one asking for support.
Has anyone tried set up TwinCat with OPC UA to use it with Factory I/O?
I tried setting it up but stumbled at multiple points…
Hi @janbumer1!
Could you please elaborate a bit more about the issues you’ve encountered? We have a Beckhoff PLC here in the lab and we would like to test it out and see if we can help in any way.
Hey there
I guess it’s not really problem on your end. I tried setting up a OPC Server using the tools provided by Beckhoff. But when I try to connect to the OPC Server I get an Error message.
Hi!
I see, could you let me know what error you get?
In the meantime, I tried to set it up and also had some troubles. Eventually, I got it to work with Factory I/O and control the ‘From A to B’ scene. I’ll detail the steps I took here and I hope it helps you set it up. If you still can’t get it to work let us know and we’ll try to help you.
First, you need to install the TF 6100 OPC UA communication package available on Beckhoff’s website, here. I installed the TF 6100 Server, TF 6100 Configurator.
The second step is to configure the TwinCAT project so it is ready to use OPC UA, for that, in this link select TwinCAT 3 > TFxxxx | TwinCAT 3 Functions > TF6xxx - Connectivity > TF6100 | OPC UA > Technical introduction > Server > Quick Start and then follow the instructions given.
Next, you will configure the server. For that, you use the TF 6100 Configurator. This is installed both as a standalone application and integrated into the TwinCAT software. I tried both and I, personally, prefer the version that is integrated into TwinCAT. To use the configurator you open TwinCAT XAE Shell and create a new “Connectivity Project”.
Once the project is open you right-click on the project item in the Solution Explorer tree, and add an OPC UA Server Project, as shown in the images below.
With that set up, the next step is to add the OPC UA tools to the toolbar. Select View > Toolbars > TwinCAT OPC UA Configurator.
Next, you need to edit the server list. For that, in the toolbar you’ll find the OPC UA tools you just added. In the dropdown list select “Edit Serverlist” and the “Server configuration” window should open.
Click “Add Server”.
This should open the “Endpoint configuration” window.
In the dropdown list there should appear one or more options (in my case it only shows one because I’ve disabled the others as I’ll show in a bit). Select the one that has “Basic256Sha256”, make sure you select the “Anonymous” option and click “OK”. Close the “Server configuration” window.
The last thing to configure here is the Security Policies the server supports. For that select the OPC UA Server Project and then select the tab UA Endpoints. In this tab deselect all checkboxes except the Basic256Sha256.
In the dropdown list in the OPC UA toolbar select the server you just added and hit the “Connect” button in the OPC UA toolbar. It will then ask you for a username and password. You can use whatever you want, just note them down because they will be needed later. The first time you try to connect to the server it will not connect, it will initialize the server. Click “Connect” again.
You should see a window asking if you trust the server, click “Trust”.
If the connection is successful the “Connect” button should now be greyed out. In case the Security configurations are reverted, reconfigure them and, in the OPC UA Server toolbar, select the “Activate OPC UA Server Config” button, which is next to the “Disconnect” button. Then click “Connect”.
Next, make sure that in the project tree, under the OPC UA Server Project item, in the Data Access, there is an item with the same name as the PLC Project you are using for programming.
Select that item and check the “Properties” window to make sure the “AMS Net ID” is the same as the one in the PLC Project you are using. For that, you can select the “…” button in the AMS Net ID field to open the “Choose target device” window and select the device you are using.
Restart the server to apply the changes. For that, you can do “Disconnect” and “Connect” or use the restart button, illustrated below.
The last thing to configure is to add the username and password defined before in Factory I/O. In order to do that you have to use the “drivers.opc_client.ua_username” and “drivers.opc_client.ua_password” commands in Factory I/O’s console. For more info on the console, you can check our documentation here.
Now you should be able to connect to the server normally. I hope this helps.
You are the best, thank you very much!
I will try this later on!
I can’t find this specific link in the Beckhoff Information System. See the image below, as you can see there isn’t any “TF6100 | OPC UA”. Should I just go with the server, or configurator?
Thank you in advance
Welcome to the forum!
It seems like Beckhoff has updated their documentation. Thank you for pointing it out, that way I can update here too!
You should use the Server. I haven’t used the configurator, but according to Beckhoff, it is a graphical user interface for configuring the OPC UA Server. You can use it, but as far as I understand, it is not mandatory to establish communication via OPC UA.