Gets information about a variable tag. This function allows you to develop generic Cicode and Super Genies.
TagInfo(sName, nType [, ClusterName] )
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".
To get information on a particular element in an array, enter the array name here, followed by the number of the element as follows:
The above example tells the function to get information on the tenth element in PLC_Array (remember, the address of the first element in an array is 0 (zero)).
The type of information to get:
0 - The Tag name from the variables table. This is the same as sName argument. (Returned to be compatible with the AssInfo() function).
1 - Engineering units
2 - Raw zero scale
3 - Raw full scale
4 - Engineering zero scale
5 - Engineering full scale
6 - Width of the format
7 - Number of decimal places of format
8 - The Tag format as a long integer. The format information is stored in the integer as follows:
9 - Logical Unit Number - I/O device number (for internal use)
10 - Raw Type - Protocol's raw data type number for this tag. Type numbers are:
11 - Bit Width - Tag's size in bits. For example, an INT is 16 bits
12 - Unit Type - Protocol's unit type number for this tag
13 - Unit Address - Tag's address after the protocol DBF's template is applied.
14 - Unit Count - Array size. For example, if the tag's address is I1, the unit count is 50.
15 - Record Number - Tag's record number in variable.DBF - 1. That is, the first tag has a record number of 0.
16 - Comment - As defined in the variable tags list.
17 - ClusterName of the tag. If the tag is not resolved, returns an empty string.
18 - Full name (cluster.tagname) of the tag. If the tag is not resolved, returns an empty string.
19 - Reserved for internal operation.
20 - Configured Address of the tag. If the tag is not resolved, returns an empty string.
21 - Network Number - I/O device number (as defined by the Number field of the I/O Devices dialog).
If the tag is a local variable, modes 9, 11, 12, 13, 14, 15 and 17 will return an empty string, while mode 18 will return only the tag name (without the cluster specified).
Specifies the name of the cluster in which the Tag resides. The argument is enclosed in quotation marks.
The value of the information as a string.
AssGetProperty, AssGetScale, AssInfo, AssScaleStr, TagGetProperty, TagGetScale, TagInfoEx, TagScaleStr
/* Get the engineering full scale value for the variable "PV131" */
EngFullScale = TagInfo("PV131", 5);
/* Get the engineering zero scale value for the array variable "PLC_Array" */
EngZeroScale = TagInfo("PLC_Array", 4);