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

TrnScroll

Scrolls the trend pen by a specified percentage (of span), or number of samples.

Syntax

TrnScroll(AN, Pen, nScroll [, nMode] )

AN:

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

Pen:

The trend pen number. Set to -1 for all pens.

nScroll:

The amount by which the trend will be scrolled. Use nMode to specify whether the trend will be scrolled by percentage or by number of samples.

Because the resolution of Client requests is 1 second, requests of millisecond accuracy are rounded to 1 second. For example, if requested to scroll 2 samples of 400 milliseconds (a total of 0.8 seconds), the trend will actually scroll 1 second.

nMode

The type of scrolling to be performed.

1 - The trend will be scrolled by a percentage of span. Default.

2 - The trend will be scrolled by a number of samples. This mode is not available if the user puts the trend into the 'trend span' mode by setting the span. In this case no scrolling would take place; the user needs to use nMode 1.

Return Value

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

Related Functions

TrnSetTime

Example

! Scroll all pens (of the trend at an20) 100% forwards.
TrnScroll(20,-1,100); or TrnScroll(20,-1,100,1);
! Scrolls all pens (of all trends on the current trend page) 300% backwards.
TrnScroll(-1, -1, -300); or TrnScroll(20,-1.-300,1);
!Scrolls all pens (of all trends on the current trend page) 3 samples forwards.
TrnScroll(20,-1,3,2);
!Scrolls all pens (of all trends on the current trend page) 1 sample backwards.
TrnScroll(20,-1,-1,2);

See Also

Trend Functions