Cicode Programming Reference > Cicode Function Categories > Tag Functions > TagSetOverrideQuality

TagSetOverrideQuality

Sets a quality of Override element for a specified tag.

Syntax

TagSetOverrideQuality(STRING Tag, QUALITY qualityNew [,INT Synch [, STRING ClusterName]])

Tag

The variable tag name or the equipment and item name (using equipment.item notation) associated with that tag as a string. The name of the tag can be prefixed by the name of the cluster that is "ClusterName.Tag" or "ClusterName.Equipment.Item".

Note: If the tag name exceeds the length limit of 254 characters the hardware alarm "Tag name exceed length limit" will be raised.

qualityNew

The new quality for the tag’s Override element.

Synch

An optional boolean argument that specifies whether the command is synchronous (blocking) or asynchronous (non- blocking). If it is specified as synchronous (blocking) the function will wait until the write has completed and returned from the server before further code execution. This parameter is "False", or asynchronous, by default. If you specify this parameter the other parameters need to be explicitly specified.

ClusterName

Specifies the name of the cluster in which the Tag resides. The argument is enclosed in quotation marks.

Return Value

0 (zero) if successful, otherwise an error code is returned.

Related Functions

TagSetOverrideGood, TagSetOverrideUncertain, TagSetOverrideBad, QualityIsOverride

Example

QUALITY q1 = QualityCreate(QUAL_UNCR);
TagSetOverrideQuality("Tag1", q1);
 

Setting the value of the OverrideMode element to anything other than 3 will overwrite the quality that has been applied to the Override element using this function. See the example below and OverrideMode for more details.

 

//The OverrideMode is switched off
Tag1.OverrideMode = 0;
//The quality of Override element is set to Uncertain
QUALITY q1 = QualityCreate(QUAL_UNCR);
TagSetOverrideQuality("Tag1", q1);
//The OverrideMode is set to 1 and
//the Field element is copied to the Override element.
//The quality of the Override element is overwritten.
Tag1.OverrideMode = 1;
//The quality is set again to Uncertain
QUALITY q1 = QualityCreate(QUAL_UNCR);
TagSetOverrideQuality("Tag1", q1);

See Also

Tag Functions

Published June 2018