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


Gets the value of a trend at an offset for a specified pen. The offset should be a value between -1 and the number of samples displayed on the trend.


TrnGetBufValue(AN, Pen, Offset)


The AN where the trend is located.


The trend pen number:

0 - The pen currently in focus

1...8 - Pen1. . .Pen8


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

-1 means get the last valid value in the display (provided it is less than 1.5 sample periods old).

If there is no invalid or gated sample within the last 1.5 sample periods, it is assumed that a sample has been missed and an invalid trend value is returned. See the TrnIsValidValue function.

Return Value

The trend value. If the actual value is gated or invalid, the standard invalid or gated values are returned (no error is set). You can check this return value using TrnIsValidValue().

Related Functions

TrnGetCursorValue, TrnIsValidValue


! For the trend at AN20
/* Displays the trend value at offset 10 for the pen currently in focus. */

See Also

Trend Functions