TagGetProperty
This function reads a property of a variable tag from the datasource. This function replaces TagInfo.
Syntax
TagGetProperty(sName, sProperty [, iCached] [, ClusterName] )
sName:
The name of the tag from which to get information. The name of the tag can be prefixed by the name of the cluster that is "ClusterName.Tag".
sProperty:
The property to read. Property names are case sensitive. Supported properties are:
Address - Returns the configured address of the tag (as specified in the variable tags form).
ArraySize - Array size of the associated tag. Returns 1 for non-array types.
DataBitWidth - Number of bits used to store the value
Description - Tag description
EngUnitsHigh - Maximum scaled value
EngUnitsLow - Minimum scaled value
Format - Format bit string. The format information is stored in the integer as follows:
FormatDecPlaces - Number of decimal places for default format
FormatWidth - Number of characters used in default format
RangeHigh - Maximum unscaled value
RangeLow - Minimum unscaled value
Type - Type of tag. Allowed values are:
Units - Engineering Units for example, %, mm, Volts
iCached:
Optional flag to attempt to retrieve the cached value for the property rather than the current value. This makes the function non-blocking. If the property has not yet been cached, an error is set.
0 - Do not force cached read. Cicode is blocking
1 - Force cached read. Cicode is non-blocking
Default value is 1 (true).
ClusterName:
Specifies the name of the cluster in which the Tag resides. The argument is enclosed in quotation marks.
Return Value
String representation of the property of the tag. On error, an empty string and an error is set.
Related Functions
AssGetProperty, AssGetScale, AssInfo, AssScaleStr, TagGetScale, TagScaleStr, TagInfo
Example
// Get the engineering full scale value for the variable "PV131"
EngFullScale = TagGetProperty("PV131", "EngUnitsHigh", 0);
// Get the cached array size for the array variable "PLC_Array"
ArrayLength = TagGetProperty("PLC_Array", "ArraySize", 1);
See Also