tvPoints - Deatiled object description

See: Object tvPoints

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.

Finding the points (times and values) field in the visible part of the viewer.
Dim oPoints, aValues, aTimes, n1, n2
Set oPoints = oTView.Trends("t1").Points
aValues = oPoints.GetValueArray("visible")
aTimes = oPoints.GetTimeArray("visible")
n1 = LBound(arr)
n2 = UBound(arr)
If n2 >= n1 Then
  Pm.Debug aValues(n1)
  Pm.Debug aTimes(n1)
  Pm.Debug oPoints.Max("visible")
  Pm.Debug oPoints.Min("visible")
  Pm.Debug oPoints.Count("visible")
End If
Let's have a tvTrend object (in the example it is the object with the identifier t1) that is not connected to the data source. The buffer for viewing is filled up by methods.
Dim oPoints, vTimes, vValues, vAttrs, tNow
Set oPoints = oTView.Trends("t1").Points
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
© MICROSYS, spol. s r. o.Tavičská 845/21 703 00 Ostrava-Vítkovice