21:01, EET
November 29, 2012
Hi,
I am using Prosys OPC UA java SDK. In console client after connecting to OPC UA demo server at opc.tcp://demo.ascolab.com:4841, when i read the node-class attribute of a node, it gives me a numeric value like this “Value: 2”.
How can i know about the node-class attribute of that node with this value?
Is there a manual or document to interpret this value?
Same is the case with Datatype, Access-level, User-Access-level attributes.
Kindly help me out here, i am kinda stuck here.
Regards,
Shahzad
21:16, EET
December 21, 2011
The attribute values are defined in the ‘Attributes’ class.
DataType is a NodeId. All standard NodeIds are defined in the Identifiers class. But it may be best to look up the respective DataType node, which you can get from UaCilent.getAddressSpace().getType() (you can cast the result to a UaDataType).
AccessLevel defines the enumeration the access level attributes – the integer value defines an EnumSet and there are respective methods to convert the integer to the EnumSet.
8:08, EET
December 21, 2011
11:33, EET
November 29, 2012
18:38, EET
November 29, 2012
Jouni Aro said
The attribute values are defined in the ‘Attributes’ class.
DataType is a NodeId. All standard NodeIds are defined in the Identifiers class. But it may be best to look up the respective DataType node, which you can get from UaCilent.getAddressSpace().getType() (you can cast the result to a UaDataType).
AccessLevel defines the enumeration the access level attributes – the integer value defines an EnumSet and there are respective methods to convert the integer to the EnumSet.
Could you provide that methods to convert the integer value to EnumSet. I cannot find it in org.opcfoundation.ua.core package.
20:34, EET
December 21, 2011
maahirx said
Jouni Aro said
The attribute values are defined in the ‘Attributes’ class.
DataType is a NodeId. All standard NodeIds are defined in the Identifiers class. But it may be best to look up the respective DataType node, which you can get from UaCilent.getAddressSpace().getType() (you can cast the result to a UaDataType).
AccessLevel defines the enumeration the access level attributes – the integer value defines an EnumSet and there are respective methods to convert the integer to the EnumSet.
Could you provide that methods to convert the integer value to EnumSet. I cannot find it in org.opcfoundation.ua.core package.
AccessLevel.getSet() – and AccessLevel.getMask() for the other direction.
22:47, EET
November 29, 2012
Alright, i get it. But that is not enough. Let me put it that way:
During browsing address space, at one node i called a method to get all the attributes of that node using following code
DataValue[] value = null;
UnsignedInteger attributeId[];
attributeId={Attributes.NodeId,Attributes.NodeClass,Attributes.BrowseName,Attributes.DisplayName,Attributes.Description,Attributes.WriteMask,Attributes.UserWriteMask,
Attributes.IsAbstract,Attributes.Symmetric,Attributes.InverseName,Attributes.ContainsNoLoops,Attributes.EventNotifier,Attributes.Value,Attributes.DataType,Attributes.ValueRank,Attributes.ArrayDimensions,Attributes.AccessLevel,Attributes.UserAccessLevel,Attributes.MinimumSamplingInterval,Attributes.Historizing,Attributes.Executable,Attributes.UserExecutable};
value = client.readAttributes(node, attributeId);
Now in return it gives me the following values.(A loop prints all the values.null values are omitted)
0: NodeId ns=2;s=MyLevel
1: NodeClass 2
2: BrowseName 2:MyLevel
3: DisplayName (en) MyLevel
5: WriteMask 0
6: UserWriteMask 2097151
12: Value 38.0
13: DataType class org.opcfoundation.ua.builtintypes.DataValue
i=11
14: ValueRank -1
16: AccessLevel 7
17: UserAccessLevel 7
18: MinimumSamplingInterval -1.0
19: Historizing true
What i am asking is a method to convert that integer value to a string message or user understandable form. Like in Node class attribute,2 represent it is a variable node-class. I studied the OPC UA address space, but i cant interpret the other attributes like, DataType,UserWriteMask,ValueRank,AccessLevel,UserAccesLevel,
MinimumSamplingInterval. There is a lot variety of data types.
I think i made my point, i simply need a method or methods to convert these return values to a string or User readable form. And sorry for my explanation, it is pretty confusing!!
Regards:
Shahzad
8:34, EET
December 21, 2011
Yes, that is a bit complicated. There are various enum types and some of the integers are just defined as constants.
Perhaps easiest is to use AddressSpace.getNode() and according to the actual type, convert the node to a specific type, e.g.
if (node instanceof UaVariable) {
UaVariable variable = ((UaVariable)node);
// Use the fields of UaVariable
}
// etc.
Otherwise you will need to convert each attribute by your own – we do not have a common conversion function for that.
Otherwise, you may also browse through the supported attributes for a node with
String attributeNameStr = AttributesUtil.toString(attributeId);
DataValue dataValue = node.readAttribute(attributeId);
// …
}
But you still get the pure values for each.
These classes will help in converting to strings if you go this route: WriteAccess, AccessLevel. ValueRanks contains the used constants but there is no string conversion defined.
15:54, EET
November 29, 2012
8:03, EET
December 21, 2011
9:53, EET
November 29, 2012
10:50, EET
December 21, 2011
21:04, EET
November 29, 2012
5:36, EET
November 29, 2012
19:32, EET
December 21, 2011
If you are looking for a GUI client, you can check our new OPC UA Java Client, which is available for downloads, although it’s still at beta development phase.
Or you can check UaExpert, from Unified Automation.
If you need to show the data in a Control Center, the best ones have an OPC UA client as well. All of them should have an OPC Client, in which case, you can use UaGateway to connect them to the OPC UA Server.
Most Users Ever Online: 1919
Currently Online:
20 Guest(s)
Currently Browsing this Page:
1 Guest(s)
Top Posters:
Heikki Tahvanainen: 402
hbrackel: 144
rocket science: 88
pramanj: 86
Francesco Zambon: 83
Ibrahim: 78
Sabari: 62
kapsl: 57
gjevremovic: 49
Xavier: 43
Member Stats:
Guest Posters: 0
Members: 738
Moderators: 7
Admins: 1
Forum Stats:
Groups: 3
Forums: 15
Topics: 1529
Posts: 6471
Newest Members:
doylenewbery, mickey21654, donnyredmond08, keesha4235, cheribruce, candacekolb4, Garmcrypto7Zof, calebhardison, susannahdingle7, inilarythikibiaModerators: Jouni Aro: 1026, Pyry: 1, Petri: 0, Bjarne Boström: 1032, Jimmy Ni: 26, Matti Siponen: 349, Lusetti: 0
Administrators: admin: 1