Promotic
WikipediaLinkedInYoutubeTwitterFacebook

onTimeChange - event of the PmaRoot object

Description:
The event is triggered on the change of the computer system time. Fires only if the change is greater than 5 seconds.
Parameters:
pMe(Object) Reference to the PmaRoot object where the event rises.
pEvent(Object) Reference to object describing detailed information about the specific event.
pEvent.DiffSec - (Long) Difference of the change in seconds. When the time changes forward, the value is positive, when backward, it is negative.
pEvent.OldTime - (Date) Time after which the change occurred.
Note:
The time change is detected by PROMOTIC system in the following way. The internal clock of the PROMOTIC system ticks with the specific period (about 10 ms). Every tick the system finds out the daytime and stores it. It compares it with the time of the previous tick and if the difference is greater than 5 seconds, then PROMOTIC system concludes from this that the time changed. In very extreme cases when somebody stopped the PROMOTIC application for 5 seconds, the PROMOTIC could invoke this event even if no time change occurred.
See also:
- Pm.Time (property)
Example:
JavaScriptVBScriptSelect and copy to clipboard

var nDiff = Pm.Abs(pEvent.DiffSec);
if (nDiff >= 5)
Pm.Debug("Time differencion >= 5 second");
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