advertisement
CHAPTER
5
Data Types
The OPC UA protocol defines 25 builtin data types and three ways of combining them into higher-order types: arrays, structures and unions. In open62541, only the builtin data types are defined manually. All other data types are generated from standard XML definitions. Their exact definitions can be looked up at https://opcfoundation.
org/UA/schemas/Opc.Ua.Types.bsd.xml
.
For users that are new to open62541, take a look at the
tutorial for working with data types
before diving into the implementation details.
5.1 Builtin Types
5.1.1 Boolean
A two-state logical value (true or false).
typedef bool
UA_Boolean;
#define UA_TRUE true
#define UA_FALSE false
5.1.2 SByte
An integer value between -128 and 127.
typedef int8_t
UA_SByte;
#define UA_SBYTE_MIN (-128)
#define UA_SBYTE_MAX 127
5.1.3 Byte
An integer value between 0 and 255.
typedef uint8_t
UA_Byte;
#define UA_BYTE_MIN 0
#define UA_BYTE_MAX 255
35
open62541 Documentation, Release 0.3.0
5.1.4 Int16
An integer value between -32 768 and 32 767.
typedef int16_t
UA_Int16;
#define UA_INT16_MIN (-32768)
#define UA_INT16_MAX 32767
5.1.5 UInt16
An integer value between 0 and 65 535.
typedef uint16_t
UA_UInt16;
#define UA_UINT16_MIN 0
#define UA_UINT16_MAX 65535
5.1.6 Int32
An integer value between -2 147 483 648 and 2 147 483 647.
typedef int32_t
UA_Int32;
#define UA_INT32_MIN (-2147483648)
#define UA_INT32_MAX 2147483647
5.1.7 UInt32
An integer value between 0 and 4 294 967 295.
typedef uint32_t
UA_UInt32;
#define UA_UINT32_MIN 0
#define UA_UINT32_MAX 4294967295
5.1.8 Int64
An integer value between -9 223 372 036 854 775 808 and 9 223 372 036 854 775 807.
typedef int64_t
UA_Int64;
#define UA_INT64_MIN ((int64_t)-9223372036854775808)
#define UA_INT64_MAX (int64_t)9223372036854775807
5.1.9 UInt64
An integer value between 0 and 18 446 744 073 709 551 615.
typedef uint64_t
UA_UInt64;
#define UA_UINT64_MIN (int64_t)0
#define UA_UINT64_MAX (int64_t)18446744073709551615
5.1.10 Float
An IEEE single precision (32 bit) floating point value.
36 Chapter 5. Data Types
open62541 Documentation, Release 0.3.0
typedef float
UA_Float;
5.1.11 Double
An IEEE double precision (64 bit) floating point value.
typedef double
UA_Double;
5.1.12 StatusCode
A numeric identifier for a error or condition that is associated with a value or an operation. See the section
StatusCodes
for the meaning of a specific code.
typedef uint32_t
UA_StatusCode;
/* Returns the human-readable name of the StatusCode. If no matching StatusCode
* is found, a default string for "Unknown" is returned. This feature might be
* disabled to create a smaller binary with the
* UA_ENABLE_STATUSCODE_DESCRIPTIONS build-flag. Then the function returns an
* empty string for every StatusCode. */
const char
*
UA_StatusCode_name (UA_StatusCode code);
5.1.13 String
A sequence of Unicode characters. Strings are just an array of UA_Byte.
typedef struct
{
size_t
length; /* The length of the string */
UA_Byte
* data; /* The content (not null-terminated) */
} UA_String;
/* Copies the content on the heap. Returns a null-string when alloc fails */
UA_String UA_String_fromChars (
char const
src[]);
UA_Boolean UA_String_equal (
const
UA_String
* s1,
const
UA_String
* s2);
extern const
UA_String UA_STRING_NULL;
UA_STRING returns a string pointing to the original char-array. UA_STRING_ALLOC is shorthand for
UA_String_fromChars and makes a copy of the char-array.
static
UA_INLINE UA_String
UA_STRING (
char
* chars) {
UA_String str; str.length
= strlen(chars); str.data
= (UA_Byte
*
)chars;
return
str;
}
#define UA_STRING_ALLOC(CHARS) UA_String_fromChars(CHARS)
5.1.14 DateTime
An instance in time. A DateTime value is encoded as a 64-bit signed integer which represents the number of 100 nanosecond intervals since January 1, 1601 (UTC).
5.1. Builtin Types 37
open62541 Documentation, Release 0.3.0
typedef int64_t
UA_DateTime;
/* Multiply to convert units for time difference computations */
#define UA_USEC_TO_DATETIME 10LL
#define UA_MSEC_TO_DATETIME (UA_USEC_TO_DATETIME * 1000LL)
#define UA_SEC_TO_DATETIME (UA_MSEC_TO_DATETIME * 1000LL)
#define UA_DATETIME_TO_USEC (1/10.0)
#define UA_DATETIME_TO_MSEC (UA_DATETIME_TO_USEC / 1000.0)
#define UA_DATETIME_TO_SEC (UA_DATETIME_TO_MSEC / 1000.0)
/* Datetime of 1 Jan 1970 00:00 UTC */
#define UA_DATETIME_UNIX_EPOCH (11644473600LL * UA_SEC_TO_DATETIME)
/* The current time */
UA_DateTime UA_DateTime_now (
void
);
/* CPU clock invariant to system time changes. Use only for time diffs, not
* current time */
UA_DateTime UA_DateTime_nowMonotonic (
void
);
typedef struct
UA_DateTimeStruct {
UA_UInt16 nanoSec;
UA_UInt16 microSec;
UA_UInt16 milliSec;
UA_UInt16 sec;
UA_UInt16 min;
UA_UInt16 hour;
UA_UInt16 day;
UA_UInt16 month;
UA_UInt16 year;
} UA_DateTimeStruct;
UA_DateTimeStruct UA_DateTime_toStruct (UA_DateTime t);
UA_String UA_DateTime_toString (UA_DateTime t);
5.1.15 Guid
A 16 byte value that can be used as a globally unique identifier.
typedef struct
{
UA_UInt32 data1;
UA_UInt16 data2;
UA_UInt16 data3;
UA_Byte data4[ 8 ];
} UA_Guid;
UA_Boolean UA_Guid_equal (
const
UA_Guid
* g1,
const
UA_Guid
* g2);
extern const
UA_Guid UA_GUID_NULL;
5.1.16 ByteString
A sequence of octets.
typedef
UA_String UA_ByteString;
static
UA_INLINE UA_Boolean
UA_ByteString_equal (
const
UA_ByteString
* string1,
38 Chapter 5. Data Types
open62541 Documentation, Release 0.3.0
const
UA_ByteString
* string2) {
return
UA_String_equal((
const
UA_String
*
)string1,
(
const
UA_String
*
)string2);
}
/* Allocates memory of size length for the bytestring.
* The content is not set to zero. */
UA_StatusCode
UA_ByteString_allocBuffer (UA_ByteString
* bs,
size_t
length);
extern const
UA_ByteString UA_BYTESTRING_NULL;
static
UA_INLINE UA_ByteString
UA_BYTESTRING (
char
* chars) {
UA_ByteString str; str.length
= strlen(chars); str.data
= (UA_Byte
*
)chars;
return
str;
}
static
UA_INLINE UA_ByteString
UA_BYTESTRING_ALLOC (
const char
* chars) {
UA_String str = UA_String_fromChars(chars); UA_ByteString bstr; bstr.length
= str.length; bstr.data
= str.data;
return
bstr;
}
5.1.17 XmlElement
An XML element.
typedef
UA_String UA_XmlElement;
5.1.18 NodeId
An identifier for a node in the address space of an OPC UA Server.
enum
UA_NodeIdType {
UA_NODEIDTYPE_NUMERIC = 0 , /* In the binary encoding, this can also become 1 or 2 (2byte and 4byte encoding of small numeric nodeids) */
= 3 , UA_NODEIDTYPE_STRING
UA_NODEIDTYPE_GUID = 4 ,
UA_NODEIDTYPE_BYTESTRING = 5
};
typedef struct
{
UA_UInt16 namespaceIndex;
enum
UA_NodeIdType identifierType;
union
{
UA_UInt32
UA_String
UA_Guid numeric; string; guid;
UA_ByteString byteString;
} identifier;
} UA_NodeId;
extern const
UA_NodeId UA_NODEID_NULL;
UA_Boolean UA_NodeId_isNull (
const
UA_NodeId
* p);
UA_Boolean UA_NodeId_equal (
const
UA_NodeId
* n1,
const
UA_NodeId
* n2);
5.1. Builtin Types 39
open62541 Documentation, Release 0.3.0
/* Returns a non-cryptographic hash for the NodeId */
UA_UInt32 UA_NodeId_hash (
const
UA_NodeId
* n);
The following functions are shorthand for creating NodeIds.
static
UA_INLINE UA_NodeId
UA_NODEID_NUMERIC (UA_UInt16 nsIndex, UA_UInt32 identifier) {
UA_NodeId id; id.namespaceIndex
= nsIndex; id.identifierType
= UA_NODEIDTYPE_NUMERIC; id.identifier.numeric
= identifier;
return
id;
}
static
UA_INLINE UA_NodeId
UA_NODEID_STRING (UA_UInt16 nsIndex,
char
* chars) {
UA_NodeId id; id.namespaceIndex
= nsIndex; id.identifierType
= UA_NODEIDTYPE_STRING; id.identifier.string
= UA_STRING(chars);
return
id;
}
static
UA_INLINE UA_NodeId
UA_NODEID_STRING_ALLOC (UA_UInt16 nsIndex,
const char
* chars) {
UA_NodeId id; id.namespaceIndex
= nsIndex; id.identifierType
= UA_NODEIDTYPE_STRING; id.identifier.string
= UA_STRING_ALLOC(chars);
return
id;
}
static
UA_INLINE UA_NodeId
UA_NODEID_GUID (UA_UInt16 nsIndex, UA_Guid guid) {
UA_NodeId id; id.namespaceIndex
= nsIndex; id.identifierType
= UA_NODEIDTYPE_GUID; id.identifier.guid
= guid;
return
id;
}
static
UA_INLINE UA_NodeId
UA_NODEID_BYTESTRING (UA_UInt16 nsIndex,
char
* chars) {
UA_NodeId id; id.namespaceIndex
= nsIndex; id.identifierType
= UA_NODEIDTYPE_BYTESTRING; id.identifier.byteString
= UA_BYTESTRING(chars);
return
id;
}
static
UA_INLINE UA_NodeId
UA_NODEID_BYTESTRING_ALLOC (UA_UInt16 nsIndex,
const char
* chars) {
UA_NodeId id; id.namespaceIndex
= nsIndex; id.identifierType
= UA_NODEIDTYPE_BYTESTRING; id.identifier.byteString
= UA_BYTESTRING_ALLOC(chars);
return
id;
}
5.1.19 ExpandedNodeId
A NodeId that allows the namespace URI to be specified instead of an index.
typedef struct
{
UA_NodeId nodeId;
UA_String namespaceUri;
UA_UInt32 serverIndex;
} UA_ExpandedNodeId;
The following functions are shorthand for creating ExpandedNodeIds.
40 Chapter 5. Data Types
open62541 Documentation, Release 0.3.0
static
UA_INLINE UA_ExpandedNodeId
UA_EXPANDEDNODEID_NUMERIC (UA_UInt16 nsIndex, UA_UInt32 identifier) {
UA_ExpandedNodeId id; id.nodeId
= UA_NODEID_NUMERIC(nsIndex, identifier); id.serverIndex
= 0 ; id.namespaceUri
= UA_STRING_NULL;
return
id;
}
static
UA_INLINE UA_ExpandedNodeId
UA_EXPANDEDNODEID_STRING (UA_UInt16 nsIndex,
char
* chars) {
UA_ExpandedNodeId id; id.nodeId
= UA_NODEID_STRING(nsIndex, chars); id.serverIndex
= 0 ; id.namespaceUri
= UA_STRING_NULL;
return
id;
}
static
UA_INLINE UA_ExpandedNodeId
UA_EXPANDEDNODEID_STRING_ALLOC (UA_UInt16 nsIndex,
const char
* chars) {
UA_ExpandedNodeId id; id.nodeId
= UA_NODEID_STRING_ALLOC(nsIndex, chars); id.serverIndex
= 0 ; id.namespaceUri
= UA_STRING_NULL;
return
id;
}
static
UA_INLINE UA_ExpandedNodeId
UA_EXPANDEDNODEID_STRING_GUID (UA_UInt16 nsIndex, UA_Guid guid) {
UA_ExpandedNodeId id; id.nodeId
= UA_NODEID_GUID(nsIndex, guid); id.serverIndex
= 0 ; id.namespaceUri
= UA_STRING_NULL;
return
id;
}
static
UA_INLINE UA_ExpandedNodeId
UA_EXPANDEDNODEID_BYTESTRING (UA_UInt16 nsIndex,
char
* chars) {
UA_ExpandedNodeId id; id.nodeId
= UA_NODEID_BYTESTRING(nsIndex, chars); id.serverIndex
= 0 ; id.namespaceUri
= UA_STRING_NULL;
return
id;
}
static
UA_INLINE UA_ExpandedNodeId
UA_EXPANDEDNODEID_BYTESTRING_ALLOC (UA_UInt16 nsIndex,
const char
* chars) {
UA_ExpandedNodeId id; id.nodeId
= UA_NODEID_BYTESTRING_ALLOC(nsIndex, chars); id.serverIndex
= 0 ; id.namespaceUri
= UA_STRING_NULL;
return
id;
}
5.1.20 QualifiedName
A name qualified by a namespace.
typedef struct
{
UA_UInt16 namespaceIndex;
UA_String name;
} UA_QualifiedName;
static
UA_INLINE UA_Boolean
UA_QualifiedName_isNull (
const
UA_QualifiedName
* q) {
return
(q -> namespaceIndex == 0 && q -> name.length
== 0 );
}
static
UA_INLINE UA_QualifiedName
UA_QUALIFIEDNAME (UA_UInt16 nsIndex,
char
* chars) {
UA_QualifiedName qn; qn.namespaceIndex
= nsIndex; qn.name
= UA_STRING(chars);
return
qn;
}
static
UA_INLINE UA_QualifiedName
UA_QUALIFIEDNAME_ALLOC (UA_UInt16 nsIndex,
const char
* chars) {
UA_QualifiedName qn; qn.namespaceIndex
= nsIndex; qn.name
= UA_STRING_ALLOC(chars);
return
qn;
}
5.1. Builtin Types 41
open62541 Documentation, Release 0.3.0
5.1.21 LocalizedText
Human readable text with an optional locale identifier.
typedef struct
{
UA_String locale;
UA_String text;
} UA_LocalizedText;
static
UA_INLINE UA_LocalizedText
UA_LOCALIZEDTEXT (
char
* locale,
char
* text) {
UA_LocalizedText lt; lt.locale
= UA_STRING(locale); lt.text
= UA_STRING(text);
return
lt;
}
static
UA_INLINE UA_LocalizedText
UA_LOCALIZEDTEXT_ALLOC (
const char
* locale,
const char
* text) {
UA_LocalizedText lt; lt.locale
= UA_STRING_ALLOC(locale); lt.text
= UA_STRING_ALLOC(text);
return
lt;
}
5.1.22 NumericRange
NumericRanges are used to indicate subsets of a (multidimensional) array. They no official data type in the OPC
UA standard and are transmitted only with a string encoding, such as “1:2,0:3,5”. The colon separates min/max index and the comma separates dimensions. A single value indicates a range with a single element (min==max).
typedef struct
{
UA_UInt32 min;
UA_UInt32 max;
} UA_NumericRangeDimension;
typedef struct
{
size_t
dimensionsSize;
UA_NumericRangeDimension
* dimensions;
} UA_NumericRange;
5.1.23 Variant
Variants may contain values of any type together with a description of the content. See the section on
Generic Type
Handling
on how types are described. The standard mandates that variants contain built-in data types only. If the value is not of a builtin type, it is wrapped into an
ExtensionObject
. open62541 hides this wrapping transparently
in the encoding layer. If the data type is unknown to the receiver, the variant contains the original ExtensionObject in binary or XML encoding.
Variants may contain a scalar value or an array. For details on the handling of arrays, see the section on
Array handling
dimension lengths. The actual values are kept in an array of dimensions one. For users who work with higherdimensions arrays directly, keep in mind that dimensions of higher rank are serialized first (the highest rank dimension has stride 1 and elements follow each other directly). Usually it is simplest to interact with higherdimensional arrays via UA_NumericRange descriptions (see
Array handling
To differentiate between scalar / array variants, the following definition is used. UA_Variant_isScalar provides simplified access to these checks.
• arrayLength == 0 && data == NULL: undefined array of length -1
• arrayLength == 0 && data == UA_EMPTY_ARRAY_SENTINEL: array of length 0
• arrayLength == 0 && data > UA_EMPTY_ARRAY_SENTINEL: scalar value
42 Chapter 5. Data Types
open62541 Documentation, Release 0.3.0
• arrayLength > 0: array of the given length
Variants can also be empty. Then, the pointer to the type description is NULL.
/* Forward declaration. See the section on Generic Type Handling */
struct
UA_DataType;
typedef struct
UA_DataType UA_DataType;
#define UA_EMPTY_ARRAY_SENTINEL ((void*)0x01)
typedef enum
{
UA_VARIANT_DATA, /* The data has the same lifecycle as the variant */
UA_VARIANT_DATA_NODELETE /* The data is "borrowed" by the variant and shall not be deleted at the end of the variant's lifecycle. */
} UA_VariantStorageType;
typedef struct
{
const
UA_DataType
* type; /* The data type description */
UA_VariantStorageType storageType;
size_t void
arrayLength;
* data;
/* The number of elements in the data array */
/* Points to the scalar or array data */
size_t
arrayDimensionsSize; /* The number of dimensions */
UA_UInt32
* arrayDimensions; /* The length of each dimension */
} UA_Variant;
/* Returns true if the variant has no value defined (contains neither an array
* nor a scalar value).
*
* @param v The variant
* @return Is the variant empty */
static
UA_INLINE UA_Boolean
UA_Variant_isEmpty (
const
UA_Variant
* v) {
return
v -> type == NULL ;
}
/* Returns true if the variant contains a scalar value. Note that empty variants
* contain an array of length -1 (undefined).
*
* @param v The variant
* @return Does the variant contain a scalar value */
static
UA_INLINE UA_Boolean
UA_Variant_isScalar (
const
UA_Variant
* v) {
return
(v -> arrayLength == 0 && v -> data > UA_EMPTY_ARRAY_SENTINEL);
}
/* Returns true if the variant contains a scalar value of the given type.
*
* @param v The variant
* @param type The data type
* @return Does the variant contain a scalar value of the given type */
static
UA_INLINE UA_Boolean
UA_Variant_hasScalarType (
const
UA_Variant
* v,
const
UA_DataType
* type) {
return
UA_Variant_isScalar(v) && type == v -> type;
}
/* Returns true if the variant contains an array of the given type.
*
* @param v The variant
* @param type The data type
* @return Does the variant contain an array of the given type */
static
UA_INLINE UA_Boolean
UA_Variant_hasArrayType (
const
UA_Variant
* v,
const
UA_DataType
* type) {
5.1. Builtin Types 43
open62541 Documentation, Release 0.3.0
return
( !
UA_Variant_isScalar(v)) && type == v -> type;
}
/* Set the variant to a scalar value that already resides in memory. The value
* takes on the lifecycle of the variant and is deleted with it.
*
* @param v The variant
* @param p A pointer to the value data
* @param type The datatype of the value in question */
void
UA_Variant_setScalar (UA_Variant
* v,
void
* p,
const
UA_DataType
* type);
/* Set the variant to a scalar value that is copied from an existing variable.
* @param v The variant
* @param p A pointer to the value data
* @param type The datatype of the value
* @return Indicates whether the operation succeeded or returns an error code */
UA_StatusCode
UA_Variant_setScalarCopy (UA_Variant
* v,
const void
* p,
const
UA_DataType
* type);
/* Set the variant to an array that already resides in memory. The array takes
* on the lifecycle of the variant and is deleted with it.
*
* @param v The variant
* @param array A pointer to the array data
* @param arraySize The size of the array
* @param type The datatype of the array */
void
UA_Variant_setArray (UA_Variant
* v,
void
* array,
size_t
arraySize,
const
UA_DataType
* type);
/* Set the variant to an array that is copied from an existing array.
*
* @param v The variant
* @param array A pointer to the array data
* @param arraySize The size of the array
* @param type The datatype of the array
* @return Indicates whether the operation succeeded or returns an error code */
UA_StatusCode
UA_Variant_setArrayCopy (UA_Variant
* v,
const void
* array,
size_t
arraySize,
const
UA_DataType
* type);
/* Copy the variant, but use only a subset of the (multidimensional) array into
* a variant. Returns an error code if the variant is not an array or if the
* indicated range does not fit.
*
* @param src The source variant
* @param dst The target variant
* @param range The range of the copied data
* @return Returns UA_STATUSCODE_GOOD or an error code */
UA_StatusCode
UA_Variant_copyRange (
const
UA_Variant
* src, UA_Variant
const
UA_NumericRange range);
* dst,
/* Insert a range of data into an existing variant. The data array can't be
* reused afterwards if it contains types without a fixed size (e.g. strings)
* since the members are moved into the variant and take on its lifecycle.
*
* @param v The variant
* @param dataArray The data array. The type must match the variant
* @param dataArraySize The length of the data array. This is checked to match
44 Chapter 5. Data Types
open62541 Documentation, Release 0.3.0
* the range size.
* @param range The range of where the new data is inserted
* @return Returns UA_STATUSCODE_GOOD or an error code */
UA_StatusCode
UA_Variant_setRange (UA_Variant
* v,
void
* array,
size_t
arraySize,
const
UA_NumericRange range);
/* Deep-copy a range of data into an existing variant.
*
* @param v The variant
* @param dataArray The data array. The type must match the variant
* @param dataArraySize The length of the data array. This is checked to match
* the range size.
* @param range The range of where the new data is inserted
* @return Returns UA_STATUSCODE_GOOD or an error code */
UA_StatusCode
UA_Variant_setRangeCopy (UA_Variant
* v,
const void
* array,
size_t
arraySize,
const
UA_NumericRange range);
5.1.24 ExtensionObject
ExtensionObjects may contain scalars of any data type. Even those that are unknown to the receiver. See the section on
Generic Type Handling
on how types are described. If the received data type is unkown, the encoded string and target NodeId is stored instead of the decoded value.
typedef enum
{
UA_EXTENSIONOBJECT_ENCODED_NOBODY = 0 ,
UA_EXTENSIONOBJECT_ENCODED_BYTESTRING = 1 ,
UA_EXTENSIONOBJECT_ENCODED_XML = 2 ,
UA_EXTENSIONOBJECT_DECODED
UA_EXTENSIONOBJECT_DECODED_NODELETE
= 3 ,
= 4 /* Don't delete the content together with the
ExtensionObject */
} UA_ExtensionObjectEncoding;
typedef struct
{
UA_ExtensionObjectEncoding encoding;
union
{
struct
{
UA_NodeId typeId; /* The nodeid of the datatype */
UA_ByteString body; /* The bytestring of the encoded data */
} encoded;
struct
{
const
UA_DataType
* type;
void
* data;
} decoded;
} content;
} UA_ExtensionObject;
5.1.25 DataValue
A data value with an associated status code and timestamps.
typedef struct
{
UA_Boolean
UA_Boolean
UA_Boolean
UA_Boolean
UA_Boolean
hasValue hasStatus hasSourceTimestamp
: 1 ;
: 1 ;
: 1 ;
hasServerTimestamp
: 1 ;
hasSourcePicoseconds
: 1 ;
5.1. Builtin Types 45
open62541 Documentation, Release 0.3.0
UA_Boolean
hasServerPicoseconds
: 1 ;
UA_Variant value;
UA_StatusCode status;
UA_DateTime sourceTimestamp;
UA_UInt16 sourcePicoseconds;
UA_DateTime serverTimestamp;
UA_UInt16
} UA_DataValue; serverPicoseconds;
5.1.26 DiagnosticInfo
A structure that contains detailed error and diagnostic information associated with a StatusCode.
typedef struct
UA_DiagnosticInfo {
UA_Boolean
UA_Boolean
UA_Boolean
UA_Boolean
UA_Boolean
UA_Boolean
UA_Boolean
UA_Int32
UA_Int32
hasSymbolicId hasNamespaceUri hasLocalizedText hasLocale hasAdditionalInfo
: 1 ;
: 1 ;
: 1 ;
: 1 ;
: 1 ;
hasInnerStatusCode
: 1 ;
hasInnerDiagnosticInfo
: 1 ; symbolicId; namespaceUri;
UA_Int32
UA_Int32 localizedText; locale;
UA_String additionalInfo;
UA_StatusCode innerStatusCode;
struct
UA_DiagnosticInfo
* innerDiagnosticInfo;
} UA_DiagnosticInfo;
5.2 Generic Type Handling
All information about a (builtin/structured) data type is stored in a UA_DataType. The array UA_TYPES contains the description of all standard-defined types. This type description is used for the following generic operations that work on all types:
• void T_init(T *ptr): Initialize the data type. This is synonymous with zeroing out the memory, i.e.
memset(ptr, 0, sizeof(T))
.
• T* T_new(): Allocate and return the memory for the data type. The value is already initialized.
• UA_StatusCode T_copy(const T *src, T *dst): Copy the content of the data type. Returns
UA_STATUSCODE_GOOD or UA_STATUSCODE_BADOUTOFMEMORY.
• void T_deleteMembers(T *ptr): Delete the dynamically allocated content of the data type and perform a T_init to reset the type.
• void T_delete(T *ptr): Delete the content of the data type and the memory for the data type itself.
Specializations, such as UA_Int32_new() are derived from the generic type operations as static inline functions.
typedef struct
{
#ifdef UA_ENABLE_TYPENAMES
const char
* memberName;
#endif
UA_UInt16 memberTypeIndex;
UA_Byte padding;
/* Index of the member in the array of data types */
/* How much padding is there before this member element? For arrays this is the
46 Chapter 5. Data Types
open62541 Documentation, Release 0.3.0
UA_Boolean
isArray
} UA_DataTypeMember; padding before the size_t lenght member.
(No padding between size_t and the following ptr.) */
UA_Boolean
namespaceZero
: 1 ; /* The type of the member is defined in namespace zero. In this implementation, types from custom namespace may contain members from the same namespace or namespace zero only.*/
: 1 ; /* The member is an array */
struct
UA_DataType {
#ifdef UA_ENABLE_TYPENAMES
const char
* typeName;
#endif
UA_NodeId
UA_UInt16
UA_UInt16
UA_Byte
UA_Boolean typeId; memSize; typeIndex; membersSize;
builtin
/* The nodeid of the type */
/* Size of the struct in memory */
/* Index of the type in the datatypetable */
/* How many members does the type have? */
: 1 ; /* The type is "builtin" and has dedicated deand encoding functions */
UA_Boolean
pointerFree
: 1 ; /* The type (and its members) contains no pointers that need to be freed */
UA_Boolean
overlayable
: 1 ; /* The type has the identical memory layout in memory and on the binary stream. */
UA_UInt16 binaryEncodingId; /* NodeId of datatype when encoded as binary */
//UA_UInt16 xmlEncodingId; /* NodeId of datatype when encoded as XML */
UA_DataTypeMember
* members;
};
Builtin data types can be accessed as UA_TYPES[UA_TYPES_XXX], where XXX is the name of the data type.
If only the NodeId of a type is known, use the following method to retrieve the data type description.
/* Returns the data type description for the type's identifier or NULL if no
* matching data type was found. */
const
UA_DataType
*
UA_findDataType (
const
UA_NodeId
* typeId);
The following functions are used for generic handling of data types.
/* Allocates and initializes a variable of type dataType
*
* @param type The datatype description
* @return Returns the memory location of the variable or NULL if no
* memory could be allocated */
void
*
UA_new (
const
UA_DataType
* type);
/* Initializes a variable to default values
*
* @param p The memory location of the variable
* @param type The datatype description */
static
UA_INLINE
void
UA_init (
void
* p,
const
UA_DataType
* type) { memset(p, 0 , type -> memSize);
}
/* Copies the content of two variables. If copying fails (e.g. because no memory
* was available for an array), then dst is emptied and initialized to prevent
* memory leaks.
*
* @param src The memory location of the source variable
* @param dst The memory location of the destination variable
5.2. Generic Type Handling 47
open62541 Documentation, Release 0.3.0
* @param type The datatype description
* @return Indicates whether the operation succeeded or returns an error code */
UA_StatusCode
UA_copy (
const void
* src,
void
* dst,
const
UA_DataType
* type);
/* Deletes the dynamically allocated content of a variable (e.g. resets all
* arrays to undefined arrays). Afterwards, the variable can be safely deleted
* without causing memory leaks. But the variable is not initialized and may
* contain old data that is not memory-relevant.
*
* @param p The memory location of the variable
* @param type The datatype description of the variable */
void
UA_deleteMembers (
void
* p,
const
UA_DataType
* type);
/* Frees a variable and all of its content.
*
* @param p The memory location of the variable
* @param type The datatype description of the variable */
void
UA_delete (
void
* p,
const
UA_DataType
* type);
5.3 Array handling
In OPC UA, arrays can have a length of zero or more with the usual meaning. In addition, arrays can be undefined.
Then, they don’t even have a length. In the binary encoding, this is indicated by an array of length -1.
In open62541 however, we use size_t for array lengths. An undefined array has length 0 and the data pointer is
NULL
. An array of length 0 also has length 0 but a data pointer UA_EMPTY_ARRAY_SENTINEL.
/* Allocates and initializes an array of variables of a specific type
*
* @param size The requested array length
* @param type The datatype description
* @return Returns the memory location of the variable or NULL if no memory could be allocated */
void
*
UA_Array_new (
size_t
size,
const
UA_DataType
* type);
/* Allocates and copies an array
*
* @param src The memory location of the source array
* @param size The size of the array
* @param dst The location of the pointer to the new array
* @param type The datatype of the array members
* @return Returns UA_STATUSCODE_GOOD or UA_STATUSCODE_BADOUTOFMEMORY */
UA_StatusCode
UA_Array_copy (
const void
* src,
size_t
size,
void const
UA_DataType
* type);
** dst,
/* Deletes an array.
*
* @param p The memory location of the array
* @param size The size of the array
* @param type The datatype of the array members */
void
UA_Array_delete (
void
* p,
size_t
size,
const
UA_DataType
* type);
5.4 Random Number Generator
If UA_ENABLE_MULTITHREADING is defined, then the seed is stored in thread local storage. The seed is initialized for every thread in the server/client.
48 Chapter 5. Data Types
open62541 Documentation, Release 0.3.0
void
UA_random_seed (UA_UInt64 seed);
UA_UInt32 UA_UInt32_random (
void
); /* no cryptographic entropy */
UA_Guid UA_Guid_random (
void
); /* no cryptographic entropy */
5.5 Generated Data Type Definitions
The following data types were auto-generated from a definition in XML format.
Every type is assigned an index in an array containing the type descriptions. These descriptions are used during type handling (copying, deletion, binary encoding, . . . ).
#define UA_TYPES_COUNT 181
extern const
UA_DataType UA_TYPES[UA_TYPES_COUNT];
5.5.1 Boolean
#define UA_TYPES_BOOLEAN 0
5.5.2 SByte
#define UA_TYPES_SBYTE 1
5.5.3 Byte
#define UA_TYPES_BYTE 2
5.5.4 Int16
#define UA_TYPES_INT16 3
5.5.5 UInt16
#define UA_TYPES_UINT16 4
5.5.6 Int32
#define UA_TYPES_INT32 5
5.5.7 UInt32
#define UA_TYPES_UINT32 6
5.5. Generated Data Type Definitions 49
open62541 Documentation, Release 0.3.0
5.5.8 Int64
#define UA_TYPES_INT64 7
5.5.9 UInt64
#define UA_TYPES_UINT64 8
5.5.10 Float
#define UA_TYPES_FLOAT 9
5.5.11 Double
#define UA_TYPES_DOUBLE 10
5.5.12 String
#define UA_TYPES_STRING 11
5.5.13 DateTime
#define UA_TYPES_DATETIME 12
5.5.14 Guid
#define UA_TYPES_GUID 13
5.5.15 ByteString
#define UA_TYPES_BYTESTRING 14
5.5.16 XmlElement
#define UA_TYPES_XMLELEMENT 15
5.5.17 NodeId
#define UA_TYPES_NODEID 16
50 Chapter 5. Data Types
5.5.18 ExpandedNodeId
#define UA_TYPES_EXPANDEDNODEID 17
5.5.19 StatusCode
#define UA_TYPES_STATUSCODE 18
5.5.20 QualifiedName
#define UA_TYPES_QUALIFIEDNAME 19
5.5.21 LocalizedText
#define UA_TYPES_LOCALIZEDTEXT 20
5.5.22 ExtensionObject
#define UA_TYPES_EXTENSIONOBJECT 21
5.5.23 DataValue
#define UA_TYPES_DATAVALUE 22
5.5.24 Variant
#define UA_TYPES_VARIANT 23
5.5.25 DiagnosticInfo
#define UA_TYPES_DIAGNOSTICINFO 24
5.5.26 SignedSoftwareCertificate
A software certificate with a digital signature.
typedef struct
{
UA_ByteString certificateData;
UA_ByteString signature;
} UA_SignedSoftwareCertificate;
#define UA_TYPES_SIGNEDSOFTWARECERTIFICATE 25
open62541 Documentation, Release 0.3.0
5.5. Generated Data Type Definitions 51
open62541 Documentation, Release 0.3.0
5.5.27 StatusChangeNotification typedef struct
{
UA_StatusCode status;
UA_DiagnosticInfo diagnosticInfo;
} UA_StatusChangeNotification;
#define UA_TYPES_STATUSCHANGENOTIFICATION 26
5.5.28 BrowsePathTarget
The target of the translated path.
typedef struct
{
UA_ExpandedNodeId targetId;
UA_UInt32 remainingPathIndex;
} UA_BrowsePathTarget;
#define UA_TYPES_BROWSEPATHTARGET 27
5.5.29 ViewAttributes
The attributes for a view node.
typedef struct
{
UA_UInt32 specifiedAttributes;
UA_LocalizedText displayName;
UA_LocalizedText description;
UA_UInt32 writeMask;
UA_UInt32 userWriteMask;
UA_Boolean containsNoLoops;
UA_Byte eventNotifier;
} UA_ViewAttributes;
#define UA_TYPES_VIEWATTRIBUTES 28
5.5.30 BrowseResultMask
A bit mask which specifies what should be returned in a browse response.
typedef enum
{
UA_BROWSERESULTMASK_NONE = 0 ,
UA_BROWSERESULTMASK_REFERENCETYPEID = 1 ,
UA_BROWSERESULTMASK_ISFORWARD = 2 ,
UA_BROWSERESULTMASK_NODECLASS = 4 ,
UA_BROWSERESULTMASK_BROWSENAME = 8 ,
UA_BROWSERESULTMASK_DISPLAYNAME = 16 ,
UA_BROWSERESULTMASK_TYPEDEFINITION = 32 ,
UA_BROWSERESULTMASK_ALL = 63 ,
UA_BROWSERESULTMASK_REFERENCETYPEINFO = 3 ,
UA_BROWSERESULTMASK_TARGETINFO = 60
} UA_BrowseResultMask;
#define UA_TYPES_BROWSERESULTMASK 29
52 Chapter 5. Data Types
5.5.31 RequestHeader
The header passed with every server request.
typedef struct
{
UA_NodeId authenticationToken;
UA_DateTime timestamp;
UA_UInt32 requestHandle;
UA_UInt32 returnDiagnostics;
UA_String auditEntryId;
UA_UInt32 timeoutHint;
UA_ExtensionObject additionalHeader;
} UA_RequestHeader;
#define UA_TYPES_REQUESTHEADER 30
5.5.32 MonitoredItemModifyResult typedef struct
{
UA_StatusCode statusCode;
UA_Double revisedSamplingInterval;
UA_UInt32 revisedQueueSize;
UA_ExtensionObject filterResult;
} UA_MonitoredItemModifyResult;
#define UA_TYPES_MONITOREDITEMMODIFYRESULT 31
5.5.33 CloseSecureChannelRequest
Closes a secure channel.
typedef struct
{
UA_RequestHeader requestHeader;
} UA_CloseSecureChannelRequest;
#define UA_TYPES_CLOSESECURECHANNELREQUEST 32
5.5.34 AddNodesResult
A result of an add node operation.
typedef struct
{
UA_StatusCode statusCode;
UA_NodeId addedNodeId;
} UA_AddNodesResult;
#define UA_TYPES_ADDNODESRESULT 33
5.5.35 VariableAttributes
The attributes for a variable node.
typedef struct
{
UA_UInt32 specifiedAttributes;
UA_LocalizedText displayName;
UA_LocalizedText description;
5.5. Generated Data Type Definitions open62541 Documentation, Release 0.3.0
53
open62541 Documentation, Release 0.3.0
UA_UInt32 writeMask;
UA_UInt32 userWriteMask;
UA_Variant value;
UA_NodeId dataType;
UA_Int32 valueRank;
size_t
arrayDimensionsSize;
UA_UInt32
* arrayDimensions;
UA_Byte accessLevel;
UA_Byte userAccessLevel;
UA_Double minimumSamplingInterval;
UA_Boolean historizing;
} UA_VariableAttributes;
#define UA_TYPES_VARIABLEATTRIBUTES 34
5.5.36 NotificationMessage typedef struct
{
UA_UInt32 sequenceNumber;
UA_DateTime publishTime;
size_t
notificationDataSize;
UA_ExtensionObject
* notificationData;
} UA_NotificationMessage;
#define UA_TYPES_NOTIFICATIONMESSAGE 35
5.5.37 FindServersOnNetworkRequest typedef struct
{
UA_RequestHeader requestHeader;
UA_UInt32 startingRecordId;
UA_UInt32 maxRecordsToReturn;
size_t
serverCapabilityFilterSize;
UA_String
* serverCapabilityFilter;
} UA_FindServersOnNetworkRequest;
#define UA_TYPES_FINDSERVERSONNETWORKREQUEST 36
5.5.38 EventFieldList typedef struct
{
UA_UInt32 clientHandle;
size_t
eventFieldsSize;
UA_Variant
* eventFields;
} UA_EventFieldList;
#define UA_TYPES_EVENTFIELDLIST 37
5.5.39 NodeAttributesMask
The bits used to specify default attributes for a new node.
typedef enum
{
UA_NODEATTRIBUTESMASK_NONE = 0 ,
UA_NODEATTRIBUTESMASK_ACCESSLEVEL = 1 ,
54 Chapter 5. Data Types
open62541 Documentation, Release 0.3.0
UA_NODEATTRIBUTESMASK_ARRAYDIMENSIONS = 2 ,
UA_NODEATTRIBUTESMASK_BROWSENAME = 4 ,
UA_NODEATTRIBUTESMASK_CONTAINSNOLOOPS = 8 ,
UA_NODEATTRIBUTESMASK_DATATYPE = 16 ,
UA_NODEATTRIBUTESMASK_DESCRIPTION = 32 ,
UA_NODEATTRIBUTESMASK_DISPLAYNAME = 64 ,
UA_NODEATTRIBUTESMASK_EVENTNOTIFIER = 128 ,
UA_NODEATTRIBUTESMASK_EXECUTABLE = 256 ,
UA_NODEATTRIBUTESMASK_HISTORIZING = 512 ,
UA_NODEATTRIBUTESMASK_INVERSENAME = 1024 ,
UA_NODEATTRIBUTESMASK_ISABSTRACT = 2048 ,
UA_NODEATTRIBUTESMASK_MINIMUMSAMPLINGINTERVAL = 4096 ,
UA_NODEATTRIBUTESMASK_NODECLASS = 8192 ,
UA_NODEATTRIBUTESMASK_NODEID = 16384 ,
UA_NODEATTRIBUTESMASK_SYMMETRIC = 32768 ,
UA_NODEATTRIBUTESMASK_USERACCESSLEVEL = 65536 ,
UA_NODEATTRIBUTESMASK_USEREXECUTABLE = 131072 ,
UA_NODEATTRIBUTESMASK_USERWRITEMASK = 262144 ,
UA_NODEATTRIBUTESMASK_VALUERANK = 524288 ,
UA_NODEATTRIBUTESMASK_WRITEMASK = 1048576 ,
UA_NODEATTRIBUTESMASK_VALUE = 2097152 ,
UA_NODEATTRIBUTESMASK_ALL = 4194303 ,
UA_NODEATTRIBUTESMASK_BASENODE = 1335396 ,
UA_NODEATTRIBUTESMASK_OBJECT = 1335524 ,
UA_NODEATTRIBUTESMASK_OBJECTTYPEORDATATYPE = 1337444 ,
UA_NODEATTRIBUTESMASK_VARIABLE = 4026999 ,
UA_NODEATTRIBUTESMASK_VARIABLETYPE = 3958902 ,
UA_NODEATTRIBUTESMASK_METHOD = 1466724 ,
UA_NODEATTRIBUTESMASK_REFERENCETYPE = 1371236 ,
UA_NODEATTRIBUTESMASK_VIEW = 1335532
} UA_NodeAttributesMask;
#define UA_TYPES_NODEATTRIBUTESMASK 38
5.5.40 MonitoringMode typedef enum
{
UA_MONITORINGMODE_DISABLED = 0 ,
UA_MONITORINGMODE_SAMPLING = 1 ,
UA_MONITORINGMODE_REPORTING = 2
} UA_MonitoringMode;
#define UA_TYPES_MONITORINGMODE 39
5.5.41 MdnsDiscoveryConfiguration
The discovery information needed for mDNS registration.
typedef struct
{
UA_String mdnsServerName;
size_t
serverCapabilitiesSize;
UA_String
* serverCapabilities;
} UA_MdnsDiscoveryConfiguration;
#define UA_TYPES_MDNSDISCOVERYCONFIGURATION 40
5.5. Generated Data Type Definitions 55
open62541 Documentation, Release 0.3.0
5.5.42 CallMethodResult typedef struct
{
UA_StatusCode statusCode;
size_t
inputArgumentResultsSize;
UA_StatusCode
* inputArgumentResults;
size_t
inputArgumentDiagnosticInfosSize;
UA_DiagnosticInfo
* inputArgumentDiagnosticInfos;
size_t
outputArgumentsSize;
UA_Variant
* outputArguments;
} UA_CallMethodResult;
#define UA_TYPES_CALLMETHODRESULT 41
5.5.43 ParsingResult typedef struct
{
UA_StatusCode statusCode;
size_t
dataStatusCodesSize;
UA_StatusCode
* dataStatusCodes;
size_t
dataDiagnosticInfosSize;
UA_DiagnosticInfo
* dataDiagnosticInfos;
} UA_ParsingResult;
#define UA_TYPES_PARSINGRESULT 42
5.5.44 RelativePathElement
An element in a relative path.
typedef struct
{
UA_NodeId referenceTypeId;
UA_Boolean isInverse;
UA_Boolean includeSubtypes;
UA_QualifiedName targetName;
} UA_RelativePathElement;
#define UA_TYPES_RELATIVEPATHELEMENT 43
5.5.45 BrowseDirection
The directions of the references to return.
typedef enum
{
UA_BROWSEDIRECTION_FORWARD = 0 ,
UA_BROWSEDIRECTION_INVERSE = 1 ,
UA_BROWSEDIRECTION_BOTH = 2 ,
UA_BROWSEDIRECTION_INVALID = 3
} UA_BrowseDirection;
#define UA_TYPES_BROWSEDIRECTION 44
56 Chapter 5. Data Types
5.5.46 CallMethodRequest typedef struct
{
UA_NodeId objectId;
UA_NodeId methodId;
size_t
inputArgumentsSize;
UA_Variant
* inputArguments;
} UA_CallMethodRequest;
#define UA_TYPES_CALLMETHODREQUEST 45
5.5.47 EventNotificationList typedef struct
{
size_t
eventsSize;
UA_EventFieldList
* events;
} UA_EventNotificationList;
#define UA_TYPES_EVENTNOTIFICATIONLIST 46
5.5.48 UnregisterNodesRequest
Unregisters one or more previously registered nodes.
typedef struct
{
UA_RequestHeader requestHeader;
size_t
nodesToUnregisterSize;
UA_NodeId
* nodesToUnregister;
} UA_UnregisterNodesRequest;
#define UA_TYPES_UNREGISTERNODESREQUEST 47
5.5.49 ContentFilterElementResult typedef struct
{
UA_StatusCode statusCode;
size_t
operandStatusCodesSize;
UA_StatusCode
* operandStatusCodes;
size_t
operandDiagnosticInfosSize;
UA_DiagnosticInfo
* operandDiagnosticInfos;
} UA_ContentFilterElementResult;
#define UA_TYPES_CONTENTFILTERELEMENTRESULT 48
5.5.50 SimpleAttributeOperand typedef struct
{
UA_NodeId typeDefinitionId;
size_t
browsePathSize;
UA_QualifiedName
* browsePath;
UA_UInt32 attributeId;
UA_String indexRange;
} UA_SimpleAttributeOperand;
#define UA_TYPES_SIMPLEATTRIBUTEOPERAND 49
5.5. Generated Data Type Definitions open62541 Documentation, Release 0.3.0
57
open62541 Documentation, Release 0.3.0
5.5.51 QueryDataSet typedef struct
{
UA_ExpandedNodeId nodeId;
UA_ExpandedNodeId typeDefinitionNode;
size_t
valuesSize;
UA_Variant
* values;
} UA_QueryDataSet;
#define UA_TYPES_QUERYDATASET 50
5.5.52 AnonymousIdentityToken
A token representing an anonymous user.
typedef struct
{
UA_String policyId;
} UA_AnonymousIdentityToken;
#define UA_TYPES_ANONYMOUSIDENTITYTOKEN 51
5.5.53 SetPublishingModeRequest typedef struct
{
UA_RequestHeader requestHeader;
UA_Boolean publishingEnabled;
size_t
subscriptionIdsSize;
UA_UInt32
* subscriptionIds;
} UA_SetPublishingModeRequest;
#define UA_TYPES_SETPUBLISHINGMODEREQUEST 52
5.5.54 TimestampsToReturn typedef enum
{
UA_TIMESTAMPSTORETURN_SOURCE = 0 ,
UA_TIMESTAMPSTORETURN_SERVER = 1 ,
UA_TIMESTAMPSTORETURN_BOTH = 2 ,
UA_TIMESTAMPSTORETURN_NEITHER = 3 ,
UA_TIMESTAMPSTORETURN_INVALID = 4
} UA_TimestampsToReturn;
#define UA_TYPES_TIMESTAMPSTORETURN 53
5.5.55 MonitoringFilter typedef void
*
UA_MonitoringFilter;
#define UA_TYPES_MONITORINGFILTER 54
58 Chapter 5. Data Types
5.5.56 CallRequest typedef struct
{
UA_RequestHeader requestHeader;
size_t
methodsToCallSize;
UA_CallMethodRequest
* methodsToCall;
} UA_CallRequest;
#define UA_TYPES_CALLREQUEST 55
5.5.57 MethodAttributes
The attributes for a method node.
typedef struct
{
UA_UInt32 specifiedAttributes;
UA_LocalizedText displayName;
UA_LocalizedText description;
UA_UInt32 writeMask;
UA_UInt32 userWriteMask;
UA_Boolean executable;
UA_Boolean userExecutable;
} UA_MethodAttributes;
#define UA_TYPES_METHODATTRIBUTES 56
5.5.58 DeleteReferencesItem
A request to delete a node from the server address space.
typedef struct
{
UA_NodeId sourceNodeId;
UA_NodeId referenceTypeId;
UA_Boolean isForward;
UA_ExpandedNodeId targetNodeId;
UA_Boolean deleteBidirectional;
} UA_DeleteReferencesItem;
#define UA_TYPES_DELETEREFERENCESITEM 57
5.5.59 WriteValue typedef struct
{
UA_NodeId nodeId;
UA_UInt32 attributeId;
UA_String indexRange;
UA_DataValue value;
} UA_WriteValue;
#define UA_TYPES_WRITEVALUE 58
5.5.60 MonitoredItemCreateResult open62541 Documentation, Release 0.3.0
5.5. Generated Data Type Definitions 59
open62541 Documentation, Release 0.3.0
typedef struct
{
UA_StatusCode statusCode;
UA_UInt32 monitoredItemId;
UA_Double revisedSamplingInterval;
UA_UInt32 revisedQueueSize;
UA_ExtensionObject filterResult;
} UA_MonitoredItemCreateResult;
#define UA_TYPES_MONITOREDITEMCREATERESULT 59
5.5.61 MessageSecurityMode
The type of security to use on a message.
typedef enum
{
UA_MESSAGESECURITYMODE_INVALID = 0 ,
UA_MESSAGESECURITYMODE_NONE = 1 ,
UA_MESSAGESECURITYMODE_SIGN = 2 ,
UA_MESSAGESECURITYMODE_SIGNANDENCRYPT = 3
} UA_MessageSecurityMode;
#define UA_TYPES_MESSAGESECURITYMODE 60
5.5.62 MonitoringParameters typedef struct
{
UA_UInt32 clientHandle;
UA_Double samplingInterval;
UA_ExtensionObject filter;
UA_UInt32 queueSize;
UA_Boolean discardOldest;
} UA_MonitoringParameters;
#define UA_TYPES_MONITORINGPARAMETERS 61
5.5.63 SignatureData
A digital signature.
typedef struct
{
UA_String algorithm;
UA_ByteString signature;
} UA_SignatureData;
#define UA_TYPES_SIGNATUREDATA 62
5.5.64 ReferenceNode
Specifies a reference which belongs to a node.
typedef struct
{
UA_NodeId referenceTypeId;
UA_Boolean isInverse;
UA_ExpandedNodeId targetId;
} UA_ReferenceNode;
60 Chapter 5. Data Types
#define UA_TYPES_REFERENCENODE 63
5.5.65 Argument
An argument for a method.
typedef struct
{
UA_String name;
UA_NodeId dataType;
UA_Int32 valueRank;
size_t
arrayDimensionsSize;
UA_UInt32
* arrayDimensions;
UA_LocalizedText description;
} UA_Argument;
#define UA_TYPES_ARGUMENT 64
5.5.66 UserIdentityToken
A base type for a user identity token.
typedef struct
{
UA_String policyId;
} UA_UserIdentityToken;
#define UA_TYPES_USERIDENTITYTOKEN 65
5.5.67 ObjectTypeAttributes
The attributes for an object type node.
typedef struct
{
UA_UInt32 specifiedAttributes;
UA_LocalizedText displayName;
UA_LocalizedText description;
UA_UInt32 writeMask;
UA_UInt32 userWriteMask;
UA_Boolean isAbstract;
} UA_ObjectTypeAttributes;
#define UA_TYPES_OBJECTTYPEATTRIBUTES 66
5.5.68 DeadbandType typedef enum
{
UA_DEADBANDTYPE_NONE = 0 ,
UA_DEADBANDTYPE_ABSOLUTE = 1 ,
UA_DEADBANDTYPE_PERCENT = 2
} UA_DeadbandType;
#define UA_TYPES_DEADBANDTYPE 67
5.5. Generated Data Type Definitions open62541 Documentation, Release 0.3.0
61
open62541 Documentation, Release 0.3.0
5.5.69 SecurityTokenRequestType
Indicates whether a token if being created or renewed.
typedef enum
{
UA_SECURITYTOKENREQUESTTYPE_ISSUE = 0 ,
UA_SECURITYTOKENREQUESTTYPE_RENEW = 1
} UA_SecurityTokenRequestType;
#define UA_TYPES_SECURITYTOKENREQUESTTYPE 68
5.5.70 DataChangeTrigger typedef enum
{
UA_DATACHANGETRIGGER_STATUS = 0 ,
UA_DATACHANGETRIGGER_STATUSVALUE = 1 ,
UA_DATACHANGETRIGGER_STATUSVALUETIMESTAMP = 2
} UA_DataChangeTrigger;
#define UA_TYPES_DATACHANGETRIGGER 69
5.5.71 BuildInfo typedef struct
{
UA_String productUri;
UA_String manufacturerName;
UA_String productName;
UA_String softwareVersion;
UA_String buildNumber;
UA_DateTime buildDate;
} UA_BuildInfo;
#define UA_TYPES_BUILDINFO 70
5.5.72 NodeClass
A mask specifying the class of the node.
typedef enum
{
UA_NODECLASS_UNSPECIFIED = 0 ,
UA_NODECLASS_OBJECT = 1 ,
UA_NODECLASS_VARIABLE = 2 ,
UA_NODECLASS_METHOD = 4 ,
UA_NODECLASS_OBJECTTYPE = 8 ,
UA_NODECLASS_VARIABLETYPE = 16 ,
UA_NODECLASS_REFERENCETYPE = 32 ,
UA_NODECLASS_DATATYPE = 64 ,
UA_NODECLASS_VIEW = 128
} UA_NodeClass;
#define UA_TYPES_NODECLASS 71
62 Chapter 5. Data Types
open62541 Documentation, Release 0.3.0
5.5.73 FilterOperand typedef void
*
UA_FilterOperand;
#define UA_TYPES_FILTEROPERAND 72
5.5.74 ChannelSecurityToken
The token that identifies a set of keys for an active secure channel.
typedef struct
{
UA_UInt32 channelId;
UA_UInt32 tokenId;
UA_DateTime createdAt;
UA_UInt32 revisedLifetime;
} UA_ChannelSecurityToken;
#define UA_TYPES_CHANNELSECURITYTOKEN 73
5.5.75 MonitoredItemNotification typedef struct
{
UA_UInt32 clientHandle;
UA_DataValue value;
} UA_MonitoredItemNotification;
#define UA_TYPES_MONITOREDITEMNOTIFICATION 74
5.5.76 DeleteNodesItem
A request to delete a node to the server address space.
typedef struct
{
UA_NodeId nodeId;
UA_Boolean deleteTargetReferences;
} UA_DeleteNodesItem;
#define UA_TYPES_DELETENODESITEM 75
5.5.77 SubscriptionAcknowledgement typedef struct
{
UA_UInt32 subscriptionId;
UA_UInt32 sequenceNumber;
} UA_SubscriptionAcknowledgement;
#define UA_TYPES_SUBSCRIPTIONACKNOWLEDGEMENT 76
5.5.78 ReadValueId typedef struct
{
UA_NodeId nodeId;
UA_UInt32 attributeId;
5.5. Generated Data Type Definitions 63
open62541 Documentation, Release 0.3.0
UA_String indexRange;
UA_QualifiedName dataEncoding;
} UA_ReadValueId;
#define UA_TYPES_READVALUEID 77
5.5.79 DataTypeAttributes
The attributes for a data type node.
typedef struct
{
UA_UInt32 specifiedAttributes;
UA_LocalizedText displayName;
UA_LocalizedText description;
UA_UInt32 writeMask;
UA_UInt32 userWriteMask;
UA_Boolean isAbstract;
} UA_DataTypeAttributes;
#define UA_TYPES_DATATYPEATTRIBUTES 78
5.5.80 ResponseHeader
The header passed with every server response.
typedef struct
{
UA_DateTime timestamp;
UA_UInt32 requestHandle;
UA_StatusCode serviceResult;
UA_DiagnosticInfo serviceDiagnostics;
size_t
stringTableSize;
UA_String
* stringTable;
UA_ExtensionObject additionalHeader;
} UA_ResponseHeader;
#define UA_TYPES_RESPONSEHEADER 79
5.5.81 DeleteSubscriptionsRequest typedef struct
{
UA_RequestHeader requestHeader;
size_t
subscriptionIdsSize;
UA_UInt32
* subscriptionIds;
} UA_DeleteSubscriptionsRequest;
#define UA_TYPES_DELETESUBSCRIPTIONSREQUEST 80
5.5.82 ViewDescription
The view to browse.
typedef struct
{
UA_NodeId viewId;
UA_DateTime timestamp;
UA_UInt32 viewVersion;
64 Chapter 5. Data Types
} UA_ViewDescription;
#define UA_TYPES_VIEWDESCRIPTION 81
5.5.83 ServerOnNetwork typedef struct
{
UA_UInt32 recordId;
UA_String serverName;
UA_String discoveryUrl;
size_t
serverCapabilitiesSize;
UA_String
* serverCapabilities;
} UA_ServerOnNetwork;
#define UA_TYPES_SERVERONNETWORK 82
5.5.84 DeleteMonitoredItemsResponse typedef struct
{
UA_ResponseHeader responseHeader;
size_t
resultsSize;
UA_StatusCode
* results;
size_t
diagnosticInfosSize;
UA_DiagnosticInfo
* diagnosticInfos;
} UA_DeleteMonitoredItemsResponse;
#define UA_TYPES_DELETEMONITOREDITEMSRESPONSE 83
5.5.85 FindServersOnNetworkResponse typedef struct
{
UA_ResponseHeader responseHeader;
UA_DateTime lastCounterResetTime;
size_t
serversSize;
UA_ServerOnNetwork
* servers;
} UA_FindServersOnNetworkResponse;
#define UA_TYPES_FINDSERVERSONNETWORKRESPONSE 84
5.5.86 NodeAttributes
The base attributes for all nodes.
typedef struct
{
UA_UInt32 specifiedAttributes;
UA_LocalizedText displayName;
UA_LocalizedText description;
UA_UInt32 writeMask;
UA_UInt32 userWriteMask;
} UA_NodeAttributes;
#define UA_TYPES_NODEATTRIBUTES 85
open62541 Documentation, Release 0.3.0
5.5. Generated Data Type Definitions 65
open62541 Documentation, Release 0.3.0
5.5.87 RegisterNodesRequest
Registers one or more nodes for repeated use within a session.
typedef struct
{
UA_RequestHeader requestHeader;
size_t
nodesToRegisterSize;
UA_NodeId
* nodesToRegister;
} UA_RegisterNodesRequest;
#define UA_TYPES_REGISTERNODESREQUEST 86
5.5.88 DeleteNodesRequest
Delete one or more nodes from the server address space.
typedef struct
{
UA_RequestHeader requestHeader;
size_t
nodesToDeleteSize;
UA_DeleteNodesItem
* nodesToDelete;
} UA_DeleteNodesRequest;
#define UA_TYPES_DELETENODESREQUEST 87
5.5.89 PublishResponse typedef struct
{
UA_ResponseHeader responseHeader;
UA_UInt32 subscriptionId;
size_t
availableSequenceNumbersSize;
UA_UInt32
* availableSequenceNumbers;
UA_Boolean moreNotifications;
UA_NotificationMessage notificationMessage;
size_t
resultsSize;
UA_StatusCode
* results;
size_t
diagnosticInfosSize;
UA_DiagnosticInfo
* diagnosticInfos;
} UA_PublishResponse;
#define UA_TYPES_PUBLISHRESPONSE 88
5.5.90 MonitoredItemModifyRequest typedef struct
{
UA_UInt32 monitoredItemId;
UA_MonitoringParameters requestedParameters;
} UA_MonitoredItemModifyRequest;
#define UA_TYPES_MONITOREDITEMMODIFYREQUEST 89
5.5.91 UserNameIdentityToken
A token representing a user identified by a user name and password.
66 Chapter 5. Data Types
open62541 Documentation, Release 0.3.0
typedef struct
{
UA_String policyId;
UA_String userName;
UA_ByteString password;
UA_String encryptionAlgorithm;
} UA_UserNameIdentityToken;
#define UA_TYPES_USERNAMEIDENTITYTOKEN 90
5.5.92 IdType
The type of identifier used in a node id.
typedef enum
{
UA_IDTYPE_NUMERIC = 0 ,
UA_IDTYPE_STRING = 1 ,
UA_IDTYPE_GUID = 2 ,
UA_IDTYPE_OPAQUE = 3
} UA_IdType;
#define UA_TYPES_IDTYPE 91
5.5.93 UserTokenType
The possible user token types.
typedef enum
{
UA_USERTOKENTYPE_ANONYMOUS = 0 ,
UA_USERTOKENTYPE_USERNAME = 1 ,
UA_USERTOKENTYPE_CERTIFICATE = 2 ,
UA_USERTOKENTYPE_ISSUEDTOKEN = 3
} UA_UserTokenType;
#define UA_TYPES_USERTOKENTYPE 92
5.5.94 ActivateSessionRequest
Activates a session with the server.
typedef struct
{
UA_RequestHeader requestHeader;
UA_SignatureData clientSignature;
size_t
clientSoftwareCertificatesSize;
UA_SignedSoftwareCertificate
* clientSoftwareCertificates;
size_t
localeIdsSize;
UA_String
* localeIds;
UA_ExtensionObject userIdentityToken;
UA_SignatureData userTokenSignature;
} UA_ActivateSessionRequest;
#define UA_TYPES_ACTIVATESESSIONREQUEST 93
5.5.95 OpenSecureChannelResponse
Creates a secure channel with a server.
5.5. Generated Data Type Definitions 67
open62541 Documentation, Release 0.3.0
typedef struct
{
UA_ResponseHeader responseHeader;
UA_UInt32 serverProtocolVersion;
UA_ChannelSecurityToken securityToken;
UA_ByteString serverNonce;
} UA_OpenSecureChannelResponse;
#define UA_TYPES_OPENSECURECHANNELRESPONSE 94
5.5.96 ApplicationType
The types of applications.
typedef enum
{
UA_APPLICATIONTYPE_SERVER = 0 ,
UA_APPLICATIONTYPE_CLIENT = 1 ,
UA_APPLICATIONTYPE_CLIENTANDSERVER = 2 ,
UA_APPLICATIONTYPE_DISCOVERYSERVER = 3
} UA_ApplicationType;
#define UA_TYPES_APPLICATIONTYPE 95
5.5.97 ServerState typedef enum
{
UA_SERVERSTATE_RUNNING = 0 ,
UA_SERVERSTATE_FAILED = 1 ,
UA_SERVERSTATE_NOCONFIGURATION = 2 ,
UA_SERVERSTATE_SUSPENDED = 3 ,
UA_SERVERSTATE_SHUTDOWN = 4 ,
UA_SERVERSTATE_TEST = 5 ,
UA_SERVERSTATE_COMMUNICATIONFAULT = 6 ,
UA_SERVERSTATE_UNKNOWN = 7
} UA_ServerState;
#define UA_TYPES_SERVERSTATE 96
5.5.98 QueryNextResponse typedef struct
{
UA_ResponseHeader responseHeader;
size_t
queryDataSetsSize;
UA_QueryDataSet
* queryDataSets;
UA_ByteString revisedContinuationPoint;
} UA_QueryNextResponse;
#define UA_TYPES_QUERYNEXTRESPONSE 97
5.5.99 DiscoveryConfiguration
A base type for discovery configuration information.
typedef void
*
UA_DiscoveryConfiguration;
#define UA_TYPES_DISCOVERYCONFIGURATION 98
68 Chapter 5. Data Types
5.5.100 ActivateSessionResponse
Activates a session with the server.
typedef struct
{
UA_ResponseHeader responseHeader;
UA_ByteString serverNonce;
size_t
resultsSize;
UA_StatusCode
* results;
size_t
diagnosticInfosSize;
UA_DiagnosticInfo
* diagnosticInfos;
} UA_ActivateSessionResponse;
#define UA_TYPES_ACTIVATESESSIONRESPONSE 99
5.5.101 FilterOperator typedef enum
{
UA_FILTEROPERATOR_EQUALS = 0 ,
UA_FILTEROPERATOR_ISNULL = 1 ,
UA_FILTEROPERATOR_GREATERTHAN = 2 ,
UA_FILTEROPERATOR_LESSTHAN = 3 ,
UA_FILTEROPERATOR_GREATERTHANOREQUAL = 4 ,
UA_FILTEROPERATOR_LESSTHANOREQUAL = 5 ,
UA_FILTEROPERATOR_LIKE = 6 ,
UA_FILTEROPERATOR_NOT = 7 ,
UA_FILTEROPERATOR_BETWEEN = 8 ,
UA_FILTEROPERATOR_INLIST = 9 ,
UA_FILTEROPERATOR_AND = 10 ,
UA_FILTEROPERATOR_OR = 11 ,
UA_FILTEROPERATOR_CAST = 12 ,
UA_FILTEROPERATOR_INVIEW = 13 ,
UA_FILTEROPERATOR_OFTYPE = 14 ,
UA_FILTEROPERATOR_RELATEDTO = 15 ,
UA_FILTEROPERATOR_BITWISEAND = 16 ,
UA_FILTEROPERATOR_BITWISEOR = 17
} UA_FilterOperator;
#define UA_TYPES_FILTEROPERATOR 100
5.5.102 QueryNextRequest typedef struct
{
UA_RequestHeader requestHeader;
UA_Boolean releaseContinuationPoint;
UA_ByteString continuationPoint;
} UA_QueryNextRequest;
#define UA_TYPES_QUERYNEXTREQUEST 101
5.5.103 WriteResponse typedef struct
{
UA_ResponseHeader responseHeader;
size_t
resultsSize;
UA_StatusCode
* results;
size_t
diagnosticInfosSize;
5.5. Generated Data Type Definitions open62541 Documentation, Release 0.3.0
69
open62541 Documentation, Release 0.3.0
UA_DiagnosticInfo
} UA_WriteResponse;
* diagnosticInfos;
#define UA_TYPES_WRITERESPONSE 102
5.5.104 BrowseNextRequest
Continues one or more browse operations.
typedef struct
{
UA_RequestHeader requestHeader;
UA_Boolean releaseContinuationPoints;
size_t
continuationPointsSize;
UA_ByteString
* continuationPoints;
} UA_BrowseNextRequest;
#define UA_TYPES_BROWSENEXTREQUEST 103
5.5.105 CreateSubscriptionRequest typedef struct
{
UA_RequestHeader requestHeader;
UA_Double requestedPublishingInterval;
UA_UInt32 requestedLifetimeCount;
UA_UInt32 requestedMaxKeepAliveCount;
UA_UInt32 maxNotificationsPerPublish;
UA_Boolean publishingEnabled;
UA_Byte priority;
} UA_CreateSubscriptionRequest;
#define UA_TYPES_CREATESUBSCRIPTIONREQUEST 104
5.5.106 VariableTypeAttributes
The attributes for a variable type node.
typedef struct
{
UA_UInt32 specifiedAttributes;
UA_LocalizedText displayName;
UA_LocalizedText description;
UA_UInt32 writeMask;
UA_UInt32 userWriteMask;
UA_Variant value;
UA_NodeId dataType;
UA_Int32 valueRank;
size_t
arrayDimensionsSize;
UA_UInt32
* arrayDimensions;
UA_Boolean isAbstract;
} UA_VariableTypeAttributes;
#define UA_TYPES_VARIABLETYPEATTRIBUTES 105
5.5.107 BrowsePathResult
The result of a translate opearation.
70 Chapter 5. Data Types
typedef struct
{
UA_StatusCode statusCode;
size_t
targetsSize;
UA_BrowsePathTarget
* targets;
} UA_BrowsePathResult;
#define UA_TYPES_BROWSEPATHRESULT 106
5.5.108 ModifySubscriptionResponse typedef struct
{
UA_ResponseHeader responseHeader;
UA_Double revisedPublishingInterval;
UA_UInt32 revisedLifetimeCount;
UA_UInt32 revisedMaxKeepAliveCount;
} UA_ModifySubscriptionResponse;
#define UA_TYPES_MODIFYSUBSCRIPTIONRESPONSE 107
5.5.109 OpenSecureChannelRequest
Creates a secure channel with a server.
typedef struct
{
UA_RequestHeader requestHeader;
UA_UInt32 clientProtocolVersion;
UA_SecurityTokenRequestType requestType;
UA_MessageSecurityMode securityMode;
UA_ByteString clientNonce;
UA_UInt32 requestedLifetime;
} UA_OpenSecureChannelRequest;
#define UA_TYPES_OPENSECURECHANNELREQUEST 108
5.5.110 RegisterNodesResponse
Registers one or more nodes for repeated use within a session.
typedef struct
{
UA_ResponseHeader responseHeader;
size_t
registeredNodeIdsSize;
UA_NodeId
* registeredNodeIds;
} UA_RegisterNodesResponse;
#define UA_TYPES_REGISTERNODESRESPONSE 109
5.5.111 CloseSessionRequest
Closes a session with the server.
typedef struct
{
UA_RequestHeader requestHeader;
UA_Boolean deleteSubscriptions;
} UA_CloseSessionRequest;
#define UA_TYPES_CLOSESESSIONREQUEST 110
5.5. Generated Data Type Definitions open62541 Documentation, Release 0.3.0
71
open62541 Documentation, Release 0.3.0
5.5.112 ModifySubscriptionRequest typedef struct
{
UA_RequestHeader requestHeader;
UA_UInt32 subscriptionId;
UA_Double requestedPublishingInterval;
UA_UInt32 requestedLifetimeCount;
UA_UInt32 requestedMaxKeepAliveCount;
UA_UInt32 maxNotificationsPerPublish;
UA_Byte priority;
} UA_ModifySubscriptionRequest;
#define UA_TYPES_MODIFYSUBSCRIPTIONREQUEST 111
5.5.113 UserTokenPolicy
Describes a user token that can be used with a server.
typedef struct
{
UA_String policyId;
UA_UserTokenType tokenType;
UA_String issuedTokenType;
UA_String issuerEndpointUrl;
UA_String securityPolicyUri;
} UA_UserTokenPolicy;
#define UA_TYPES_USERTOKENPOLICY 112
5.5.114 DeleteMonitoredItemsRequest typedef struct
{
UA_RequestHeader requestHeader;
UA_UInt32 subscriptionId;
size_t
monitoredItemIdsSize;
UA_UInt32
* monitoredItemIds;
} UA_DeleteMonitoredItemsRequest;
#define UA_TYPES_DELETEMONITOREDITEMSREQUEST 113
5.5.115 ReferenceTypeAttributes
The attributes for a reference type node.
typedef struct
{
UA_UInt32 specifiedAttributes;
UA_LocalizedText displayName;
UA_LocalizedText description;
UA_UInt32 writeMask;
UA_UInt32 userWriteMask;
UA_Boolean isAbstract;
UA_Boolean symmetric;
UA_LocalizedText inverseName;
} UA_ReferenceTypeAttributes;
72 Chapter 5. Data Types
#define UA_TYPES_REFERENCETYPEATTRIBUTES 114
5.5.116 SetMonitoringModeRequest typedef struct
{
UA_RequestHeader requestHeader;
UA_UInt32 subscriptionId;
UA_MonitoringMode monitoringMode;
size_t
monitoredItemIdsSize;
UA_UInt32
* monitoredItemIds;
} UA_SetMonitoringModeRequest;
#define UA_TYPES_SETMONITORINGMODEREQUEST 115
5.5.117 UnregisterNodesResponse
Unregisters one or more previously registered nodes.
typedef struct
{
UA_ResponseHeader responseHeader;
} UA_UnregisterNodesResponse;
#define UA_TYPES_UNREGISTERNODESRESPONSE 116
5.5.118 WriteRequest typedef struct
{
UA_RequestHeader requestHeader;
size_t
nodesToWriteSize;
UA_WriteValue
* nodesToWrite;
} UA_WriteRequest;
#define UA_TYPES_WRITEREQUEST 117
5.5.119 ObjectAttributes
The attributes for an object node.
typedef struct
{
UA_UInt32 specifiedAttributes;
UA_LocalizedText displayName;
UA_LocalizedText description;
UA_UInt32 writeMask;
UA_UInt32 userWriteMask;
UA_Byte eventNotifier;
} UA_ObjectAttributes;
#define UA_TYPES_OBJECTATTRIBUTES 118
5.5.120 BrowseDescription
A request to browse the the references from a node.
5.5. Generated Data Type Definitions open62541 Documentation, Release 0.3.0
73
open62541 Documentation, Release 0.3.0
typedef struct
{
UA_NodeId nodeId;
UA_BrowseDirection browseDirection;
UA_NodeId referenceTypeId;
UA_Boolean includeSubtypes;
UA_UInt32 nodeClassMask;
UA_UInt32 resultMask;
} UA_BrowseDescription;
#define UA_TYPES_BROWSEDESCRIPTION 119
5.5.121 Duration
A period of time measured in milliseconds.
typedef
UA_Double UA_Duration;
#define UA_TYPES_DURATION 120
5.5.122 RepublishRequest typedef struct
{
UA_RequestHeader requestHeader;
UA_UInt32 subscriptionId;
UA_UInt32 retransmitSequenceNumber;
} UA_RepublishRequest;
#define UA_TYPES_REPUBLISHREQUEST 121
5.5.123 GetEndpointsRequest
Gets the endpoints used by the server.
typedef struct
{
UA_RequestHeader requestHeader;
UA_String endpointUrl;
size_t
localeIdsSize;
UA_String
* localeIds;
size_t
profileUrisSize;
UA_String
* profileUris;
} UA_GetEndpointsRequest;
#define UA_TYPES_GETENDPOINTSREQUEST 122
5.5.124 PublishRequest typedef struct
{
UA_RequestHeader requestHeader;
size_t
subscriptionAcknowledgementsSize;
UA_SubscriptionAcknowledgement
* subscriptionAcknowledgements;
} UA_PublishRequest;
#define UA_TYPES_PUBLISHREQUEST 123
74 Chapter 5. Data Types
open62541 Documentation, Release 0.3.0
5.5.125 AddNodesResponse
Adds one or more nodes to the server address space.
typedef struct
{
UA_ResponseHeader responseHeader;
size_t
resultsSize;
UA_AddNodesResult
* results;
size_t
diagnosticInfosSize;
UA_DiagnosticInfo
} UA_AddNodesResponse;
* diagnosticInfos;
#define UA_TYPES_ADDNODESRESPONSE 124
5.5.126 DataChangeNotification typedef struct
{
size_t
monitoredItemsSize;
UA_MonitoredItemNotification
* monitoredItems;
size_t
diagnosticInfosSize;
UA_DiagnosticInfo
* diagnosticInfos;
} UA_DataChangeNotification;
#define UA_TYPES_DATACHANGENOTIFICATION 125
5.5.127 CloseSecureChannelResponse
Closes a secure channel.
typedef struct
{
UA_ResponseHeader responseHeader;
} UA_CloseSecureChannelResponse;
#define UA_TYPES_CLOSESECURECHANNELRESPONSE 126
5.5.128 ModifyMonitoredItemsRequest typedef struct
{
UA_RequestHeader requestHeader;
UA_UInt32 subscriptionId;
UA_TimestampsToReturn timestampsToReturn;
size_t
itemsToModifySize;
UA_MonitoredItemModifyRequest
* itemsToModify;
} UA_ModifyMonitoredItemsRequest;
#define UA_TYPES_MODIFYMONITOREDITEMSREQUEST 127
5.5.129 SetMonitoringModeResponse typedef struct
{
UA_ResponseHeader responseHeader;
size_t
resultsSize;
UA_StatusCode
* results;
size_t
diagnosticInfosSize;
UA_DiagnosticInfo
* diagnosticInfos;
5.5. Generated Data Type Definitions 75
open62541 Documentation, Release 0.3.0
} UA_SetMonitoringModeResponse;
#define UA_TYPES_SETMONITORINGMODERESPONSE 128
5.5.130 FindServersRequest
Finds the servers known to the discovery server.
typedef struct
{
UA_RequestHeader requestHeader;
UA_String endpointUrl;
size_t
localeIdsSize;
UA_String
* localeIds;
size_t
serverUrisSize;
UA_String
* serverUris;
} UA_FindServersRequest;
#define UA_TYPES_FINDSERVERSREQUEST 129
5.5.131 ReferenceDescription
The description of a reference.
typedef struct
{
UA_NodeId referenceTypeId;
UA_Boolean isForward;
UA_ExpandedNodeId nodeId;
UA_QualifiedName browseName;
UA_LocalizedText displayName;
UA_NodeClass nodeClass;
UA_ExpandedNodeId typeDefinition;
} UA_ReferenceDescription;
#define UA_TYPES_REFERENCEDESCRIPTION 130
5.5.132 SetPublishingModeResponse typedef struct
{
UA_ResponseHeader responseHeader;
size_t
resultsSize;
UA_StatusCode
* results;
size_t
diagnosticInfosSize;
UA_DiagnosticInfo
* diagnosticInfos;
} UA_SetPublishingModeResponse;
#define UA_TYPES_SETPUBLISHINGMODERESPONSE 131
5.5.133 ContentFilterResult typedef struct
{
size_t
elementResultsSize;
UA_ContentFilterElementResult
* elementResults;
size_t
elementDiagnosticInfosSize;
UA_DiagnosticInfo
* elementDiagnosticInfos;
} UA_ContentFilterResult;
76 Chapter 5. Data Types
#define UA_TYPES_CONTENTFILTERRESULT 132
5.5.134 RegisterServerResponse
Registers a server with the discovery server.
typedef struct
{
UA_ResponseHeader responseHeader;
} UA_RegisterServerResponse;
#define UA_TYPES_REGISTERSERVERRESPONSE 133
5.5.135 AddReferencesItem
A request to add a reference to the server address space.
typedef struct
{
UA_NodeId sourceNodeId;
UA_NodeId referenceTypeId;
UA_Boolean isForward;
UA_String targetServerUri;
UA_ExpandedNodeId targetNodeId;
UA_NodeClass targetNodeClass;
} UA_AddReferencesItem;
#define UA_TYPES_ADDREFERENCESITEM 134
5.5.136 CreateSubscriptionResponse typedef struct
{
UA_ResponseHeader responseHeader;
UA_UInt32 subscriptionId;
UA_Double revisedPublishingInterval;
UA_UInt32 revisedLifetimeCount;
UA_UInt32 revisedMaxKeepAliveCount;
} UA_CreateSubscriptionResponse;
#define UA_TYPES_CREATESUBSCRIPTIONRESPONSE 135
5.5.137 DeleteSubscriptionsResponse typedef struct
{
UA_ResponseHeader responseHeader;
size_t
resultsSize;
UA_StatusCode
* results;
size_t
diagnosticInfosSize;
UA_DiagnosticInfo
* diagnosticInfos;
} UA_DeleteSubscriptionsResponse;
#define UA_TYPES_DELETESUBSCRIPTIONSRESPONSE 136
open62541 Documentation, Release 0.3.0
5.5. Generated Data Type Definitions 77
open62541 Documentation, Release 0.3.0
5.5.138 RegisterServer2Response typedef struct
{
UA_ResponseHeader responseHeader;
size_t
configurationResultsSize;
UA_StatusCode
* configurationResults;
size_t
diagnosticInfosSize;
UA_DiagnosticInfo
* diagnosticInfos;
} UA_RegisterServer2Response;
#define UA_TYPES_REGISTERSERVER2RESPONSE 137
5.5.139 RelativePath
A relative path constructed from reference types and browse names.
typedef struct
{
size_t
elementsSize;
UA_RelativePathElement
* elements;
} UA_RelativePath;
#define UA_TYPES_RELATIVEPATH 138
5.5.140 DeleteReferencesResponse
Delete one or more references from the server address space.
typedef struct
{
UA_ResponseHeader responseHeader;
size_t
resultsSize;
UA_StatusCode
* results;
size_t
diagnosticInfosSize;
UA_DiagnosticInfo
* diagnosticInfos;
} UA_DeleteReferencesResponse;
#define UA_TYPES_DELETEREFERENCESRESPONSE 139
5.5.141 CreateMonitoredItemsResponse typedef struct
{
UA_ResponseHeader responseHeader;
size_t
resultsSize;
UA_MonitoredItemCreateResult
* results;
size_t
diagnosticInfosSize;
UA_DiagnosticInfo
* diagnosticInfos;
} UA_CreateMonitoredItemsResponse;
#define UA_TYPES_CREATEMONITOREDITEMSRESPONSE 140
5.5.142 CallResponse typedef struct
{
UA_ResponseHeader responseHeader;
size_t
resultsSize;
UA_CallMethodResult
* results;
78 Chapter 5. Data Types
size_t
diagnosticInfosSize;
UA_DiagnosticInfo
* diagnosticInfos;
} UA_CallResponse;
#define UA_TYPES_CALLRESPONSE 141
5.5.143 DeleteNodesResponse
Delete one or more nodes from the server address space.
typedef struct
{
UA_ResponseHeader responseHeader;
size_t
resultsSize;
UA_StatusCode
* results;
size_t
diagnosticInfosSize;
UA_DiagnosticInfo
* diagnosticInfos;
} UA_DeleteNodesResponse;
#define UA_TYPES_DELETENODESRESPONSE 142
5.5.144 RepublishResponse typedef struct
{
UA_ResponseHeader responseHeader;
UA_NotificationMessage notificationMessage;
} UA_RepublishResponse;
#define UA_TYPES_REPUBLISHRESPONSE 143
5.5.145 MonitoredItemCreateRequest typedef struct
{
UA_ReadValueId itemToMonitor;
UA_MonitoringMode monitoringMode;
UA_MonitoringParameters requestedParameters;
} UA_MonitoredItemCreateRequest;
#define UA_TYPES_MONITOREDITEMCREATEREQUEST 144
5.5.146 DeleteReferencesRequest
Delete one or more references from the server address space.
typedef struct
{
UA_RequestHeader requestHeader;
size_t
referencesToDeleteSize;
UA_DeleteReferencesItem
* referencesToDelete;
} UA_DeleteReferencesRequest;
#define UA_TYPES_DELETEREFERENCESREQUEST 145
open62541 Documentation, Release 0.3.0
5.5. Generated Data Type Definitions 79
open62541 Documentation, Release 0.3.0
5.5.147 ModifyMonitoredItemsResponse typedef struct
{
UA_ResponseHeader responseHeader;
size_t
resultsSize;
UA_MonitoredItemModifyResult
* results;
size_t
diagnosticInfosSize;
UA_DiagnosticInfo
* diagnosticInfos;
} UA_ModifyMonitoredItemsResponse;
#define UA_TYPES_MODIFYMONITOREDITEMSRESPONSE 146
5.5.148 ReadResponse typedef struct
{
UA_ResponseHeader responseHeader;
size_t
resultsSize;
UA_DataValue
* results;
size_t
diagnosticInfosSize;
UA_DiagnosticInfo
* diagnosticInfos;
} UA_ReadResponse;
#define UA_TYPES_READRESPONSE 147
5.5.149 AddReferencesRequest
Adds one or more references to the server address space.
typedef struct
{
UA_RequestHeader requestHeader;
size_t
referencesToAddSize;
UA_AddReferencesItem
* referencesToAdd;
} UA_AddReferencesRequest;
#define UA_TYPES_ADDREFERENCESREQUEST 148
5.5.150 ReadRequest typedef struct
{
UA_RequestHeader requestHeader;
UA_Double maxAge;
UA_TimestampsToReturn timestampsToReturn;
size_t
nodesToReadSize;
UA_ReadValueId
* nodesToRead;
} UA_ReadRequest;
#define UA_TYPES_READREQUEST 149
5.5.151 AddNodesItem
A request to add a node to the server address space.
typedef struct
{
UA_ExpandedNodeId parentNodeId;
UA_NodeId referenceTypeId;
80 Chapter 5. Data Types
open62541 Documentation, Release 0.3.0
UA_ExpandedNodeId requestedNewNodeId;
UA_QualifiedName browseName;
UA_NodeClass nodeClass;
UA_ExtensionObject nodeAttributes;
UA_ExpandedNodeId typeDefinition;
} UA_AddNodesItem;
#define UA_TYPES_ADDNODESITEM 150
5.5.152 ServerStatusDataType typedef struct
{
UA_DateTime startTime;
UA_DateTime currentTime;
UA_ServerState state;
UA_BuildInfo buildInfo;
UA_UInt32 secondsTillShutdown;
UA_LocalizedText shutdownReason;
} UA_ServerStatusDataType;
#define UA_TYPES_SERVERSTATUSDATATYPE 151
5.5.153 AddReferencesResponse
Adds one or more references to the server address space.
typedef struct
{
UA_ResponseHeader responseHeader;
size_t
resultsSize;
UA_StatusCode
* results;
size_t
diagnosticInfosSize;
UA_DiagnosticInfo
* diagnosticInfos;
} UA_AddReferencesResponse;
#define UA_TYPES_ADDREFERENCESRESPONSE 152
5.5.154 TranslateBrowsePathsToNodeIdsResponse
Translates one or more paths in the server address space.
typedef struct
{
UA_ResponseHeader responseHeader;
size_t
resultsSize;
UA_BrowsePathResult
* results;
size_t
diagnosticInfosSize;
UA_DiagnosticInfo
* diagnosticInfos;
} UA_TranslateBrowsePathsToNodeIdsResponse;
#define UA_TYPES_TRANSLATEBROWSEPATHSTONODEIDSRESPONSE 153
5.5.155 DataChangeFilter typedef struct
{
UA_DataChangeTrigger trigger;
UA_UInt32 deadbandType;
5.5. Generated Data Type Definitions 81
open62541 Documentation, Release 0.3.0
UA_Double deadbandValue;
} UA_DataChangeFilter;
#define UA_TYPES_DATACHANGEFILTER 154
5.5.156 ContentFilterElement typedef struct
{
UA_FilterOperator filterOperator;
size_t
filterOperandsSize;
UA_ExtensionObject
* filterOperands;
} UA_ContentFilterElement;
#define UA_TYPES_CONTENTFILTERELEMENT 155
5.5.157 CloseSessionResponse
Closes a session with the server.
typedef struct
{
UA_ResponseHeader responseHeader;
} UA_CloseSessionResponse;
#define UA_TYPES_CLOSESESSIONRESPONSE 156
5.5.158 RegisteredServer
The information required to register a server with a discovery server.
typedef struct
{
UA_String serverUri;
UA_String productUri;
size_t
serverNamesSize;
UA_LocalizedText
* serverNames;
UA_ApplicationType serverType;
UA_String gatewayServerUri;
size_t
discoveryUrlsSize;
UA_String
* discoveryUrls;
UA_String semaphoreFilePath;
UA_Boolean isOnline;
} UA_RegisteredServer;
#define UA_TYPES_REGISTEREDSERVER 157
5.5.159 ApplicationDescription
Describes an application and how to find it.
typedef struct
{
UA_String applicationUri;
UA_String productUri;
UA_LocalizedText applicationName;
UA_ApplicationType applicationType;
UA_String gatewayServerUri;
UA_String discoveryProfileUri;
82 Chapter 5. Data Types
open62541 Documentation, Release 0.3.0
size_t
discoveryUrlsSize;
UA_String
* discoveryUrls;
} UA_ApplicationDescription;
#define UA_TYPES_APPLICATIONDESCRIPTION 158
5.5.160 ServiceFault
The response returned by all services when there is a service level error.
typedef struct
{
UA_ResponseHeader responseHeader;
} UA_ServiceFault;
#define UA_TYPES_SERVICEFAULT 159
5.5.161 RegisterServerRequest
Registers a server with the discovery server.
typedef struct
{
UA_RequestHeader requestHeader;
UA_RegisteredServer server;
} UA_RegisterServerRequest;
#define UA_TYPES_REGISTERSERVERREQUEST 160
5.5.162 FindServersResponse
Finds the servers known to the discovery server.
typedef struct
{
UA_ResponseHeader responseHeader;
size_t
serversSize;
UA_ApplicationDescription
} UA_FindServersResponse;
* servers;
#define UA_TYPES_FINDSERVERSRESPONSE 161
5.5.163 CreateMonitoredItemsRequest typedef struct
{
UA_RequestHeader requestHeader;
UA_UInt32 subscriptionId;
UA_TimestampsToReturn timestampsToReturn;
size_t
itemsToCreateSize;
UA_MonitoredItemCreateRequest
} UA_CreateMonitoredItemsRequest;
* itemsToCreate;
#define UA_TYPES_CREATEMONITOREDITEMSREQUEST 162
5.5. Generated Data Type Definitions 83
open62541 Documentation, Release 0.3.0
5.5.164 ContentFilter typedef struct
{
size_t
elementsSize;
UA_ContentFilterElement
* elements;
} UA_ContentFilter;
#define UA_TYPES_CONTENTFILTER 163
5.5.165 QueryFirstResponse typedef struct
{
UA_ResponseHeader responseHeader;
size_t
queryDataSetsSize;
UA_QueryDataSet
* queryDataSets;
UA_ByteString continuationPoint;
size_t
parsingResultsSize;
UA_ParsingResult
* parsingResults;
size_t
diagnosticInfosSize;
UA_DiagnosticInfo
* diagnosticInfos;
UA_ContentFilterResult filterResult;
} UA_QueryFirstResponse;
#define UA_TYPES_QUERYFIRSTRESPONSE 164
5.5.166 AddNodesRequest
Adds one or more nodes to the server address space.
typedef struct
{
UA_RequestHeader requestHeader;
size_t
nodesToAddSize;
UA_AddNodesItem
* nodesToAdd;
} UA_AddNodesRequest;
#define UA_TYPES_ADDNODESREQUEST 165
5.5.167 BrowseRequest
Browse the references for one or more nodes from the server address space.
typedef struct
{
UA_RequestHeader requestHeader;
UA_ViewDescription view;
UA_UInt32 requestedMaxReferencesPerNode;
size_t
nodesToBrowseSize;
UA_BrowseDescription
* nodesToBrowse;
} UA_BrowseRequest;
#define UA_TYPES_BROWSEREQUEST 166
5.5.168 BrowsePath
A request to translate a path into a node id.
84 Chapter 5. Data Types
typedef struct
{
UA_NodeId startingNode;
UA_RelativePath relativePath;
} UA_BrowsePath;
#define UA_TYPES_BROWSEPATH 167
5.5.169 BrowseResult
The result of a browse operation.
typedef struct
{
UA_StatusCode statusCode;
UA_ByteString continuationPoint;
size_t
referencesSize;
UA_ReferenceDescription
* references;
} UA_BrowseResult;
#define UA_TYPES_BROWSERESULT 168
5.5.170 RegisterServer2Request typedef struct
{
UA_RequestHeader requestHeader;
UA_RegisteredServer server;
size_t
discoveryConfigurationSize;
UA_ExtensionObject
* discoveryConfiguration;
} UA_RegisterServer2Request;
#define UA_TYPES_REGISTERSERVER2REQUEST 169
5.5.171 CreateSessionRequest
Creates a new session with the server.
typedef struct
{
UA_RequestHeader requestHeader;
UA_ApplicationDescription clientDescription;
UA_String serverUri;
UA_String endpointUrl;
UA_String sessionName;
UA_ByteString clientNonce;
UA_ByteString clientCertificate;
UA_Double requestedSessionTimeout;
UA_UInt32 maxResponseMessageSize;
} UA_CreateSessionRequest;
#define UA_TYPES_CREATESESSIONREQUEST 170
5.5.172 QueryDataDescription typedef struct
{
UA_RelativePath relativePath;
UA_UInt32 attributeId;
UA_String indexRange;
5.5. Generated Data Type Definitions open62541 Documentation, Release 0.3.0
85
open62541 Documentation, Release 0.3.0
} UA_QueryDataDescription;
#define UA_TYPES_QUERYDATADESCRIPTION 171
5.5.173 EndpointDescription
The description of a endpoint that can be used to access a server.
typedef struct
{
UA_String endpointUrl;
UA_ApplicationDescription server;
UA_ByteString serverCertificate;
UA_MessageSecurityMode securityMode;
UA_String securityPolicyUri;
size_t
userIdentityTokensSize;
UA_UserTokenPolicy
* userIdentityTokens;
UA_String transportProfileUri;
UA_Byte securityLevel;
} UA_EndpointDescription;
#define UA_TYPES_ENDPOINTDESCRIPTION 172
5.5.174 GetEndpointsResponse
Gets the endpoints used by the server.
typedef struct
{
UA_ResponseHeader responseHeader;
size_t
endpointsSize;
UA_EndpointDescription
* endpoints;
} UA_GetEndpointsResponse;
#define UA_TYPES_GETENDPOINTSRESPONSE 173
5.5.175 EventFilter typedef struct
{
size_t
selectClausesSize;
UA_SimpleAttributeOperand
* selectClauses;
UA_ContentFilter whereClause;
} UA_EventFilter;
#define UA_TYPES_EVENTFILTER 174
5.5.176 NodeTypeDescription typedef struct
{
UA_ExpandedNodeId typeDefinitionNode;
UA_Boolean includeSubTypes;
size_t
dataToReturnSize;
UA_QueryDataDescription
* dataToReturn;
} UA_NodeTypeDescription;
#define UA_TYPES_NODETYPEDESCRIPTION 175
86 Chapter 5. Data Types
open62541 Documentation, Release 0.3.0
5.5.177 BrowseNextResponse
Continues one or more browse operations.
typedef struct
{
UA_ResponseHeader responseHeader;
size_t
resultsSize;
UA_BrowseResult
* results;
size_t
diagnosticInfosSize;
UA_DiagnosticInfo
* diagnosticInfos;
} UA_BrowseNextResponse;
#define UA_TYPES_BROWSENEXTRESPONSE 176
5.5.178 TranslateBrowsePathsToNodeIdsRequest
Translates one or more paths in the server address space.
typedef struct
{
UA_RequestHeader requestHeader;
size_t
browsePathsSize;
UA_BrowsePath
* browsePaths;
} UA_TranslateBrowsePathsToNodeIdsRequest;
#define UA_TYPES_TRANSLATEBROWSEPATHSTONODEIDSREQUEST 177
5.5.179 BrowseResponse
Browse the references for one or more nodes from the server address space.
typedef struct
{
UA_ResponseHeader responseHeader;
size_t
resultsSize;
UA_BrowseResult
* results;
size_t
diagnosticInfosSize;
UA_DiagnosticInfo
* diagnosticInfos;
} UA_BrowseResponse;
#define UA_TYPES_BROWSERESPONSE 178
5.5.180 CreateSessionResponse
Creates a new session with the server.
typedef struct
{
UA_ResponseHeader responseHeader;
UA_NodeId sessionId;
UA_NodeId authenticationToken;
UA_Double revisedSessionTimeout;
UA_ByteString serverNonce;
UA_ByteString serverCertificate;
size_t
serverEndpointsSize;
UA_EndpointDescription
* serverEndpoints;
size_t
serverSoftwareCertificatesSize;
UA_SignedSoftwareCertificate
* serverSoftwareCertificates;
UA_SignatureData serverSignature;
UA_UInt32 maxRequestMessageSize;
} UA_CreateSessionResponse;
5.5. Generated Data Type Definitions 87
open62541 Documentation, Release 0.3.0
#define UA_TYPES_CREATESESSIONRESPONSE 179
5.5.181 QueryFirstRequest typedef struct
{
UA_RequestHeader requestHeader;
UA_ViewDescription view;
size_t
nodeTypesSize;
UA_NodeTypeDescription
* nodeTypes;
UA_ContentFilter filter;
UA_UInt32 maxDataSetsToReturn;
UA_UInt32 maxReferencesToReturn;
} UA_QueryFirstRequest;
#define UA_TYPES_QUERYFIRSTREQUEST 180
5.6 Deprecated Data Types API
The following definitions are deprecated and will be removed in future releases of open62541.
typedef struct
{
UA_StatusCode code;
const char
* name;
/* The numeric value of the StatusCode */
/* The symbolic name */
const char
* explanation; /* Short message explaining the StatusCode */
} UA_StatusCodeDescription;
extern const
UA_StatusCodeDescription statusCodeExplanation_default;
UA_DEPRECATED
static
UA_INLINE
const
UA_StatusCodeDescription
*
UA_StatusCode_description (UA_StatusCode code) {
return
& statusCodeExplanation_default;
}
UA_DEPRECATED
static
UA_INLINE
const char
*
UA_StatusCode_explanation (UA_StatusCode code) {
return
statusCodeExplanation_default.name;
}
88 Chapter 5. Data Types
advertisement
* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
Related manuals
advertisement
Table of contents
- 5 Introduction
- 5 OPC Unified Architecture
- 6 open62541 Features
- 6 Getting Help
- 6 Contributing
- 9 Building open62541
- 9 Building the Examples
- 9 Building the Library
- 11 Build Options
- 13 Tutorials
- 13 Working with Data Types
- 15 Building a Simple Server
- 16 Adding Variables to a Server
- 18 Connecting a Variable with a Physical Process
- 21 Working with Variable Types
- 23 Working with Objects and Object Types
- 29 Adding Methods to Objects
- 32 Building a Simple Client
- 35 Protocol
- 35 Establishing a Connection
- 36 Structure of a protocol message
- 39 Data Types
- 39 Builtin Types
- 50 Generic Type Handling
- 52 Array handling
- 52 Random Number Generator
- 53 Generated Data Type Definitions
- 92 Deprecated Data Types API
- 93 Information Modelling
- 93 Base Node Attributes
- 94 VariableNode
- 95 VariableTypeNode
- 95 MethodNode
- 96 ObjectNode
- 96 ObjectTypeNode
- 96 ReferenceTypeNode
- 98 DataTypeNode
- 98 ViewNode
- 99 Services
- 99 Discovery Service Set
- 100 SecureChannel Service Set
- 100 Session Service Set
- 101 NodeManagement Service Set
- 101 View Service Set
- 102 Query Service Set
- 102 Attribute Service Set
- 102 Method Service Set
- 103 MonitoredItem Service Set
- 103 Subscription Service Set
- 105 Server
- 105 Server Lifecycle
- 106 Repeated Callbacks
- 106 Reading and Writing Node Attributes
- 111 Browsing
- 112 Discovery
- 113 Information Model Callbacks
- 117 Node Addition and Deletion
- 120 Reference Management
- 120 Utility Functions
- 120 Deprecated Server API
- 123 Client
- 123 Client Configuration
- 123 Client Lifecycle
- 124 Discovery
- 125 Manage the Connection
- 126 Services
- 129 Asynchronous Services
- 141 Standard-Defined Constants
- 141 Attribute Id
- 141 Access Level Masks
- 142 Write Masks
- 142 StatusCodes
- 150 Namespace Zero NodeIds
- 175 XML Nodeset Compiler
- 180 Creating object instances
- 183 Internals
- 183 Networking Plugin API
- 186 Access Control Plugin API
- 187 Logging Plugin API
- 189 Nodestore