Promotic

onDataTrendReady - event of the PmgTrendViewer object

Description:
The event is triggered when viewer got data from server.
The data are intended for the tvTrend object whose tvTrend.ID property equals the value of the pEvent.TrendId parameter.
The event is triggered after receiving and processing the data by the tvTrend object.
Parameters:
pMe(Object) Reference to the PmgTrendViewer object where the event rises.
pEvent(Object) Reference to the object describing detailed information about the specific event.
pEvent.TrendId - (String) [for reading] Identifier of the tvTrend object that obtained the data from server.
See the tvTrend.ID property
Note:
This event is also functional in Web panels.

After a request for the data was sent (i.e. the onReadData event is triggered, e.g. scroll the time axis), the event is triggered so many times how many tvTrend objects are connected to a server (for each tvTrend object once).

Sending the request for the data and receiving the data (together with triggering this event) proceed asynchronously, i.e. after sending the request the viewer operates further, it is controllable, etc.
After the server processes the request, it sends the result back to the viewer and the viewer processes it (the viewer doesn't wait for processing the data by the server, the data can come to the server even with a delay depending on the quality of connection).
Example:
JavaScriptVBScriptSelect and copy to clipboard

var iTrend;
var nCount = pMe.TrendsCount;

for (iTrend = 0; iTrend < nCount; iTrend++)
{
var oTrend = pMe.Trends(iTrend);
Pm.Debug(oTrend.ID + "=" + oTrend.Points.GetValueByIndex(-2, 0));
}

History:
Pm9.00.25: Fixed bug: Did not work the pEvent.TrendId parameter in the Web panel.
PROMOTIC 9.0.27 SCADA system documentation MICROSYS, spol. s r.o.

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