' Calculate the average of the next two point values.
Sub main()
??????Dim MyPoint as new Point
??????MyPoint.Id = "TANK_TEMPERATURE"??????' Set the Id
??????MyPoint.OnChange??????????????????????????????????' Request point onchange
??????MyPoint.GetNext????????????????????????????????????' Retrieve the first value.
??????x = MyPoint.Value????????????????????????????????' Record the value.
??????MyPoint.GetNext????????????????????????????????????' Wait for the next value.
??????x1 = MyPoint.Value??????????????????????????????' Record the value
??????ave# = (x + x1 )/ 2????????????????????????????' Calculate the average
??????MsgBox "The average was " & str$(ave)
end sub
|