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

TagSetOverrideQuality

Sets a quality of Override element for a specified tag.

Syntax

TagSetOverrideQuality(STRING sTag, QUALITY qualityNew [,INT bSynch [, STRING ClusterName]])

sTag

The variable tag name as a string. The name of the tag can be prefixed by the name of the cluster that is "ClusterName.Tag".

qualityNew

The new quality for the tag’s Override element.

bSynch

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 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