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

TrnGetMSTime

Gets the time (in milliseconds from the previous midnight) of the trend (plotted by a specified pen) at a percentage along the trend, using the time and date of the right-most sample displayed. The time associated with the right-most sample displayed is known as the end time. The start time is the time of the left-most sample displayed. Percent 0 (zero) will correspond to the end time, and Percent 100 will correspond to the start time

Syntax

TrnGetMSTime(AN, Pen, Percent)

AN:

The AN of the chosen trend.

Pen:

The trend pen number:

0 - The pen currently in focus

1...8 - Pen1. . .Pen8

Percent:

The percentage of the trend from the time and date of the right-most sample displayed (end time), from 0 to 100.

Return Value

The number of milliseconds since the previous midnight. Zero (0) is returned if an error is detected.

Related Functions

TrnGetTime

Example

! For Pen 1 at AN20
STRING timeStr;
STRING msecStr;
timeStr = TimeToString(TrnGetTime(20,1,100),2) + " ";
msecStr = TimeToString(TrnGetMSTime(20,1,100),6);
DspText(31,0,timeStr + msecStr);

returns

"23/02/01 10:53:22.717"

See Also

Trend Functions