Applies To:
  • CitectSCADA 5.xx

The TrendStats dialogue box on the standard trend page may show incorrect values at runtime under some conditions. As an example, a situation that may result in the error occuring could be as follows:

a) A large amount of trend samples are being used for the calculations which are displayed by the TrendStats dialogue box.

a) Two trend pens are used. The trend page is displaying a nonzero values for one pen and zero values for the other

With this configuration, there may be non-zero statistics on the TrendStats page for both pens even though only one should have had non-zero statistics.


CIT has confirmed this to be a problem in Citect for Windows versions 5.xx. It is caused by a coding error in the include file. This problem has been fixed in Citect version 5.30. For versions of Citect prior to 5.30, the fix can be made manually by changing the line:

REAL grTrnBuf[8][878];


REAL grTrnBuf[8][1800];

at the top of the file within the file, within the default Citect include project, and adding the following lines:

    IF gnSamples > 1800 THEN
        tracemsg("Too many samples "+intToStr(gnSamples));
        gnSamples = 1800;

after the line "gnSamples = _TrendZoomGetSamples(......" in the cicode function TrendPageData within the file file, within the default Citect include project.

The problem is that the array (used to store the sample values in the calculation) is not large enough, and the effect of the above mentioned changes is to increase the size of the array to a much larger value, and to check the array size is not exceeded. If the array size is exceeded, an error message ("Too many samples") will be displayed in the kernel and the Hardware error 259 ("Array has been overrun") will be displayed on the Hardware page.