Applies To:
  • CitectSCADA 6.xx
  • CitectHMI 6.xx

In some versions of Citect the function PageTrend( ) does not work. How can I open a Trend Page and assign the Trend Pens to display via one Cicode call?

Some of the possible workarounds are quite convoluted, and often require making several Trend pages.


One possible workaround is to create a Trend Page that uses SuperGenie Substitution in order to have one standard template where you can set the Trend Tags via Cicode.

* Create a new page based on the Trend template and call it "SG_trend".

* Open the Page Properties for that Page, for the "On Page Shown" event and add the following command:

trnsetpen(250,1,?STRING 1?);
trnsetpen(250,2,?STRING 2?);
trnsetpen(250,3,?STRING 3?);
trnsetpen(250,4,?STRING 4?);
trnsetpen(250,5,?STRING 5?);
trnsetpen(250,6,?STRING 6?);
trnsetpen(250,7,?STRING 7?);
trnsetpen(250,8,?STRING 8?);

NOTE: This assumes that the AN of your Trend is 250, which it is on the standard CSV Trend template.

* Save and close the page.

Now you can invoke this page and assign what trends to display with a simple one line call using the AssPage function, and using SuperGenie substitution.

* On the page that you want to open your Trends from, create a button with the following Cicode, where Trend1->Trend8 are the names of your configured Trends.


NOTE: The syntax of the SG_Trend is the name of the page, and is surrounded by " marks.
NOTE: The Trend1 etc. are surrounded by " marks AND ' marks. This will use SuperGenie substitution to parse a string instead of a Tag Value. i.e. " ' Trend1 ' "


Trend Page trnsetpen assign pens cicode trn pen pagetrend trendpage