User`s manual

Exp-A/D12
Software Reference s 71
int adee
_
wr( int board, int addr, int value )
Writes the EEPROM on the Exp-A/D12 at the specified bus address.
The byte value is written at addr.
The first argument to adee
_
wr is not used. Place the address of the
boards B register on the PLCBus before calling adee
_
wr:
set12adr( board+BREG );
adee
_
wr( unused, addr, value );
The function return value indicates its success or failure:
0 successful write
1 EEPROM hardware error
2 EEPROM write-protect error
Sample Program
The following sample program demonstrates how to read an input signal
on the Exp-A/D12. In this example, the input signal is obtained from the
TEMP pin on U1 and is connected to AN0+ on Wago connector H1. The
TEMP voltage output is proportional to ambient temperature (near the
chip). At room temperature, the pins potential is about 620 mV.
The program reads AN0+ and prints voltages and temperatures, in the
Dynamic C STDIO window. The first step is to create a signal table, which
uses compensation coefficients stored in EEPROM for accurate readings.
Only one sample program is given since Exp-A/D12 functions are not part
of any other library.
These step-by-step instructions explain how to set up the Exp-A/D12, write
and compile the program, and run the sample program to operate the Exp-
A/D12s on a bus.
Use the following steps to run the sample program.
1. Power up the controller and make sure it is working properly. If there
are any problems, consult the controller users manual. Now discon-
nect power from the controller.
2. Connect the Exp-A/D12 to the controller. See Chapter 2, Getting
Started, for details.
3. Check jumpers J1J4 on the Exp-A/D12. Leave header J1 unjum-
pered. Connect pins 23 on headers J2, J3, and J4.
4. Connect a 4" to 6" jumper wire to terminal AN0+ on Wago connector
H1. Push the other end of the wire into the hole for pin 1 of connector
H8. H8 is not normally installed in the board, but you will find the 10
holes for it beside the A/D chip U4. The right-most hole is pin 1 which
is connected to the TEMP output of U1. With a second wire, connect
AN0 to GND (both on H1).