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

TrnGetBufTime

Gets the time and date of a trend at an offset for a specified pen. The Offset should be a value between 0 (zero) and the number of samples displayed on the trend.

Syntax

TrnGetBufTime(AN, Pen, Offset)

AN:

The AN where the trend is located.

Pen:

The trend pen number:

0 - The pen currently in focus

1...8 - Pen1. . .Pen8

Offset:

The trend buffer offset, in samples. The number of samples can range from 0 to the maximum number of samples that can display on the trend - 1.

Return Value

A time/date variable. If Offset is not within boundaries, 0 (zero) is returned. If AN or Pen is invalid, 0(zero) is returned and an error code is set.

Related Functions

TrnGetCursorTime

Example

! For the trend at AN20
INT time;
time = TrnGetBufTime(20,0,10);
IF time <> 0 THEN
DspText(31,0,TimeToStr(time,2));
END
/* Displays the trend date at offset 10 for the pen currently in focus. The time will display at AN31. */

See Also

Trend Functions