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

TagScaleStr

Gets the value of a tag at a specified scale. The value is returned as a formatted string using the tags format specification and (optionally) the engineering units. Use this function to write generic Cicode that will work with any type of tag.

Note: This function is being deprecated and is replaced by the TagGetScale function. If the Tag properties are updated TagScaleStr does not get the updated values whereas TagGetScale does.

Syntax

STRING TagScaleStr(STRING Tag, INT Percent , INT EngUnits [,STRING ClusterName] [,INT CachedMode] )

Tag:

The name of the tag, or the equipment and item name of a variable tag (using equipment.item notation).

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

Percent:

The percentage of full scale of the returned value.

EngUnits:

Determines if the value is returned with engineering units:

0 - Return the value without engineering units

1 - Return the value with engineering units

ClusterName:

Name of the cluster

CachedMode:

Optional parameter that specifies from where to retrieve the value for the property.

-1 - The mode is determined by the INI parameter [Client]TagReadCachedMode.

0 - The property value is retrieved direct from the server in blocking mode and an error code is returned if it is not on the server (or the server is unavailable).

1 - The property value is retrieved from the cache and an error code is returned if the cache is not loaded yet.

2 - The property value is retrieved from the local configuration and an error code is returned if it is not available (this is the traditional behaviour).

3 - The property value is retrieved from the cache, if the cache is loaded, and from the local configuration, if the cache is not loaded yet.

Default value is -1.

Return Value

The scale of the tag (as a string).

Related Functions

AssGetProperty, AssGetScale, AssInfo, AssScaleStr, TagGetProperty, TagGetScale, TagInfo

Example

// Display the zero, 50% and full scale of the tag CV_123_PV
DspText(31,0,TagScaleStr("CV_123_PV", 0, 1));
DspText(32,0,TagScaleStr("CV_123_PV", 50, 1));
DspText(33,0,TagScaleStr("CV_123_PV", 100, 1));

See Also

Tag Functions

Published June 2018