![sp_Feed](https://forum.prosysopc.com/wp-content/sp-resources/forum-themes/default/images/sp_Feed.png)
![sp_TopicIcon](https://forum.prosysopc.com/wp-content/sp-resources/forum-themes/default/images/sp_TopicIcon.png)
17:05, EEST
![Avatar](https://forum.prosysopc.com/wp-content/sp-resources/forum-avatars/14896526571489670516_vegastrike_50.png)
March 16, 2017
![sp_UserOfflineSmall](https://forum.prosysopc.com/wp-content/sp-resources/forum-themes/default/images/sp_UserOfflineSmall.png)
Hi there,
I’ve observed something strange with an OpcUa server.
On this server there is a node, which has a NodeClass Variable, but when I look at the DataType, it shows me:
v DataType
….> NamespaceIndex 0
….> NamespaceURI http://opcfoundation.org/UA/
….> IdentifierType 0 (Numeric)
….> Identifier 0
When checking the Types, there is no Type with NodeId 0 in Namespace 0. Is this something which is valid?
Thanks!
9:21, EEST
![Avatar](https://forum.prosysopc.com/wp-content/sp-resources/forum-avatars/defaults/moderatordefault.png)
Moderators
February 11, 2020
![sp_UserOfflineSmall](https://forum.prosysopc.com/wp-content/sp-resources/forum-themes/default/images/sp_UserOfflineSmall.png)
Hello,
A NodeId with NamespaceIndex 0 and Numeric value 0 is a null NodeId. It doesn’t (or at least it shouldn’t) refer to any Node in the Server’s AddressSpace.
A Server returning such NodeId for a DataType Attribute of a Variable means that the Server doesn’t specify the DataType for that Variable. The OPC UA Specification states that the DataType Attribute shall be a valid non-null NodeId (https://reference.opcfoundation.org/Core/Part3/v105/docs/5.6), but we have seen Servers return null NodeId for DataType Attribute before.
10:08, EEST
![Avatar](https://forum.prosysopc.com/wp-content/sp-resources/forum-avatars/14896526571489670516_vegastrike_50.png)
March 16, 2017
![sp_UserOfflineSmall](https://forum.prosysopc.com/wp-content/sp-resources/forum-themes/default/images/sp_UserOfflineSmall.png)
12:14, EEST
![Avatar](https://forum.prosysopc.com/wp-content/sp-resources/forum-avatars/14896526571489670516_vegastrike_50.png)
March 16, 2017
![sp_UserOfflineSmall](https://forum.prosysopc.com/wp-content/sp-resources/forum-themes/default/images/sp_UserOfflineSmall.png)
12:34, EEST
![Avatar](https://forum.prosysopc.com/wp-content/sp-resources/forum-avatars/defaults/moderatordefault.png)
Moderators
February 11, 2020
![sp_UserOfflineSmall](https://forum.prosysopc.com/wp-content/sp-resources/forum-themes/default/images/sp_UserOfflineSmall.png)
Hello,
Yes, it is possible to set value of the DataType Attribute of a Variable Node to null NodeId in the SDK.
If the Variable is UaVariableNode, you can use the setDataTypeId(NodeId) method to set its DataType to null NodeId (which is NodeId.NULL in the SDK). In the MyNodeManager of SampleConsoleServer, you could use that method to set the DataType to null NodeId for MySwitch and/or MyLevel.
If your NodeManager doesn’t use UaNodes, you can configure the readAttribute(NodeId, UnsignedInteger, NumericRange, DateTime) of your IoManager or the onReadNonValue(ServiceContext, NodeId, UaNode, UnsignedInteger, DataValue) method of your IoManagerListener to return null NodeId as the value of DataType for some Variable Node or Nodes. In MyBigNodeManager of SampleConsoleServer, you could modify the onReadNonValue method of the MyBigIoManager to always return null NodeId for the DataType Attribute.
Most Users Ever Online: 518
Currently Online:
14 Guest(s)
Currently Browsing this Page:
1 Guest(s)
Top Posters:
Heikki Tahvanainen: 402
hbrackel: 142
pramanj: 86
rocket science: 85
Francesco Zambon: 83
Ibrahim: 78
Sabari: 62
kapsl: 57
gjevremovic: 49
Xavier: 43
Member Stats:
Guest Posters: 0
Members: 724
Moderators: 7
Admins: 1
Forum Stats:
Groups: 3
Forums: 15
Topics: 1495
Posts: 6352
Newest Members:
armandovarley, dole, rustyhammer, braydenaquino6, blaircleveland0, maribelkeeler7, Nicky, rickymeade2, niamhtoussaint0, adamq0505309Moderators: Jouni Aro: 1017, Pyry: 1, Petri: 0, Bjarne Boström: 1003, Jimmy Ni: 26, Matti Siponen: 337, Lusetti: 0
Administrators: admin: 1