Applies To:
  • CitectSCADA 5.00, 5.01, 5.10, 5.20

Summary:
I need to read the tag name a graphics page object is using, but DspInfo() sometimes returns a blank string. This worked in Citect 4.2. 

Solution:
CIT had confirmed this to be a problem in Citect for Windows Versions 5.00 to 5.20 (service pack B). The problem has been fixed for version 5.21.

A work-around for this is to read another value from the object before you read the tag name. If you call the following Cicode function from the touch command of a numeric display object, it will pop up a window listing the tagname that is being displayed.

FUNCTION
GetTagName()

INT hAN, hInfo, iIndex, iType;
STRING sTagName;

hAN = KeyGetCursor();     // Find the animation number clicked on
hInfo = DspInfoNew(hAN);   // Create an object information block for that AN

DspInfo(hInfo, 1, 0);  // Work-around to read a value from the object

sTagName = DspInfo(hInfo, 3, 0);   // Read the tagname
Message("Tag Name", sTagName, 0);  // Pop-up window

DspInfoDestroy(hInfo); // Destroy the object info block when done

END

See also article Q2591.

 

Keywords:
 

Attachments