DspInfoField
- Last UpdatedAug 21, 2025
- 2 minute read
Obtains static and real-time data from a variable tag. You get static data from the Variable Tags database. The additional field "Eng_Value", returns dynamic real-time data for the variable tag. To get this real-time data, you need to first call the DspInfoNew() function to get the information block handle hInfo.
Getting the raw value of a variable tag using DspInfoField is no longer supported. To get the raw value of a tag, use the TagSubscribe function, specifying a value of "Raw" for the sScaleMode parameter. When using TagSubscribe, you can either call SubscriptionGetAttribute to obtain the value whenever required or register callback cicode function to run when the value changes. See TagSubscribe for more details.
Syntax
DspInfoField(hInfo, sTag, sField [, sClusterName] )
hInfo:
The object information block handle, as returned by DspInfoNew(). This handle identifies the table (or block) where data on the object is stored. Set this handle to 0 (zero) if you do not require real-time data.
sTag:
The name of the variable tag. The name of the tag can be prefixed by the name of the cluster that is "ClusterName.Tag". This argument does not support arrays. If array syntax is used, the information will be retrieved for only the tag name.
sField:
The name of the field from which to extract the data:
• Addr - The address of the variable
• Cluster - Name of the cluster in which the tag resides
• Comment - Variable tag comment
• Eng_Full - Engineering Full Scale
• Eng_Zero - Engineering Zero Scale
• Eng_Units - Engineering Units
• Eng_Value - Scaled engineering value - Dynamic
• FullName - Full name of the tag in the form cluster.tagname.
• Historian - historize and publish to CitectHistorian
• Name - Variable tag name
• Raw_Full - Raw Full Scale
• Raw_Zero - Raw Zero Scale
• Type - Data type
• Unit - I/O device name
sClusterName:
Specifies the name of the cluster in which the Tag resides. This is optional if you have one cluster or are resolving the tag via the current cluster context. The argument is enclosed in quotation marks " ".
Return Value
The data (as a string).
Related Functions
DspInfo, DspInfoNew, DspInfoDestroy, SubscriptionGetAttribute, SubscriptionAddCallback, TagSubscribe
Example
! Get the I/O device that Variable Tag "PV123" belongs to.
IODev=DspInfoField(0,"PV123","Unit");
! Get the real-time engineering value of a tag.
hInfo=DspInfoNew(20);
sTag=DspInfo(hInfo,3,0);
EngValue=DspInfoField(hInfo,sTag,"Eng_Value");