Promotic
WikipediaLinkedInYoutubeTwitterFacebook

WDogRefresh - method of object Pm

Description:
Refresh of the WatchDog program counter.
Syntax:
WDogRefresh(nProgram As Long, nCounter As Long)
Calling:
Pm.WDogRefresh nProgram, nCounter
Parameters:
nProgram(Long) number of the application (from 1 to 5) in PmWatchDog.ini
nCounter(Long) value which the WatchDog counter is set to
Note:

WatchDog.exe is a program that watches up to 5 applications. Each application can have set up its own counter in the WatchDog program. WatchDog decreases these counters in regular interval (decrements the value by 1). If some counter reaches the value 0, the WatchDog presumes that the application stops off (the application halted or somebody terminated it, etc.) and restart it over again (or restart the whole OS Windows).

So as the WatchDog wouldn't restart the PROMOTIC application, the application must regularly call the WDogRefresh method. This application sets its counter in the WatchDog program to the nCounter value. The nCounter value must be big enough so as the WatchDog wouldn't zeroized the counter before the application calls the WDogRefresh method over again.

 
This method is not functional for Web Panels.
Example:
In the PmWDog.ini configuration in the [Global] section it is set the key: Period=1000 (i.e. WatchDog will decrement the counters every 1000 ms) and this application is specified in the [Program1] section. Then this application will call every 10 seconds (e.g. in the PmTimer object) the method:
Pm.WDogRefresh 1, 20
By this the program1 counter is set to 20 every 10 seconds. WatchDog will decrease this value every second. If the application is halted, the WatchDog would restart it by 20 seconds.
Navigation:
 
- Pm
 
- Abs
- Cos
- E
- Exp
- LN2
- PI
- Pow
- Sin
- Tan
- WDogRefresh
 
 
© MICROSYS, spol. s r. o.Tavičská 845/21 703 00 Ostrava-Vítkovice