User`s manual

BL160040 s System Development
The following function call in the BL16XX.LIB library initializes the
virtual I/O.
void VIOInit();
Initializes virtual I/O. This dummy function is used as a host for the
global initialization of the virtual I/O variables. Virtual inputs are read
and virtual outputs are written whenever VIODrvr() is called. The
inputs are DIGIN1 to DIGIN16, and the outputs are OUT1 to OUT16.
Two inputs have to be same for two consecutive reads in order to be
valid.
void VIODrvr();
This virtual I/O driver updates the virtual inputs DIGIN1 to DIGIN16.
The virtual outputs OUT1 to OUT16 are sent to their corresponding
output ports.
The following switches turn off services of the virtual driver. If used, they
must precede driver calls. To avoid disabling the service, leave the switch
undefined.
#define NOTIMERS
Disables the virtual timers. The virtual timers are software timers,
useful in ladder logic programming.
The following preprocessor variables control features of the virtual driver.
#define N_WATCHDOG nn
Specifies the number of virtual watchdog timers. Each virtual watch-
dog has a counter that has to be reloaded. If the counter for any virtual
watchdog counts down to zero, a hardware reset is forced. Use
up
_
wdoghit( int watchdog, byte count )
where count is the number of ticks (25 ms) to countdown, to reload a
virtual watchdog. You can monitor a virtual watchdog wdog, if
necessary, by reading the internal variable lc_wdogarray[wdog-1].
The program VWDOG.C in the SAMPLES\CPLC subdirectory illustrates
the use of virtual watchdog timers.
#define RUNKERNEL
Requests the real-time kernel. It will be initialized.