User`s manual

BL160036 s System Development
Driver Software
Z-Worlds drivers make it easy to communicate with the BL1600 inputs and
outputs. A direct driver immediately reads or writes to the controlled hardware.
An indirect driver uses intermediate variables. Z-Worlds virtual driver
(described later in this section under Virtual Drivers) is a periodically called
interrupt service routine that connects the hardware with intermediate variables.
Low-level drivers return, send, or transmit values as received or as present-
ed by the hardware interface. High-level drivers modify the inputs or
outputs in some way, such as by introducing calibration, hysteresis or aver-
aging. Indirect, high-level drivers eliminate concerns about the technical
details of the I/O interface, but the price for this convenience is a slight
loss of speed and efficiency.
Digital Inputs
int up
_
digin( int chan )
Gets the value at the specified digital input channel chan (112).
RETURN VALUE: 1 when the input voltage is high (>2.5 V) and 0
when the input voltage is low.
Digital Outputs
There are 14 digital outputs, plus two additional outputs (EN485 and SCL)
that depend on the hardware. Z-Worlds driver software library does not
provide drivers for the additional outputs. CPLC.LIB needs to be modi-
fied to use EN485 and SCL as digital outputs.
Outputs 18 correspond to the signals OUTB1OUTB8. Outputs 914
correspond to OUT1OUT6. Outputs 914 also feed the high-current
driver (HC1HC6).
Bear in mind that the total number of high-current outputs that can be on at
one time is subject to chip power limits and ambient temperature. With the
sinking driver (ULN2003), no more than two 500 mA channels per chip
should be on continuously. All channels can be on at once as long as they
do not consume more than 100 mA per channel. The UDN2985A chips
can drive all channels at 30 V and 250 mA per channel at 25°C.
All 14 digital outputs appear on H2. A 0 makes the output on H2 low; a 1
makes it high. For outputs 914, a 0 switches the high-current output off
and a 1 turns it on. Sinking driver outputs pull low when turned on;
sourcing driver outputs pull high.
int up
_
setout( int channel, int value )
Turns on a digital output. Pass channel number (114) and value (0
for OFF, 1 for ON).
A 0 turns the output off, 1 turns the output on. Digital outputs 914
support high-current channels 16.