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

TrnSetPeriod

Sets the display period (time base) of a trend. When the period is changed, CitectSCADA reads the historical data to reconstruct the trend data, and refreshes the trend. Every pen has the same display period.

This function clears the span set by the TrnSetSpan() function.

Syntax

TrnSetPeriod(AN, Period)

AN:

The AN where the trend is located. Set to -1 for every trend on the current page.

Period:

The new sampling period (in seconds) of the trend. To set the display period to the sampling period, set this argument to 0 (zero),

Return Value

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

Related Functions

TrnGetPeriod, TrnEcho, TrendSetTimebase, TrendSetSpan

Example

System Keyboard

Key Sequence

## Enter

Command

TrnSetPeriod(20, Arg1)

Comment

Set a new sampling period for the trend at AN20

See Also

Trend Functions