Applies To:
  • CitectSCADA v7.0

Summary:
 How to extract the expression field from the Trend tag form?

Solution:
 There are two ways to accomplish this task:
1.) Name the Trend tag same as the tag in the expression field.
2.) Use Trend Browse functions to get the expression:

Sample Code:

FUNCTION
trnbrow()
 INT jsession = 0;
 STRING out = "";
 INT err = 0;
 INT flag = 0;
 jsession = TrnBrowseOpen("Tank1Level","EXPRESSION");.
 TrnBrowseFirst(jsession);
 WHILE flag = 0 DO
   out = TrnBrowseGetField(jsession,"EXPRESSION");
   err = IsError();
   flag = TrnBrowseNext(jsession);
 END
 TrnBrowseClose(jsession);
END

"Tank1Level" is the trend tag name. -> "Expression" is the field of interest. You can leave the trend tag name as an empty string to browse through all the trend tags.

You can make this function generic by using the trend tag name as an argument and return the expression field.


Keywords:
 

Attachments