User`s manual
BL160036 s System Development
Driver Software
Z-Worlds 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-Worlds 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 (112).
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-Worlds 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 18 correspond to the signals OUTB1OUTB8. Outputs 914
correspond to OUT1OUT6. Outputs 914 also feed the high-current
driver (HC1HC6).
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 914, 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 (114) and value (0
for OFF, 1 for ON).
A 0 turns the output off, 1 turns the output on. Digital outputs 914
support high-current channels 16.