OPC Studio User's Guide and Reference
Generic data validation
Concepts > OPC Data Client Concepts > OPC Data Client Extensions > OPC Data Client Integrated Extensions > OPC UA Complex Data Extension > Generic data and data types > Working with generic data > Generic data validation
In This Topic

When the GenericData is returned from the server by the component (e.g. from read operations or by subscriptions), its DataType Property property is always filled in (i.e. not null).

When the GenericData is passed in to the component for transfer to the server (e.g. to a write operation), filling in the DataType Property optional. When not null, the component checks the value in GenericData against the data type given by this property, and issues an error if the value does not conform to the type. It is allowed for this property to be not null at some higher level, and be null at lower level, such as for an individual field of a structure.

When the data type is given and passed to the component, it is only used for the checks described above. It does not influence the actual encoding of the values, and the encoding process may further reject some input values as not conforming to the encoding.

Validation rules

Generic data can only be validated if it has a non-null DataType associated with it. When the DataType is null, the validation always succeeds.

For all kinds of generic data, the associated data type must be complete and terminable for the validation to succeed. For discussions of these terms, see Working with data types.

Besides these common rules, specific rules apply to different kinds of generic data:

Invoking the validation

You can also invoke the validation of generic data from your code, e.g. to prevent errors upon writing the data. To do so, you can do one of the following:

See Also

Reference