Promotic

GetValueByIndex - method of the tvPoints object

Description:
Returns a value of i-th data point.
The 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:
Variant GetValueByIndex(Long nIndex, Long 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) What refers the nIndex parameter to
0 - refers to the beginning of the buffer
1 - refrers to the first data point that is displayed by the buffer viewer
Return value:
The method returns the value of the data point on the index.
If no point has been found then the method returns: null for JavaScript or Empty for VBScript (it can be tested by the Pm.IsValid method).
Note:
This method is also functional in Web panels.
See also:
Example:
JavaScriptVBScriptSelect and copy to clipboard

var oTView = pMe.Items("../TrendView");
var oPoints = oTView.Trends("t1").Points;
var nVal = oPoints.GetValueByIndex(5, 0);
if (Pm.IsValid(nVal))
{
Pm.Debug(nVal);
}
PROMOTIC 9.0.27 SCADA system documentation MICROSYS, spol. s r.o.

Send page remarkContact responsible person
© MICROSYS, spol. s r.o.