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.

Problem with item of type array

More
24 May 2020 07:09 #8506 by support
Hello,,

there is no standardized way in OPC Classic to retrieve array dimensions. The only way to do it is to actually read the array item (or subscribe to it), and then, when you get the array value, you will be able to get its dimensions using normal means.

VarType.NumericalValue is documented as "The numerical (integer) value of the data type.". It is the same thing information as in VarType.InternalValue, but expressed as a number (bit mask). It does not contain more or different information from InternalValue. The actual numerical values are documented in Windows, e.g. docs.microsoft.com/en-us/openspecs/windows_protocols/ms-oaut...9f-5803-4dc4-9d14-5425d3f5461f , but normally you should have no need to use this property.

The "type mismatch" error you get in Demo app originates in the server, not in the client. It appears because the "RegisterXXXX" items do not have any initial contents in them. If you write the array into such item first, you will then be able to read it. But the Demo app does not have the ability to write arrays.

Best regards

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

More
23 May 2020 18:17 #8504 by KarimgSaikali
When we retrieve the property ‘DAPropertyIds.DataType‘ from DANodeElement.ItemId, we got a VarType value. From it we can retrieve:

- .IsArray

- .InternalValue (of type vartypes From which we retrieve the datatype (int32, float, etc..)

- .NumericalValue which we thought will provide the size of the array but return always 8096!

In the case of data leaf of type array, How do we retrieve the size of the array?


Also, In the provided free Demo application, when we select from:

Server Class: OPCLabs.KitServer.2

Item Id: Simulation.RegisterSet_1.ArrayOfUI2

And click on Read item, we got the exception: “Type mismatch + The client method called was 'ReadMultipleItems'.”

Same error when trying to read other leaves of type array in the demo?

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

Moderators: support
Time to create page: 0.043 seconds