Rules for Explicit Conversion of DataTypes|OPC UA Standard|Forum|OPC Foundation

Avatar
Search
Forum Scope


Match



Forum Options



Minimum search word length is 3 characters - maximum search word length is 84 characters
Lost password?
sp_Feed sp_PrintTopic sp_TopicIcon
Rules for Explicit Conversion of DataTypes
Avatar
Shubhi Gogna Shubhi Gogna
Member
Members
Forum Posts: 27
Member Since:
04/01/2014
sp_UserOfflineSmall Offline
1
12/13/2021 - 05:41
sp_Permalink sp_Print

Hi ,

I wanted to understand the rules for doing the explicit conversion of built-in datatypes i.e. If I want to transfer the data from one node to another node which are having different datatypes ex: A node has Datatype as Int and B node has Datatype as String, so both nodes will show the same value (irrespective of DataTypes) but the datatypes of both nodes will be different.

As per my understanding following types are explicitly convertible to each other : Please correct me If I am wrong.

A's Node DataType B's Node DataType (Allowed Explicitly)
Boolean Boolean, Byte, Uint16,Uint32, UInt64, Double, Float, Sbyte, Int16, Int32, Int64, String, 
Byte Boolean, Byte, Uint16,Uint32, UInt64, Double, Float, Sbyte, Int16, Int32, Int64, String
ByteString ByteString, Guid
DateTime DateTime, String
Double Boolean, Byte, Uint16,Uint32, UInt64, Double, Float, Sbyte, Int16, Int32, Int64, String, 
ExpandedNodeId NodeId, Expanded NodeId, String
Float Boolean, Byte, Uint16,Uint32, UInt64, Double, Float, Sbyte, Int16, Int32, Int64, String, 
Guid ByteString, Guid, String
Int16 Boolean, Byte, Uint16,Uint32, UInt64, Double, Float, Sbyte, Int16, Int32, Int64, String
Int32 Boolean, Byte, Uint16,Uint32, UInt64, Double, Float, Sbyte, Int16, Int32, Int64, String, StatusCode
Int64 Boolean, Byte, Uint16,Uint32, UInt64, Double, Float, Sbyte, Int16, Int32, Int64, String, StatusCode
LocalizedText LocalizedText, String
NodeId NodeId, Expanded NodeId, String
QualifiedName LocalizedText, String, QualifiedNAme
Sbyte Boolean, Byte, Uint16,Uint32, UInt64, Double, Float, Sbyte, Int16, Int32, Int64, String
Uint16 Boolean, Byte, Uint16,Uint32, UInt64, Double, Float, Sbyte, Int16, Int32, Int64, String, StatusCode
Uint32 Boolean, Byte, Uint16,Uint32, UInt64, Double, Float, Sbyte, Int16, Int32, Int64, String, StatusCode
Uint64 Boolean, Byte, Uint16,Uint32, UInt64, Double, Float, Sbyte, Int16, Int32, Int64, String, StatusCode
StatusCode Int32, Int64, StatusCode, Uint16, Uint32, Uint64
String Boolean, Byte, Uint16,Uint32, UInt64, Double, Float, Sbyte, Int16, Int32, Int64, String, StatusCode, DatTime, ExpandedNodeId, Guid, NodeId, LocalizedText, QualifiedName

I wanted to know if LocalizedText to String conversion should be allowed or not? If yes, how should we handle the locale.

Ex: 1) A node of LocalizedText has value "en" , "Test", so B node String type should have value as "Test" or "en, Test" and vice versa

2) A node of Qualified Name has value "0" "Test", so B node String type should have value as "test" or "0,test" and vice versa.

 

Regards,

Shubhi Gogna

Avatar
Randy Armstrong
Admin
Forum Posts: 1438
Member Since:
05/30/2017
sp_UserOfflineSmall Offline
2
12/13/2021 - 17:45
sp_Permalink sp_Print

The table you reference refers to conversions applied when evaluating event filter where clauses. It is not a general requirement for conversions to be supported in all situations. In your case, you are doing conversions within your own server so you can do whatever make sense.

Forum Timezone: America/Phoenix
Most Users Ever Online: 510
Currently Online: Stephen Blake, Giuseppe Mirco
Guest(s) 23
Currently Browsing this Page:
1 Guest(s)
Top Posters:
Forum Stats:
Groups: 2
Forums: 10
Topics: 1341
Posts: 4546