Professional OPC
Development Tools

logos

Tag data type

More
23 Mar 2015 14:14 #2988 by support
Replied by support on topic Tag data type
The OPC UA specification allows unambiguous "answers" (-1 for Scalar, and >= 1 for precise number of dimensions of an array). In addition, presumably because there are use cases for it that needed be covered, it allows for more ambiguous "answers" as well (0 means basically "any array", including multi-dimensional arrays).

We have no influence over what the server provides; it is a value of an attribute like any other data we get, we just provide it to you.

If the value is always a one-dimensional array, I would expect the server to return unambiguous 1 for the ValueRank attribute. A value of 0 (OneOrMoreDimensions) is not incorrect, but is of course less informative. You need to ask the server vendor why they have implemented it in this way.
The following user(s) said Thank You: adid@contel.co.il

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

More
23 Mar 2015 10:17 #2984 by adid@contel.co.il
Replied by adid@contel.co.il on topic Tag data type
hello,

first of all thank you for your time and answer.
why the answer in not Unambiguously ? when i will get answer ValueRanks.ScalarOrOneDimension ?

thank you,
Adi Damty

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

More
23 Mar 2015 09:11 #2980 by support
Replied by support on topic Tag data type
The ValueRank should be interpreted according to OPC UA specs. And, some of the common values you will find in our class OpcLabs.EasyOpc.UA.UAValueRanks :

        /// <summary>
        /// The variable may be a scalar or a one dimensional array.
        /// </summary>
        public const int ScalarOrOneDimension = ValueRanks.ScalarOrOneDimension;    // -3
 
        /// <summary>
        /// The variable may be a scalar or an array of any dimension.
        /// </summary>
        public const int Any = ValueRanks.Any;  // -2
 
        /// <summary>
        /// The variable is always a scalar.
        /// </summary>
        public const int Scalar = ValueRanks.Scalar;    // -1
 
        /// <summary>
        /// The variable is always an array with one or more dimensions.
        /// </summary>
        public const int OneOrMoreDimensions = ValueRanks.OneOrMoreDimensions;  // 0
 
        /// <summary>
        /// The variable is always one dimensional array.
        /// </summary>
        public const int OneDimension = ValueRanks.OneDimension;    // 1
 
        /// <summary>
        /// The variable is always an array with two or more dimensions.
        /// </summary>
        public const int TwoDimensions = ValueRanks.TwoDimensions;  // 2


Best regards
The following user(s) said Thank You: adid@contel.co.il

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

More
23 Mar 2015 07:09 #2977 by adid@contel.co.il
Replied by adid@contel.co.il on topic Tag data type
hello,

using UAAttributeId.ValueRank i am getting value 0 when reading word array and value -1 when reading boolean tag for example. is that enough to distinguish between array and not array tag ?

thank you,
Adi Damty

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

More
21 Mar 2015 18:17 #2969 by support
Replied by support on topic Tag data type
UAAttributeId.ValueRank should be the primary means to distinguish an array. What results do you get with it?
The following user(s) said Thank You: adid@contel.co.il

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

More
11 Mar 2015 11:59 #2954 by adid@contel.co.il
hello,

if i use the code below for word tag or for word array tag, for both it return the type is UInt16.
how can i distinguish between word tag and word array tag ? i try to use UAAttributeId.ArrayDimensions, but in both cases it return null.

thank you,
Adi Damty


EasyUAClient m_EasyUAClient = new EasyUAClient();
UANodeArguments uaNodeArguments = null;
UAAttributeData uaAttributeData = null;

uaNodeArguments = new UANodeArguments();
uaNodeArguments.EndpointDescriptor = "opc.tcp://127.0.0.1:49320";
uaNodeArguments.NodeDescriptor = new UANodeDescriptor(m_ServiceBaseLogic.GetNodeId("opc.tcp://127.0.0.1:49320", "3401_DoserPLC.OMRON_CQM51.DSSimTotal"));
uaAttributeData = m_EasyUAClient.Read(uaNodeArguments, UAAttributeId.DataType);
object a = uaAttributeData.Value;

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

Moderators: support
Time to create page: 0.198 seconds

      

 Recommend this on Google