116 Pamux User’s Guide
WATCHDOG REGISTERS
The watchdog feature allows all outputs to be set to a predetermined value upon loss of communication
from the host computer. Each analog output on a B6 can have a watchdog value. Only output module
positions are affected. Note that the jumpers on the B6 must be configured to enable watchdog
operation (see Chapter 3 for details).
The watchdog can be used to set a time interval that a Pamux analog brain board will wait. If the brain
board is not accessed by the host within the interval, the board will enter a watchdog state. In this
condition the analog brain board will set bit 2 in the status register, then output all values contained in
the watchdog registers to their corresponding module positions.
The watchdog registers include a watchdog timer register (low byte and high byte), starting at hex 7A in
RAM, and 16 watchdog value registers (low byte and high byte), starting at location hex 20. Each 16-bit
watchdog register corresponds to a specific module position. On power-up, the watchdog feature is
disabled (watchdog timer register = 0).
To use the watchdog, a value from 1 to 65,535 must be loaded into the watchdog timer register. This
value represents a watchdog time in units of 10 milliseconds (hence, a value of 100 = 1 second). A value
of 0 in the watchdog timer RAM location disables the watchdog.
After loading the watchdog timer register, you should load all watchdog value registers with the values
to output if a watchdog condition occurs. The default value for each location is 0.
As with any internal RAM location, you must first gain access before you can write to the watchdog
registers. You must also release access after you are finished.
IMPORTANT: On a power-up or reset condition, all watchdog registers are set to 0 and must be reinitialized!
The following example configures the watchdog for an analog output. This example assumes that the
channel has been configured previously as an output. The example sets the watchdog time to one
second. It then defines an arbitrary watchdog value of half-scale (50% or &HFFF/2). Such a value makes
it more likely that the watchdog will be noticed when tripped; however, most applications would use a
watchdog value of 0.
To verify that the watchdog works properly, combine this example with the previous, then trip the
watchdog by interrupting the program (hit
PAUSE or CTRL-BREAK). This should cause all outputs configured
with a watchdog to assume their half-scale values.
PROGRAMING WITHOUT THE PAMUX DRIVER