Applies To:
  • CitectSCADA 5.xx

Summary:
I want to display the date of the Trend Cursor but there is no function to do this. How can I do it?

Solution:
Below is a simple Cicode function that uses the trend functions in the Include project to display the date of the Trend Cursor. Create a new Cicode file in your project and copy in this function, then add a Cicode object to the trend page to call this function. The syntax is -

TrendDspCursorDate(AN,Format)

Where:

AN Is the AN number of the trend (typically 30).

Format Is the date format to be used (see help on TimeToStr() function).

INT
FUNCTION
TrendDspCursorDate(INT hTrendAN, INT iFormat=2)
INT msTime;
    IF TrnGetPeriod(hTrendAN) < 1.0 OR iFormat=6 THEN
        msTime = TrnGetBufMSTime(hTrendAN, 0, TrnGetCursorPos(hTrendAN));
        _TrendDspPenStr(hTrendAN, TimeTostr(msTime, 6));
    ELSE
        _TrendDspPenStr(hTrendAN, TimeToStr(TrnGetCursorTime(hTrendAN, 0),iFormat));
    END
RETURN 0;
END

 

Keywords:
 

Attachments