Promotic
WikipediaLinkedInYoutubeTwitterFacebook

GetLastRefresh - method of the PmaPanel object

Description:
This is used for obtaining the time when this panel requested data (locally or on the web) for the last time.
Syntax:
Date GetLastRefresh()
Note:
This way it is possible to determine whether the panel is currently open (locally or on the web) and then, for example, modify the communication period.
See also:
Example:
The script in the onTick event sets the communication period depending on the open/closed "MainPanel".
JavaScriptVBScriptSelect and copy to clipboard

var nGetLastRefresh = pMe.Pm("/MainPanel").GetLastRefresh();
var oCommGroup = pMe.Pm("/Comm/Group");
var nSecRefresh = 3;  //x second
var nTimeOut = Pm.Time - (1 / 24 / 60 / 60) * nSecRefresh;

if (nTimeOut > nGetLastRefresh)
{
Pm.Debug("slow communication");
oCommGroup.UpdateRate = 5000;
}
else
{
Pm.Debug("fast communication");
oCommGroup.UpdateRate = 1000;
}

History:
Pm9.00.11: Created
PROMOTIC 9.0.13 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