The tvPoints object holds the buffer of trend data points (one data point represents the time, value and attribute of a point). If the tvTrend object is connected to a data source by calling the tvTrend.Connect method, then the buffer is filled up automatically on each moving the time axis of the viewer or on calling the TrendsView.ReadData method.
The buffer of data points can be controlled - add, delete, overwrite data points by methods of this object. This is particularly useful when the tvTrend object is not connected to any data source (to a variable in the PmTrend object). Then it is possible, for example, by calling the AddPoints method, to fill up the buffer and it is also possible to do the filling by onReadData viewer event that is called each time the time axis is moved/zoomed.
Dim oPoints, aValues, aTimes, n1, n2
aValues = oPoints.GetValueArray("visible")
aTimes = oPoints.GetTimeArray("visible")
n1 = LBound(arr)
n2 = UBound(arr)
If n2 >= n1 Then
Dim oPoints, vTimes, vValues, vAttrs, tNow
tNow = Now
vTimes = Array(tNow-3/24, tNow-2/24, tNow-1/24, tNow)
vValues = Array(34, 56.6, 13.3, 98)
vAttrs = 0
oTView.TimeSetType = 1
oPoints.AddPoints vTimes, vValues, vAttrs, 0