Applies To:
  • CitectSCADA 1.00 1.01 1.10 1.11 1.20 2.00 2.01 3.00 4.10

Summary:
I'm trying to make a fast trending package. I can gather the data as fast as they want and I can do everything except put it on the screen.

I have also got it working with DspTrend, but, this doesn't display the trend on the screen until .... I don't know what triggers the display. I think that it is when the trend has enough samples in it to display a complete trend, but this seems erratic to me and does not initially display on the screen at the same time, each time. Once it is being displayed, I can get about a 100ms update time fairly consistently, depending on the size of the trend object and how many pens.

Do you know what it is that triggers the display on the screen of the trend? Can I force it onto the screen immediately.

 

Solution:
DspTrend is optimized so that it will not display anyting until it has its first set of samples. Eg say the trend has 100 samples. If DspTrend did not do this then when displaying the trend for the first time, it would draw it 100 times as you added each sample. So the first 99 times you call DspTrend, it will just remember the data and not display it on the screen.

Anyway you can work around this by either:

  1. You must have the data in an array somewhere, eg MyData[100]; so on first display, grab all the data and call DspTrend():

// display the stored data, called on display of page
FOR i = 0 to 100 DO
   DspTrend(hAn, "Loops", MyData[i]);
END

// display new samples every 300ms
WHILE TRUE DO
// Shift MyData down and grab new sample
   TableShift(MyData, 100, 1);
   MyData[99] = MyFastData;
   DspTrend(hAn, "Loops", MyData[99]);
   SleepMS(300);
END

  1. If you don't store the data in an array, eg you just sample it onthe fly then push in dummy data to fill the trend.

// fill up the trend.
FOR i = 0 to 100 DO
   DspTrend(hAn, "Loops", 0);
END

// display new samples every 300ms
WHILE TRUE DO
   DspTrend(hAn, "Loops", MyFastData);
   SleepMS(300);
END


Keywords:
 

Attachments