Promotic
WikipediaLinkedInYoutubeTwitterFacebook

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 object describing detailed information about the specific event.
pEvent.TrendId - (String) identification of the trend object that obtained the data from a server. See tvTrend.ID
Note:
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 invoking 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 the connection).

Example:
JavaScriptVBScriptSelect and copy to clipboard

var i;
var nCount = pMe.TrendsCount;

for (i = 0; i < nCount; i++)
{
var oTrend = pMe.Trends(i);
Pm.Debug(oTrend.ID + " = " + oTrend.Points.GetValueByIndex(-2, 0));
}
PROMOTIC 9.0.12 SCADA system documentation - MICROSYS, spol. s r.o.

Send page remarkContact responsible person
© MICROSYS, spol. s r. o.Tavičská 845/21 703 00 Ostrava-Vítkovice