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.

OPC UA Browsing - getting the item data-type - is "number" a valid value?

More
02 May 2021 15:49 #9640 by micham
Hi,

Thank you for your answer!

Works fine after reading the value.

Michael

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

More
26 Apr 2021 17:17 #9630 by support
This is clear.

The data type of the variable, as such, is Number. This means that every time you read it, it may be a different numeric type. It can be Int32 now, and Byte next time, and Double some seconds later, etc.

You will also see "Number", I suppose, in UA Expert, if you:
1. Select the variable in the "Address Space" window (left center of UA Expert)
2. Inspect the "DataType" attribute in "Attributes" window (right top of UA Expert).

What you have shown in the picture is the actual type of the value of that variable at given point in time. It can never be a Number (because Number is an abstract type). But it happened to be Int32.

If you subscribe or read the actual value using QuickOPC, and then you look at what you receive (such as UAAttributeData.Value?.GetType()), you will also get Int32. And that is what you were looking at in UAExpert.

The DataType of the variable is available during browsing, and many/most servers will be able to provide it without having an operational connection to the underlying hardware/subsystem. So that's what suitable for client-side configuration.

The actual type of value at runtime, in this case (when DataType = Number) can differ from one moment to another, and the server won't be able to tell it to you without being actually connected to the underlying hardware/subsystem. Even UA Expert does not show it to you "by itself" - you actually need to drag the variable into the "Data Access View" - which is equivalent of Reading or Subscribing to the Value attribute in QuickOPC.

Best regards

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

More
26 Apr 2021 16:57 #9629 by micham
Hi,

Thank you for your answer. See the attached screen capture.

Thanks.

Michael
Attachments:

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

More
26 Apr 2021 16:24 #9628 by support
Hello.

"Number" can be any number (many numeric types derive from it, including Int32). So, it is not always Int32.

Can you please post here images from the other tool that shows you "Int32". It is possible that the tool reads out a different thing, not the DataType attribute as you do. For example, you might be looking at the actual data value.

Best regards

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

More
26 Apr 2021 15:54 #9627 by micham
Hi,
We use the following API to determine the data-type of the OPC UA item.

ValueResult = easyUAClient.ReadValue(MyServerURL, values(i).NodeId.ExpandedText, UAAttributeId.DataType)

Then we use the ValueResult.StandardName as the data-type. For some items we get the value of "Number". When I browse for the same item using another OPC UA Explorer, I see that the data-type is "Int32".

Is "Number" a valid value? Should I always consider "Number" to "Int32"?

Thank you.

Michael
Attachments:

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

Moderators: support
Time to create page: 0.059 seconds