Promotic
WikipediaLinkedInYoutubeTwitterFacebook

GetTimeByIndex - method of the tvPoints object

Description:
Returns the time of the nIndex-th data point. Specified value of the index depends on the nIndexType parameter and refers either to the whole buffer or only to the visible part of the buffer.
Syntax:
Date GetTimeByIndex(Long nIndex, Long nIndexType)
Calling:
t = oPoints.GetTimeByIndex(nIndex, nIndexType)
Parameters:
nIndex(Long) Index to the buffer array
>=0 - index to the buffer array
-2 - the time of the latest data point is returned
nIndexType(Long) required type of the returned index
0 - index refers to the beginning of the buffer
1 - index refers to the first data point that is displayed by the buffer viewer
Return values:
The method returns the time.

If no point has been found then the method returns: null for JavaScript or Empty pro VBScript (it can be tested by the Pm.IsValid method).

See also:
Example:
JavaScriptVBScriptSelect and copy to clipboard

var oTView = pMe.Items("../TrendView");
var oPoints = oTView.Trends("t1").Points;
var nTime = oPoints.GetTimeByIndex(5, 0);
if (Pm.IsValid(nTime))
Pm.Debug(nTime);
PROMOTIC 9.0.12 SCADA system documentation - MICROSYS, spol. s r.o.

Send page remarkContact responsible person
© MICROSYS, spol. s r. o.Tavičská 845/21 703 00 Ostrava-Vítkovice