FORUM CTRLX AUTOMATION
ctrlX World Partner Apps for ctrlX AUTOMATION
11-29-2023 04:25 PM
I try to execute a OPC UA Method with the OPC UA App installed on a virtual core.
Whats the correct format to pass the number 9 to the method?
In OPC UA Expert it looks like this:
Solved! Go to Solution.
11-29-2023 08:59 PM
Hi @jacaré ,
I'm fairly certain your problem will be solved by changing type "Double" to "double". See Data Type Overview as a reference.
A couple other questions to investigate further if necessary...
1. Where is the OPC UA Server running?
2. Where are the methods you are calling defined?
11-30-2023 12:09 PM
still the same issue:
It says unknown field: type.
I use this OPC UA Server:
opc.tcp://milo.digitalpetri.com:62541
Here is more information on the Server: https://github.com/digitalpetri/opc-ua-demo-server
11-30-2023 01:47 PM
I would expect that the InputArguments is an array of objects. So you will have to encapsulate your double in an array.
11-30-2023 04:04 PM
I looked into this a little further and I don't think our OPC UA Client supports method calls on their complex data type InputArgument definition at this time.
From the OPC UA Client documentation...
11-30-2023 07:00 PM - edited 11-30-2023 07:01 PM
Hello,
I could reproduce the behavior with the Milo OPC UA server and our OPC UA client app (version 2.04). Unfortunately, it looks like a bug inside our OPC UA Client app.
The method NodeID, provided by the Milo OPC UA server, is misinterpreted by the client app. Development is already examining the problem and I will keep you updated as soon I have new information.
11-30-2023 08:20 PM
As an aside, function block methods in the PLC can be added to the symbol configuration. These methods are then exposed in the OPC UA server app as OPC UA methods and can be called from any suitable OPC UA client.
Creating a function block with a sqrt method in the PLC and calling it from our own OPC UA client app looks like this:
Note that in this case the method input is a simple data type => the comments by Sgilk and NoRisk4Project re: the milo.digitalpetri server above are obviously still valid.
12-07-2023 05:27 PM
The problem is, as I mentioned before, the NodeId "ns=2;s=Methods/sqrt(x)" of the method and the interpretation of it inside the OPC UA Client app.
Inside the DataLayer (I named my client "Milo") it's "opcuaclient/Milo/i=85/ns=2;s=Methods/sqrt(x)"
and when you connect via our OPC UA server it's "ns=6;s=opcuaclient/Milo/i=85/ns=2;s=Methods/sqrt(x)"
And in both cases it doesn’t work, because the Id doesn’t fit.
I just tested a development version of the OPC UA Client app with a bugfix and now the NodeId inside the DataLayer is "opcuaclient/Milo/i=85/ns=2;s=Methods/ns=2;s=Methods/sqrt(x)"
and "ns=6;s=opcuaclient/Milo/i=85/ns=2;s=Methods/ns=2;s=Methods/sqrt(x)" inside our OPC UA server.
And now it runs ...
The bug will be fixed with RM24.03 (version 2.06).
If you use the OPC UA Client app inside the PLC, you don't need to wait for the bugfix. You can call the method by using the right NodeId ("ns=6;s=opcuaclient/Milo/i=85/ns=2;s=Methods/ns=2;s=Methods/sqrt(x)") right now.