Cicode Programming Reference > Using Variables > Declaring the Variable Data Type > QUALITY Data Type

QUALITY Data Type

The QUALITY data type is a new data type in Cicode which incorporates the CitectSCADA quality. The QUALITY data type and the Cicode quality labels can be used in Cicode expressions.

The operators allowed for the QUALITY data type are:

The assignment operation also allows for the QUALITY data type.

Example:

QUALITY q1;
QUALITY q2;
 
q1 = q2;
q1 = Tag1.Field.Q;
 
//the following expression will generate a compiler error as a tag //element can be modified only as a whole
Tag1.Field.Q = q1;

A set of Cicode functions are provided which allow quality fields to be initialized, a specific quality field to be extracted, and other operations on the QUALITY data type. Conversion between the QUALITY data type and other Cicode data types is not allowed. Direct conversion from Quality to string will return an empty string.

Example:

//this will generate a compiler error
INT n = Tag1.Q;