TagDebugForm
- Last UpdatedFeb 02, 2024
- 3 minute read
The TagDebugForm Cicode function displays a dialog that allows you to select a variable tag and perform some basic read/write operations on it. This function is useful for debugging or commissioning a project.

When the TagDebug form appears, you can perform the following tasks:
-
Select a tag
You can manually enter the name of the tag you would like to debug, or you can select it from the list included in the drop-down menu to the right of the Tag field. Be aware that the drop-down list is limited to 500 tags.
Note: Local variables will not be included in the Tag field drop-down list.
You can use the Filter button to help locate specific items from the tags database. A filter allows you to reduce the list of tags included in the tag drop-down menu to only those that match the characters specified in the Tag Filter dialog. To apply a filter, click on the Filter button and enter part of the name of the tag you would like to locate. The text entered can be a common suffix, it does not need to be the start of a tag name.
Click OK to apply the filter, or Clear to remove it.
If a filter is currently implemented, an "F" will appear next to the Filter button. An asterix (*) indicates no filter is currently being used.
Once you have a tag selected, you can specify additional properties in the field to the right of the Tag field. The drop-down menu includes a list of available extensions (for example, ".Field", ".Valid", ".Override", etc.). To automatically display these additional properties when a read occurs, you should use the drop-down menu in this field instead of manually adding an extension to a tag name.
-
Read a tag
The Read button will retrieve the value for the tag you have specified, or an error code will be displayed (for example, <Error 424: Tag not found>).
If successful, a read will display the following information about the selected tag:
-
Last user request: the time the most recent read occurred.
-
Tag Type: the data type.
-
Base tag: confirmation of the tag name, including the selected extension.
-
.Q (quality), .QT (quality timestamp), .VT (value timestamp), and .T (the object timestamp, which is the most recent of the two timestamps).
-
Eng Scale: RZ = raw zero; RF = Raw Full Scale; EZ = engineering zero; EF = engineering full scale.
-
Eng Units.
-
-
Read from a tag array
You view information for a particular item within a tag array using the Array Index field. This field allows you to specify the index number of the required item within the selected tag array.
-
Write to a tag
To write a value to the selected tag, key in the required value and click on the Write button.
When a write has occurred, a log entry similar to the following will be added to the syslog.dat file:
<timestamp> TagDebug() Write: User 'Engineer' set tag 'Entry_ScrapWeight' to value ' 23.00' - NO ERROR
-
Check the device status
The Tag's Device Status button allows you to confirm if the host device for the selected tag is currently online. In most cases, this will be useful in determining the cause of an error code, for example, <Error 424: Tag not found>. Clicking the button will update the current status of the device.
-
Use the auto-read feature
The form allows for reads to be automatically repeated at a specified interval, allowing you observe how a tag value is changing over time.
Clicking the Auto Read button will start the read cycle; the Stop Read button will stop it. To adjust the read period, enter a value (milliseconds) in the field next to the Auto Read button.
Syntax
TagDebugForm()
Return Value
The name of the tag entered in the dialog.
Related Functions
TagDebug, TagInfo, TagReadEx, TagWrite
Example
TagDebug(); /* Display debug form to allow user to debug */