User`s manual

Exp-A/D12
Software Reference s 67
Exp-A/D12 Software
The Exp-A/D12 expansion board can only be used with a BL1200,
BL1600, PK2100, or PK2200 controller with the PLCBus functions in
DRIVERS.LIB and functions specific to the Exp-A/D12 in PLC
_
EXP.LIB.
Software drivers are not available for the remaining controllers.
The Signal Table
To use the functions in PLC
_
EXP.LIB, create a î‚“signal tableî‚” by declaring
an array as shown here.
struct signal_rec adtab[size];
The array must be named adtab and it must be global. The constant size
is the number of signals in the table. Plug in the size that the application
needs.
Constants and Data Types
The function library PLC
_
EXP.LIB defines these constants.
#define BREG 0x0200 //add to address for S3B
#define BIPOLAR 0
#define UNIPOLAR 1
The structure signal
_
rec for defining signal tables is also declared in
PLC
_
EXP.LIB.
struct{
int address // 12-bit PLCBus address
byte zero
_
offset // A/D output value at 0v
byte input
_
ch // Input channel to select
byte mode // conversion mode: 1 of 18
byte comp // 0=no comp. 1=do compensate.
float cal
_
coef // Calibration coeff. for
// channel
} signal
_
rec;