Dear Community User! We have started the migration process.
This community is now in READ ONLY mode.
Read more: Important information on the platform change.

cancel
Showing results for 
Search instead for 
Did you mean: 
SOLVED

Cannot use OPC UA Method with OPC UA App

Cannot use OPC UA Method with OPC UA App

jacaré
Long-established Member

I try to execute a OPC UA Method with the OPC UA App installed on a virtual core.

jacar_1-1701270887915.png

Whats the correct format to pass the number 9 to the method?
In OPC UA Expert it looks like this:

jacar_3-1701271504872.png

 

 

7 REPLIES 7

Sgilk
Frequent Contributor

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?

jacaré
Long-established Member

still the same issue:

jacar_0-1701342421692.png

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

jacar_1-1701342558350.png

 

I would expect that the InputArguments is an array of objects. So you will have to encapsulate your double in an array.

Sgilk
Frequent Contributor

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.

Sgilk_0-1701356569192.png

Sgilk_1-1701356612932.png

 

From the OPC UA Client documentation...

Sgilk_2-1701356653929.png

NoRisk4Project
Long-established Member

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.

bostroemc
Occasional Contributor

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:

Math.png

symbol_config.pngopc_ua_method_call.png

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.

 

NoRisk4Project
Long-established Member

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.

2023-12-07_10h02_37.png

Inside the DataLayer (I named my client "Milo") it's "opcuaclient/Milo/i=85/ns=2;s=Methods/sqrt(x)"

2023-12-07_09h47_57.png

and when you connect via our OPC UA server it's "ns=6;s=opcuaclient/Milo/i=85/ns=2;s=Methods/sqrt(x)"

2023-12-07_10h02_13.png

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)"

2023-12-07_09h57_00.png

and "ns=6;s=opcuaclient/Milo/i=85/ns=2;s=Methods/ns=2;s=Methods/sqrt(x)" inside our OPC UA server.

2023-12-07_09h58_42.png

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.  

Icon--AD-black-48x48Icon--address-consumer-data-black-48x48Icon--appointment-black-48x48Icon--back-left-black-48x48Icon--calendar-black-48x48Icon--center-alignedIcon--Checkbox-checkIcon--clock-black-48x48Icon--close-black-48x48Icon--compare-black-48x48Icon--confirmation-black-48x48Icon--dealer-details-black-48x48Icon--delete-black-48x48Icon--delivery-black-48x48Icon--down-black-48x48Icon--download-black-48x48Ic-OverlayAlertIcon--externallink-black-48x48Icon-Filledforward-right_adjustedIcon--grid-view-black-48x48IC_gd_Check-Circle170821_Icons_Community170823_Bosch_Icons170823_Bosch_Icons170821_Icons_CommunityIC-logout170821_Icons_Community170825_Bosch_Icons170821_Icons_CommunityIC-shopping-cart2170821_Icons_CommunityIC-upIC_UserIcon--imageIcon--info-i-black-48x48Icon--left-alignedIcon--Less-minimize-black-48x48Icon-FilledIcon--List-Check-grennIcon--List-Check-blackIcon--List-Cross-blackIcon--list-view-mobile-black-48x48Icon--list-view-black-48x48Icon--More-Maximize-black-48x48Icon--my-product-black-48x48Icon--newsletter-black-48x48Icon--payment-black-48x48Icon--print-black-48x48Icon--promotion-black-48x48Icon--registration-black-48x48Icon--Reset-black-48x48Icon--right-alignedshare-circle1Icon--share-black-48x48Icon--shopping-bag-black-48x48Icon-shopping-cartIcon--start-play-black-48x48Icon--store-locator-black-48x48Ic-OverlayAlertIcon--summary-black-48x48tumblrIcon-FilledvineIc-OverlayAlertwhishlist