OPC-UA DataType and TypeDefinition
Posted: 18 Mar 2023, 12:53
Very many of the variables in the Unified Automation demo server (.NET SDK) have a HasTypeDefinition of “BaseDataVariableType” and one example is the Demo.Static.Scalar.Boolean varialbe. I believe this use of the HasTypeDefinition is compliant with the specification, but is it typical or best practice? Someone is telling me that all variables with a data type of Boolean should have a HasTypeDefinition of "TwoStateDescreteType" but I cannot confirm this. I can find information about a variable's DataType and about a HasTypeDefintion reference in the specifications and I find information about deriving custom object types, but I cannot find this kind of advice, nor can I find a reference server that claims to be following best practices. My use case is essentially providing an OPC-UA server that shows values that come from an embedded controller that is much like a PLC. I am particularly interested in understanding Integers that have enumerated values (such as 0 means "red" and 1 means "blue" and 2 means "green") and in Booleans with and without associated text for the meaning of True and False. Thank you in advance for any advice or reading material.