LABPC(4)

NAME
labpc - National Instruments LABPC and LABPC+ driver

SYNOPSIS
device labpc0 at isa? port 260 tty irq 5 vector labpcintr

DESCRIPTION
This supports the National Instruments LABPC and LABPC+ Low-Cost Multifunction I/O Board.

This board provides 8 12 bit A-D input channels, 2 12 bit D-A output channels, and 3 8 bit digital I/O ports. It also supports setting up the National Instruments SCXI bus off the digital I/O ports, although that software is currently present in an external program and not as part of the driver.

The selection of the input or output device, mode, and channel is through the minor number: The 8 bit minor number format is UUSIDCCC, with UU: Board unit. S: SCAN bit for scan enable. I: INTERVAL for interval support D: 1: Digital I/O, 0: Analog I/O CCC: The channel selector: ANALOG: input: channel must be 0 to 7 for AD0 ... AD7 output: channel must be 0 to 2 0: D-A 0 1: D-A 1 2: Alternate channel 0 then 1 DIGITAL: input: Channel must be 0 to 2. output: Channel must be 0 to 2.

The /dev/MAKEDEV script will make the basic analog and digital devices if you do "sh MAKEDEV labpcaio" and "sh MAKEDEV labpcdio", however, it won't make device entries for INTERVAL and SCAN devices. SCAN devices automatically scan over all channels from the channel number down to 0 (for example, a SCAN for /dev/ad7 will read channels AD7 ... AD0) while the INTERVAL device will wait for an external signal and then read all the channels from the selected channel number down to 0 as fast as it can. This is done by the hardware and not the driver (other than turning it on); See the LabPC+ User's Manual and the source code if this doesn't make sense to you.

The driver supports several general analog I/O ioctl calls. These are defined in sys/dataacq.h and are intended to be implemented in other data acquisition board device drivers.

AD_MICRO_PERIOD_SET takes a pointer to a long argument specifying the number of microseconds between samples.

AD_MICRO_PERIOD_GET takes a pointer to a long argument and returns the current number of microseconds between samples.

AD_NGAINS_GET takes a pointer to an integer and returns the number of different gain settings the board supports. This is 8 for the LabPC board.

AD_NCHANS_GET takes a pointer to an integer and returns the number of channels the board supports. This is 8 for the LabPC board.

AD_SUPPORTED_GAINS returns an array of NGAINS (the number obtained by AD_NGAINS_GET) doubles. These are the gains the board supports.

AD_GAINS_SET takes an array of NCHANS (the number obtained by AD_NCHANS_GET) integers and sets the board gains. These are indices into the supported gain array, with one gain for each channel.

AD_GAINS_GET takes an array of NCHANS (returned by AD_NCHANS_GET) integers and returns the cuurrent board gains.

BUGS
In general, only those capabilities that I needed are present. In particular the following notable restrictions are present.

The analog input is only supported in a clocked conversion mode.

You can only set the sample clock down to 15 Hz. Anything slower needs a modification to the driver to support TCINTEN in order to chain together the counters to get a lower clock rate.

There is no support for clocked D-A output.

The 8255 providing the digital I/O ports is supported only in mode 0 (three 8 bit ports).

There is support for the SCXI bus off the LABPC board. It is not in the driver but is a separate user process that accesses the digital I/O devices. Ask dufault@hda.com for it.

MAKEDEV only makes the "basic" devices. You must make the INTERVAL or SCAN devices by hand.

The INTERVAL device sets the clock rate as high as possible so that it samples all the channels as quickly as it can after the external signal. This is a silly restriction; it should simply use the clock setting.

CAVEATS
National Instrument's (like most other laboratory grade board vendors) definition of Low-Cost differs dramatically from many on the net.