Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5

OPCUA Client connection fails with Twincat

#1
Hallo, everyone,

my RoboDK Client function can only between two RoboDK. But It dont work between RoboDK and Twincat or RoboDK and UaExpert.

In my project, I want the RoboDK as a Client and Twincat as a Server. My Twincat as a Server can problemlos connect with UaExpert Client. That means my Server is ok. But when I set Twincat as a server or set UaExpert as a server, RoboDK client connot connect. 

The butten will go green for one second or seconds and then go grey. Two errors will show up when we check the log.

1.This error usually happens when the OPCUA server URL is not correct. It normally does not happen.
2024-04-05T18:41:13:Connecting to OPC-UA server failed. Reason: The network connection has been closed.

2.This error always happens and I usually dont know how to fix it.
2024-04-05T18:35:12:Connecting to OPC-UA server failed. Reason: An internal error occurred as a result of a programming or configuration error

I also check the firewall. I only open the firewall for public network. So that also should not be a problem.

I hope that I can get the methods here.
#2
Can you provide us with the steps to reproduce your connection tests between RoboDK and Twincat using OPC-UA? We can better look into it.

If you setup the RoboDK OPC-UA plugin as a server you should be able to connect from an OPC-UA client, such as UaExpert.

Also, for your information, this addin is open source and you can customize it to match your exact needs. You can find it here:
https://github.com/RoboDK/Plug-In-Interf...gin-OPC-UA
#3
Hello,

it will be better if RoboDK work as a client and twincat as a server. I have also test both as a server or a client. So I will list the both situation.

1. RoboDK as a client, Twincat as a server(I want this)
I set all the settings like this video. And UaExpert can successfully work with that. That means my server is set in a right way.
https://www.youtube.com/watch?v=aUClSRSSR_E
but then I try the url in RoboDK. That didnt work. That will show the error like this.
2024-04-05T18:35:12:Connecting to OPC-UA server failed. Reason: An internal error occurred as a result of a programming or configuration error
URL: opc.tcp://169.254.245.10:4840
opc.tcp://localhost:4840
opc.tcp://IWFPC439:4840
These three all work between Twincat and UaExpert and Port 48440 also works.
But they didnt work between Twincat and RoboDK.

But If I set the 4840 in a RoboDKServer and opc.tcp://localhost:4840 in a RoboDK client. That can successfully work, like here.
https://robodk.com/doc/en/OPC-UA.html#ExOPCUA-C

But I think this function can work between Twincat and RoboDK.

2.Twincat as a client, RoboDK as a server
There is no error and everthing goes smoothly. But it didnt transfer data.

I set all the things like here https://robodk.com/doc/en/OPC-UA.html#ExBeckhoffPLCCode
except i make the plc code easier.
PROGRAM MAIN

VAR

   bConnected      :BOOL;

   
Robot1: FB_Device_1_Client_1_getItem;
Getjoint: FB_Device_1_Client_1_getJointsStr;
END_VAR

VAR

   Robot_name      :STRING(80):='Staubli RX170HP';

   Item_ID         :ULINT;

   
END_VAR
Robot1(
bExecute:= 1, 
Item_Name:= Robot_name, 
nErrorID=> , 
bDone=> , 
bBusy=> , 
bError=> , 
Item_ID=> );

Getjoint(
bExecute:= 1, 
Robot_name:= Robot_name, 
nErrorID=> , 
bDone=> , 
bBusy=> , 
bError=> , 
Joints=> );

When I run this, there is no error. But I can get nothing back from RoboDK.
#4
What type of information do you want to retrieve from the Twincat PLC and RoboDK as a client? This may require customizing the OPC-UA Addin.

Is there a way we can reproduce the issues you are having?

If you have a professional license it is better if you contact us through Help-Request support and we can better help you customize your OPC-UA add-in.
#5
I want to transfer the position and set the position from twincat.

We have an edeucation license, not a professional license.

I install the OPCUA client, server and configurator from the Beckhoff offical website.
I set Twincat like this  https://www.youtube.com/watch?v=aUClSRSSR_E. That includes creat a new connectivity project(bild connectivity1,2,3 and 4)                 
remeber the AMSnet ID should be yours. The video says where it is but i cannot make screen shot here.

and set the license(bild license).    

then find the configurator(bild configurator).    

set the server.(bild server 1,2 and 3)click serverlist, then click add server, then enter and choose these information. Then click connect. remeber to check the Data Acess in Activite OPCUA configuration. I will add these 5 bilds in the next post.

After I set the server in Twincat. I have already install OPCUA settings from here  OPC-UA | RoboDK and add it in Tools-Addin-OPCUA. If I want to start the client of RoboDK and click connect
 under the OPCUA Client Settings. Then it will be like the bild named ROBODK.    

But if I use Uaexpert as a client. It can successfully connect.

Best Regards
Qiaochu Wang


server1
   
server2
   
server3
   
server4
   
server5
   

And Uaexpert connect bild 
   

So should I set more about OPCUA? I dont know how to use these things in your link https://github.com/RoboDK/Plug-In-Interf...gin-OPC-UA
#6
Thank you for this information. We'll try this on our end and keep you posted.
  




Users browsing this thread:
1 Guest(s)