
Watchdog NVSH_WDTIMER.NVE

Programming:

  nvgenprinter:
    ######################=########################
    [WatchDog]
    WatchDogActive=1
    WatchDogString=$
    FindWatchDogStringInBuffer=0
    FindBufferInWatchDogString=0
    StartAlarm=7904
    Timeout=5                            <--- Attention
    SleepAfterAlarm=1                    <--- Attention
    ######################=########################

Serial channel (nvgenprinter) starts after the programmed timeouts the
Watchdog Alarm (7904).

  Alarm 7904:
    Alarm Name: Watchdog Trigger BMA
    Empty Group 
    Extended Settings/Start Command: "nvsh_wdtimer 1 -i4<ALARMKEY>
    Alarm Report/Do not show this alarm in the alarm viewer list

In the Alarm 7904 there is started the script nvsh_wdtimer.nve with the parameter 
<ALARMKEY> in i4. 
There for the module nvsh_wdtimer.nve can select its programming from the INI-file.

  nvsh_wdtimer.ini
    ; set for alarm
    [7904]
    ; set RunLevel at startup to 0
    RunLevel=0
    ; timeout for GOOD Alarm after watchdog string is received again.
    WD_GoodTimeout=120
    ; sleep after a Watchdog alarm
    SleepAfterAlarm=600
    ; Alarm number for the Watchdog alarm.
    WDog_Alarm=7905
    ; Alarm (Message) for Watchdog OKAY again.
    WDog_Okay=7906
    ; internal timer values
    WD_Timer=4E9A9B20
    WD_Last=4E9A9AA2

Every time the nvsh_wdtimer is started from the alarm it detects if one copy is running.
the first copy of the module keeps running an do the work. 
Check the difference of the values and start the appropriate alarms.
The module stops at the end of his work automatically after starting the GOOD alarm.

If the modules is started if one copy is running, this copy set the value WD_Timer and
stops himself automatically.

