Cicode Programming Reference > Cicode Function Categories > Trend Functions Introduction > TrnSetTime


Sets the end time and date of a trend pen. If you set a time less than the current time, the trend display is set to historical mode and samples taken after this time and date will not be displayed. If you set the time to the current time, for example by using the TimeCurrent or TrendZoom cicode functions, the trend is displayed in real-time mode and samples after this date and time will display.


TrnSetTime(AN, Pen, Time)


The AN where the trend is located, or:

-1 - All trends on the current page

0 - The trend where the cursor is positioned


The trend pen number:

-1 - All pens

0 - The pen currently in focus

1...8 - Pen1. . .Pen8


The end time and date of the trend. Samples taken after this time and date will not be displayed. Set to 0 (zero) to set the trend to the current time (real-time mode).

Return Value

0 (zero) if successful, otherwise an error is returned.

Related Functions

TrnGetTime, TrnSetTime


/* Sets Pen1 to 30 minutes before the current time (30 minutes ago). */
/* Sets the trend to real-time mode. */

See Also

Trend Functions