Professional OPC
Development Tools

logos

Online Forums

Technical support is provided through Support Forums below. Anybody can view them; you need to Register/Login to our site (see links in upper right corner) in order to Post questions. You do not have to be a licensed user of our product.

Please read Rules for forum posts before reporting your issue or asking a question. OPC Labs team is actively monitoring the forums, and replies as soon as possible. Various technical information can also be found in our Knowledge Base. For your convenience, we have also assembled a Frequently Asked Questions page.

Do not use the Contact page for technical issues.

Does the UAGenericObject work with the CallMethod?

More
10 Mar 2021 18:21 #9487 by support
Hello.

This should work, but I am not sure whether it works already in version 5.54 - plus, it is possible that it has never been tested, as I could not get my hands on a server which would support that.

The right way to do it would be the 2nd one, with "lOutput[0] as UAGenericObject".

I have one question and one recommendation then.
Question: What is the type of the object returned in IOutput[0]? (can be seen in the debugger, or print out IOutput[0].GetType() ).
Recommendation: Retest with current version (5.59).

Best regards

Please Log in or Create an account to join the conversation.

More
10 Mar 2021 16:00 #9485 by Restrepo
Hello Z,

I am currently working with a Customer that is trying to utilize Complex data in his application and he is trying to use it with the EasyUAClient.CallMethod. Now, the CallMethod returns an Object Array and it looks like he is not able to cast the Object array to UAGenericObject array. Now he has tried:

UAGenericObject lOutput = (UAGenericObject)mClient.CallMethod(endpointDescriptor, "object", "method");

He gets the following error:

"Unable to cast object of type 'System.Object[]' to type 'OpcLabs.EasyOpc.UA.Plugins.ComplexData.UAGenericObject[]'."

Now, the documentation notes that the return type from CallMethod is an object array. And the examples that we found for UAGenericObject are used with the ReadValue method, which returns a single object. So, I am curious, is there a way to use the UAGenericObject with the CallMethod?

the customer also tried to cast the first index of the object array into a UAGenericObject and still got a null value as below:
UAGenericObject go = lOutput[0] as UAGenericObject;

He is using version 5.54 of the SDK

Please do le time know if you have any questions.

Please Log in or Create an account to join the conversation.

Moderators: support
Time to create page: 0.043 seconds