XP8 500 Exp -A/D 12 XP8500 and Exp-A/D12 Analog-to-Digital Conversion Expansion Boards Users Manual Revision B
XP8500 and Exp-A/D12 Users Manual Part Number 019-0055 Revision B Last revised on April 9, 1999 Printed in U.S.A. Copyright © 1999 Z-World All rights reserved. Z-World reserves the right to make changes and improvements to its products without providing notice.
TABLE OF CONTENTS About This Manual vii XP8500 Chapter 1: Overview 13 Chapter 2: Getting Started 15 Chapter 3: I/O Configurations 19 Chapter 4: Software Reference 33 XP8500 Components ........................................................................... 16 Connecting Expansion Boards to a Z-World Controller ...................... 17 Setting Expansion Board Addresses .................................................... 18 XP8500 Addresses ......................................................
Exp-A/D12 Chapter 5: Overview 51 Chapter 6: Getting Started 53 Chapter 7: I/O Configurations 59 Chapter 8: Software Reference 65 Exp-A/D12 Components ...................................................................... 54 Connecting Expansion Boards to a Z-World Controller ...................... 55 Setting Expansion Board Addresses .................................................... 56 Exp-A/D12 Addresses ..................................................................... 56 Power .............
APPENDICES Appendix A: PLCBus 75 Appendix B: Specifications 87 Appendix C: Connecting and Mounting Multiple Boards 93 Appendix D: Simulated PLCBus Connection 97 Appendix E: Technical Circuit Details 99 PLCBus Overview ............................................................................... 76 Allocation of Devices on the Bus ........................................................ 80 4-Bit Devices ..................................................................................
Blank vi s Contents XP8500 and Exp-A/D12
ABOUT THIS MANUAL This manual provides instructions for installing, testing, configuring, and interconnecting the Z-World XP8500 and Exp-A/D12 analog-to-digital conversion expansion boards. Instructions are also provided for using Dynamic C functions. Assumptions Assumptions are made regarding the user's knowledge and experience in the following areas: Ability to design and engineer the target system that is controlled by a controller with analog-to-digital conversion expansion boards.
Acronyms Table 1 lists and defines the acronyms that may be used in this manual. Table 1.
Conventions Table 3 lists and defines the typographical conventions that may be used in this manual. Table 3. Typographical Conventions Example Description while Courier font (bold) indicates a program, a fragment of a program, or a Dynamic C keyword or phrase. // IN-01… Program comments are written in Courier font, plain face. Italics Indicates that something should be typed instead of the italicized words (e.g., in place of filename, type a file’s name).
Blank x s About This Manual XP8500 and Exp-A/D12
XP8500
Blank
CHAPTER 1: OVERVIEW Chapter 1 provides an overview and description of the XP8500 analog-todigital conversion expansion boards.
The XP8500 provides 11 channels of 12-bit analog-to-digital (A/D) conversion, with onboard signal conditioning for four of these channels to match the input voltage range between 0 V and 10 V. Gain and bias resistors may be selected and installed by the user to determine the voltage ranges of the conditioned input signals.
CHAPTER 2: GETTING STARTED Chapter 2 provides instructions for connecting XP8500 expansion boards to a Z-World controller. The following sections are included.
XP8500 Components The XP8500 boards offer eleven channels of 12-bit analog-to-digital conversion. Figure 2-1 illustrates the basic layout and orientation of components, headers, and connectors. Regulator J5 J4 U8 U9 J3 C11 U7 PAL U6 U5 H2 P1 P2 U3 U2 RP4 U1 RP3 Gain and Bias Resistors H1 J2 J1 Figure 2-1.
Connecting Expansion Boards to a Z-World Controller Use the 26-conductor ribbon cable supplied with an expansion board to connect the expansion board to the PLCBus on a Z-World controller. See Figure 2-2. The expansion boards two 26-pin PLCBus connectors, P1 and P2, are used with the ribbon cable. Z-World recommends using the cable supplied to avoid any connection problems. Controller PLCBus Port U8 U9 C11 J3 U7 PAL Pin 1 U6 U5 P1 H2 1 U3 U2 U1 P2 H1 XP8500 Controller With PLCBus Figure 2-2.
4. Each expansion board comes with a factory-default board address. If more than one expansion board of each type is to be used, be sure to set a unique address for each board. $ The following section on Setting Expansion Board Addresses, and Chapter 4, Software Reference, provide details on how to set and use expansion board addresses. 5. Power may be applied to the controller once the controller and the expansion boards are properly connected using the PLCBus ribbon cable.
CHAPTER 3: I/O CONFIGURATIONS Chapter 3 describes the built-in flexibility of the XP8500 expansion boards, and describes how to configure the available inputs/outputs. The following sections are included.
XP8500 Pin Assignments The XP8500s eleven 12-bit analog-to-digital converter channels are accessed through Wago connector H1 (conditioned channels CH0CH3) and header H2 (unconditioned channels AIN4AIN10), as shown in Figure 3-1. The bias voltage set by J1, VREF+, is available on header H2, and +5 V (analog) is available on both Wago connector H1 and header H2.
Jumpers pins 12 of both headers J1 and J2 are used to select the absoluteconversion mode where the input signal is compared against an accurate fixed voltage reference. With this setting, 2.5 V from the precision voltage reference goes to both the A/D converter chip and to the op-amp bias networks.
How to Set Up An XP8500 Conditioned Inputs (CH0CH3) Signals from devices connected to a conditioned input channel on H1 go to an inverting input on one of the four op-amps in U2, as shown in Figure 3-3. User-selectable precision resistors R1 through R8 (Rg and Rbias) set the gain and bias voltages of the op-amps to match the voltage range of the input to the fixed 2.5 V range of the A/D converter chip. 0.
R2 R1 R4 R6 R8 R3 R5 CH1 CH2 CH3 CH0 R7 Bias Resistors Gain Resistors Figure 3-4. Location of XP8500 Gain and Bias Resistors Table 3-1 provides values for the gain and bias resistors for a range of input voltages. The section on Selecting Gain and Bias Resistors at the end of this chapter provides a detailed explanation on how to calculate these values for a particular range of input voltages. Table 3-1.
Excitation Resistors Some transducers, such as thermistors, require an excitation voltage, particularly in some ratiometric applications. These excitation voltages are set using excitation resistors in the RP2 sockets, as shown in Figure 3-5. Either a resistor pack or individual resistors may be used. +5 V +5 V +5 V +5 V CH0 CH1 CH2 CH3 RP2 RP2 RP2 RP2 Figure 3-5.
Unconditioned Inputs (AIN4AIN10) The seven unconditioned input channels, AIN4AIN10, use 10 kΩ pulldown resistors at R9R15 as shown in Figure 3-7 to keep the inputs from floating when they are not being used. U3 A/D Converter AIN [4 –10] 10 kΩ VREF+ +5ANA Figure 3-7. Schematic of XP8500 Unconditioned Inputs These channels are accessed with software by inserting the desired channel number in the library functions that control the XP8500. These channels are located on header H2.
selected. The normal operating current of the A/D converter chip is 1 mA to 2.5 mA. This consumption drops to 4 µA to 25 µA when the chip is in a power-down mode. The reduction represents only about 1020 percent of the XP8500 boards analog supply current and none of its digital supply current Drift The AD680JT voltage reference experiences a voltage drift of 10 ppm/°C (typ) to 30 ppm/°C (max). This drift corresponds to 25 mV/°C to 75 mV/°C, or 1.75 mV to 5.25 mV over the temperature range of 0°C to 70°C.
Selecting Gain and Bias Resistors The section How to Set Up An XP8500 provided representative values of gain and bias resistors for the XP8500s conditioned channels. This section provides a detailed explanation on how to calculate these values for a particular range of input voltages. Figure 3-8 shows a schematic representation of the signal conditioning for channels CH0CH3. 0.
Given a range of 10 V for the input voltage, Equation (E-1) fixes the amplifiers gain at 0.25. This gain correctly scales the input signals range to the op-amps 2.5 V maximum output range. Therefore, Rg must be 2500 Ω. Step 2. Calculate Bias Resistance Next, if the op-amp is to servo its output properly around the desired center voltage, the appropriate bias voltage needs to be established at the op-amps noninverting input.
Step 4. Bracket Input Range To be sure of measuring signals accurately at the extremes of the range of input voltages, be aware of the interaction between the 10 kΩ fixed resistors, RP3RP4, and the gain and bias resistors, R1R8. Ideally, a signal at the minimum input level would be output to the A/D converters input at the maximum expected value of 2.5 V (remember that U2 is an inverting op-amp). But real-world resistor values vary within their rated tolerances.
Out of range 2.5 A/D Converter Input (V) A/D converter's input voltage limit Op-amp output voltage deviation arising from resistor variations Out of range 0 XP8500 Input (V) 10 Figure 3-9. Effects on A/D Converter Input from Adjusting Resistor Values Then measure the voltages at VR0- and at the U2 op-amp output. Because the currents through the input resistor and Rg are essentially identical, the ratio of the voltages across the resistors is equivalent to the ratio of the resistances.
Step 7. Calibrate the A/D Converter Regardless of whether the mathematically derived resistance values or the scaled resistance values are found, the inherent component-to-component variations of 5% or 1% resistors can completely swamp the 0.25% resolution of the A/D converter. To achieve the highest accuracy possible, the A/D converter itself must be calibrated.
Step 8. Recalibrate the XP8500 To recalibrate an XP8500, apply two known test voltages to each channel, chan, to be used. Get the converted reading for each test voltage and pass the readings and the test voltages, to the function adc4_compute to calculate the conversion coefficients, zero_offset and invgain, for that channel. adc4_compute will automatically store the coefficients in an adc4coeff structure (be sure to declare an adc4coeff structure for each channel to be calibrated).
CHAPTER 4: SOFTWARE REFERENCE Chapter 4 describes the Dynamic C functions used to initialize the XP8500 expansion boards and to control the resulting analog-to-digital conversions. The following major sections are included.
Expansion Board Addresses Up to 16 XP8500s may be addressed individually over a single PLCBus. Each XP8500 has a 12-bit address. The address is determined by the encoding of PAL chip U9 on the board and by the jumper connections on headers J4 and J5. Four different PALs are available and the jumpers can be set four different ways, giving 16 unique addresses in the form 0000 1100 pqxy where the PAL determines pq while and the jumper connections on headers J5 and J4 determine x and y, respectively.
XP8500 Software This section describes a set of simple software functions to use when controlling the XP8100 Series expansion board inputs/outputs. Dynamic C Libraries Several Dynamic C function libraries need to be used with the routines defined in this chapter. There are specific libraries designed for certain controllers and there are three common libraries used by all Z-World controllers. Table 4-1 identifies which libraries must be used with particular Z-World controllers. Table 4-1.
Initialization Software These Dynamic C functions are used to initialize the PLCBus. Call these functions before using other expansion board functions. VdInit() Initializes the timer mechanism. LIBRARY: VDRIVER.LIB void eioResetPlcBus() Resets all expansion boards connected to the PLCBus. When using this function, initialize timers with VdInit() before resetting the PLCBus. All PLCBus devices must reset before performing any subsequent operations. LIBRARY: EZIOPLC.
XP8500 Drivers Use the software drivers in this section to interface with the XP8500. int plcXP85Init( unsigned Addr ) Resets the selected XP8500 and reads back the associated calibration coefficients into an internal array. PARAMETER: Addr is the jumper-selected address of the board (0 7). RETURN VALUE: 0 if the reset is successful, -1 if the board cannot be found. LIBRARY: EZIOPBDV.LIB int plcXP85In( unsigned int address ) Reads an XP8500 A/D converter channel.
int eioAdcMakeCoeff( struct _eioAdcCalib *cnvrsn, unsigned d1, unsigned d2, float f1, float f2 ) Takes raw values and actual values of two data points, and computes the calibration coefficients. The function assumes the data points are linear. PARAMETERS: cnvrsn is a pointer to a calibration structure that stores the coefficients. d1 is the raw value for the first data point. d1 should be a whole number from 0 to 4095. d2 is the raw value for the second data point.
int plcXP85WrCalib( int Addr, struct _eioAdcCalib *pCalib ) Writes a calibration structure to the EEPROM storage corresponding to a channel on the XP8500. PARAMETERS: Addr is 16*board_address + channel_number. board_address ranges from 03, depending on the address jumpers, and channel_number ranges from 010, depending on the A/D channel number. pCalib points to a calibration structure, which should be initialized by calling eioAdcMakeCoeff. LIBRARY: EZIOPBDV.
int adc4_set( unsigned int board_adr, int chan ) Sets the A/D converter chip to the specified channel (chan). PARAMETERS: board_adr is the physical address of the XP8500 board, defined as 0000 1100 ppxy. chan ranges from 0 to 10, corresponding to the boards 11 A/D channels. Passing chan = 11 will return (VREF+ VREF)/2, passing chan = 12 will return VREF, passing chan = 13 will return VREF+, and passing chan = 14 will put the boards A/D chip, a TLC2543, into software power-down mode.
int adc4_sample( unsigned int board_adr, int chan, int count, int *buf, unsigned int divider ) Samples data from an A/D chan at uniform intervals of time. PARAMETERS: board_adr is the physical address of the XP8500 board, defined as 0000 1100 ppxy. chan ranges from 0 to 10, corresponding to the boards 11 A/D channels.
float adc4_convert( int data, struct adc4coeff *cnvrsn ) Converts A/D data read by adc4_read( ) or adc4_set ( ) into voltage equivalent. An adc4coeff structure pointed to by cnvrsn stores the conversion constants for this function. The voltage is voltage = cnvrsn->invgain * ( cnvrsn->zero_offset data). RETURN VALUE: voltage value of the A/D data. int adc4_readcoeff( unsigned int board_adr, int chan, struct adc4coeff *cnvrsn ) Reads the constants for converting A/D data to voltages.
int adc4_compute( struct adc4coeff cnvrsn, int data1, float volt1, int data2, float volt2 ) Computes the zero_offset and invgain for the adc4coeff structure pointed to by cnvrsn. The function computes the constants zero_offset and invgain based on A/D readings of two known input voltages to allow input data to be corrected later using the formula voltage = invgain * ( zero_offset data) . data1 is the raw A/D reading for the known input voltage volt1.
Correcting Readings The structure adc4coeff that holds the constants for correcting readings is defined as follows. struct adc4coeff { int zero_offset; float invgain; } This structure must be declared in an application. The following equation, which the function adc4_convert uses, adjusts A/D data from any channel voltage to correct for gain and offset errors. voltage = invgain * ( zero_offset A/D data).
ADC4SMP1.C #if (BOARD_TYPE == CPLC_BOARD) || (BOARD_TYPE==L_STAR) #use cplc.lib // Program runs on PK2200 // and PK2100 controllers // only. #endif main(){ struct struct struct struct adc4coeff adc4coeff adc4coeff adc4coeff adc4conv0; adc4conv1; adc4conv2; adc4conv3; // Structs needed // only if you // use calibration // constants to // convert raw A/D // data to voltages. int data0, data1, data2, data3;// Raw data. unsigned int adc4_board; // Brd address.
adc4_readcoeff(adc4_board, 2, &ADC4conv2); // read cal for chan2 adc4_readcoeff(adc4_board, 3, &ADC4conv3); // read cal for chan3 printf(“Chan0 Calibration, zero_offset = %d, invgain = %f\n”, ADC4conv0.zero_offset, ADC4conv0.invgain); printf(“Chan1 Calibration, zero_offset = %d, invgain = %f\n”, ADC4conv1.zero_offset, ADC4conv1.invgain); printf(“Chan2 Calibration, zero_offset = %d, invgain = %f\n”, ADC4conv2.zero_offset, ADC4conv2.
Advanced XP8500 Programming PLCBus-Level Communication Dynamic C functions perform the bus-level operations described here. A program controls and communicates with an XP8500 though the PLCBus interface register, a reserved memory location. This global register occupies a single address on the PLCBus.
The control program must input a series of 4-bit nibbles to read a converted value from a selected XP8500s serial A/D converter chip or serial EEPROM. Again, each nibble can carry only one bit of data or control information. Each 4-bit nibble read back from an XP8500 during a BUSRD0 cycle has the following format.
EXP-A/D12
Blank
CHAPTER 5: OVERVIEW Chapter 5 provides an overview and description of the Exp-A/D12 analogto-digital conversion expansion boards.
The Exp-A/D12 provides eight channels of 12-bit analog-to-digital (A/D) conversion. The eight channels can be read as eight differential signals with software-selectable gain, or as 16 single-ended signals with unity gain. In addition to unity gain, programmable gains of 2, 6, 22, 42, 102, and 202X may be selected. Each Exp-A/D12 board is factory-calibrated. Compensation coefficients for all A/D channels are stored in the boards EEPROM. The EEPROM can be read or written by an application.
CHAPTER 6: GETTING STARTED Chapter 6 provides instructions for connecting Exp-A/D12 expansion boards to a Z-World controller. The following sections are included.
Exp-A/D12 Components The Exp-A/D12 expansion boards offers eight channels of analog-todigital conversion. Figure 6-1 shows the basic layout and orientation of components, headers, and connectors. J1 U8 U7 PAL U9 J3 Latch EEPROM RP1 U13 RP3 C3 U1 Prec. +2.
Connecting Expansion Boards to a Z-World Controller Use the 26-conductor ribbon cable supplied with an expansion board to connect the expansion board to the PLCBus on a Z-World controller. See Figure 6-2. The expansion boards two 26-pin PLCBus connectors, P1 and P2, are used with the ribbon cable. Z-World recommends using the cable supplied to avoid any connection problems. Controller PLCBus Port PAL Latch PAL Pin 1 C3 ADC P1 MUX MUX 1 Exp-A/D12 P2 Controller With PLCBus Figure 6-2.
4. Each expansion board comes with a factory-default board address. If more than one expansion board of each type is to be used, be sure to set a unique address for each board. $ The following section on Setting Expansion Board Addresses, and Chapter 8, Software Reference, provide details on how to set and use expansion board addresses. 5. Power may be applied to the controller once the controller and the expansion boards are properly connected using the PLCBus ribbon cable.
( Exp-A/D12 Exp-A/D12 expansion boards are available with the modifications for a +12 V controller done at the factory. For more information, call your Z-World Sales Representative at (530) 757-3737.
Blank 58 s Getting Started Exp-A/D12
CHAPTER 7: I/O CONFIGURATIONS Chapter 7 describes the built-in flexibility of the Exp-A/D12 expansion boards, and describes how to configure the available inputs/outputs. The following sections are included.
Exp-A/D12 Pin Assignments The Exp-A/D12s eight 12-bit analog-to-digital converter channels are accessed through Wago Connectors H1 and H2, as shown in Figure 7-1. GND V– VREF VCC V+ DCIN EX4 EX1 AN0 AN1 AN2 AN3 AN4 AN5 AN6 AN7 GND + – + – + – + – + – + – + – + – H1 H2 H5 Figure 7-1. Exp-A/D12 Wago Connectors H1, H2, and H3 Wago connector H5 provides excitation voltages for devices connected to the Exp-A/D12.
How to Set Up An Exp-A/D12 The Exp-A/D12 has four headers for jumper connections, J1J4 (J5 is unused). Jumpers are used on header J1 to set the boards PLCBus address, as explained in Chapter 4, Software Reference. Jumpers on header J2 specify the +5 V power supply for the boards analog circuits, which is normally derived from the +24 V on the PLCBus. When a +12 V controller is used, power cannot be obtained from U10, and connecting pins 12 on header J2 then routes VCC to the analog circuits.
The Exp-A/D12s eight inputs (ANx+ and ANx) are routed to the U4 A/D converter chip by two analog multiplexers (MUX) and several differential amplifiers, as shown in Figure 7-3. Gains of unity, 2, 6, 22, 42, 102, and 202X can be software selected. AN[0-3]+ AN[0-3]– MUX + – U11 AN[4-7]+ AN[4-7]– + MUX CH0 CH1 IN+ IN– 2X – EEPROM A/D Converter G1 +V Reg -5 V –V Reg CH2 U12 202X G2 22X G3 42X G4 102X G5 6X G6 +V +5 V CH3 +2.
The A/D Converter The A/D converter chip, a 12-bit LTC1294, can be programmed to convert a signal at one of its input pins in either of two modes: bipolar or unipolar. Bipolar Modeinput range -2.5 V to +2.5 V, output range -2048 to +2047. Unipolar Modeinput range 0 V to +2.5 V, output range 0 to 4095. If necessary, a resistor network can be used to scale a voltage input to the required range.
Blank 64 s I/O Configurations Exp-A/D12
CHAPTER 8: SOFTWARE REFERENCE Chapter 8 describes the Dynamic C functions used to initialize the Exp-A/D12 expansion boards and to control the resulting analog-to-digital conversions. The following major sections are included.
Expansion Board Addresses The 12-bit address of a particular Exp-A/D12 is determined by the encoding of PAL U7 and by jumpers on header J1. Sixteen different PALs are available and J1 can be set four different ways, giving 64 unique addresses in the form 000p 10px ppRy where R = 0 for register S3A, 1 for register S3B y = 1 when J1 pins 34 are not connected x = 1 when J1 pins 12 are not connected and pppp is determined by the PAL. PALS are numbered FP04600 for pppp = 0000 through FP046F0 for pppp = 1111.
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.
A/D Conversion Modes When reading the Exp-A/D12, specify the desired gain and polarity (unipolar or bipolar) by selecting a particular A/D Mode from Table 8-1. There are 18 different A/D modes listed. ANx is one of the eight multiplexed input signals, where x ranges from 0 to 7. Table 8-1. Exp-A/D12 A/D Conversion Modes Mode Gain 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 1X 1X 2X 202X 22X 42X 102X 6X 1X 1X 2X 202X 22X 42X 102X 6X 1X 1X A/D Converter Chip Reads...
General Exp-A/D12 Functions There are several functions specific to Exp-A/D12 boards in PLC_EXP.LIB. Use the higher level functions that reference the signal table. int add_sig_table( int entry, int addr, int in_ch, int mode, int comp ) Fills in an entry in the signal table. PARAMETERS: entry selects table entry. addr is the 12-bit PLCBus address of Exp-A/D12. in_ch is the input channel to read (07). mode is the conversion mode (gain and polarity) (017).
int slow_plad12( int entry ) Reads the Exp-A/D12 for the signal identified by the signal table entry entry. This function handles all the overhead. This function is slow (~1 ms execution), but relatively easy to use. void an_input_ch( int board, int channel ) Switches the Exp-A/D12 addressed so that it begins reading the input channel (07) specified. This function does not wait for the analog circuitry to settle. Call mxdel before doing the A/D conversion.
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.
5. Power up the controller and bring up Dynamic C on a PC. Consult the controllers users manual if there are any problems re-establishing communications between the PC and the controller. 6. Open and run the sample program ADSAMPL1.C. 7. Dynamic C will begin displaying voltage output from the TEMP pin. 8. Place a finger on the U1 chip (LT1019) case. The voltage and temperature readings should increase after a few seconds; the readings will decrease when the finger is removed. ADSAMPL1.
APPENDICES
Blank
APPENDIX A: PLCBUS Appendix A provides the pin assignments for the PLCBus, describes the registers, and lists the software drivers.
PLCBus Overview The PLCBus is a general-purpose expansion bus for Z-World controllers. The PLCBus is available on the BL1200, BL1600, BL1700, PK2100, and PK2200 controllers. The BL1000, BL1100, BL1300, BL1400, and BL1500 controllers support the XP8300, XP8400, XP8600, and XP8900 expansion boards using the controllers parallel input/output port. The BL1400 and BL1500 also support the XP8200 and XP8500 expansion boards. The ZB4100s PLCBus supports most expansion boards, except for the XP8700 and the XP8800.
Two independent buses, the LCD bus and the PLCBus, exist on the single connector. The LCD bus consists of the following lines. LCDXpositive-going strobe. /RDXnegative-going strobe for read. /WRXnegative-going strobe for write. A0Xaddress line for LCD register selection. D0X-D7Xbidirectional data lines (shared with expansion bus). The LCD bus is used to connect Z-Worlds OP6000 series interfaces or to drive certain small liquid crystal displays directly.
There are eight registers corresponding to the modes determined by bus lines A1X, A2X, and A3X. The registers are listed in Table A-2. Table A-2.
Place an address on the bus by writing (bytes) to BUSADR0, BUSADR1 and BUSADR2 in succession. Since 4-bit and 8-bit addressing modes must coexist, the lower four bits of the first address byte (written to BUSADR0) identify addressing categories, and distinguish 4-bit and 8-bit modes from each other. There are 16 address categories, as listed in Table A-3. An x indicates that the address bit may be a 1 or a 0. Table A-3.
Z-World provides software drivers that access the PLCBus. To allow access to bus devices in a multiprocessing environment, the expansion register and the address registers are shadowed with memory locations known as shadow registers. The 4-byte shadow registers, which are saved at predefined memory addresses, are as follows.
Digital output devices, such as relay drivers, should be addressed with three 4-bit addresses followed by a 4-bit data write to the control register. The control registers are configured as follows bit 3 A2 bit 2 A1 bit 1 A0 bit 0 D The three address lines determine which output bit is to be written. The output is set as either 1 or 0, according to D. If the device exists on the bus, reading the register drives bit 0 low. Otherwise bit 0 is a 1.
There are 4-bit and 8-bit drivers. The 4-bit drivers employ the following calls. void eioResetPlcBus() Resets all expansion boards on the PLCBus. When using this call, make sure there is sufficient delay between this call and the first access to an expansion board. LIBRARY: EZIOPLC.LIB, EZIOPLC2.LIB, EZIOMGPL.LIB. void eioPlcAdr12( unsigned addr ) Specifies the address to be written to the PLCBus using cycles BUSADR0, BUSADR1, and BUSADR2.
void set4adr( int adr ) Sets the current address for the PLCBus. All read and write operations access this address until a new address is set. A 12-bit address may be passed to this function, but only the last four bits will be set. Call this function only if the first eight bits of the address are the same as the address in the previous call to set12adr. PARAMETER: adr contains the last four bits (bits 811) of the physical address. LIBRARY: DRIVERS.LIB.
char read4data( int adr ) Sets the last four bits of the current PLCBus address using adr bits 8 11, then reads four bits of data from the bus with BUSADR0 cycle. PARAMETER: adr bits 811 specifies the address to read. RETURN VALUE: PLCBus data in the lower four bits; the upper bits are undefined. LIBRARY: DRIVERS.LIB. void _eioWriteWR( char ch) Writes information to the PLCBus during the BUSWR cycle. PARAMETER: ch is the character to be written to the PLCBus. LIBRARY: EZIOPLC.LIB, EZIOPLC2.
void set8adr( long address ) Sets the current address on the PLCBus. All read and write operations will access this address until a new address is set. PARAMETER: address contains the last eight bits of the physical address in bits 1623. A 24-bit address may be passed to this function, but only the last eight bits will be set. Call this function only if the first 16 bits of the address are the same as the address in the previous call to set24adr. LIBRARY: DRIVERS.LIB.
Blank 86 s PLCBus XP8500 and Exp-A/D12
APPENDIX B: XP8500 and Exp-A/D12 SPECIFICATIONS Specifications s 87
XP8500 Hardware Specifications Table B-1 summarizes the specifications for the XP8500 expansion board. Table B-1. XP8500 Specifications Board Size 2.835" × 2.125" × 0.
0.125 typ (3.2) 1.0 (25) 2.835 (72) Figure B-1 shows the dimensions of the XP8500 expansion board. 0.187 dia, 4x (4.7) 2.125 (54) ~0.6 (15) 0.3 (7.6) ~0.75 (19) 0.125 typ (3.2) Figure B-1.
Exp-A/D12 Hardware Specifications Table B-2 summarizes the specifications for the Exp-A/D12 expansion board. Table B-2. Exp-A/D12 Specifications Board Size 2.835" × 3.525" × 0.
Figure B-2 shows the dimensions of the Exp-A/D12 expansion board. 0.15 typ (3.8) 2.835 (72) C3 3.525 (90) ~0.75 (19) 0.187 dia, 4x (4.7) ~0.6 (15) 0.15 typ (3.8) Figure B-2.
Blank 92 s Specifications XP8500 and Exp-A/D12
APPENDIX C: CONNECTING AND MOUNTING MULTIPLE BOARDS XP8500 and Exp-A/D12 Connecting and Mounting Multiple Boards s 93
Connecting Multiple Boards Eight or more expansion boards can be connected (daisy chained) at one time. The actual number of expansion boards may be limited by capacitative loading on the PLCBus. Be sure that each expansion board has a unique address to prevent communication problems between the controller and the expansion board. Follow these steps to install several expansion boards on a single PLCBus. 1. Place all expansion boards right side up. 2. Use the ribbon cable supplied with the boards. 3.
There are two ways to compensate for the voltage dropoff. The easiest way is to connect +5 V DC and ground from the host controller to pins 2 and 1 of header P1 on the last expansion board. Another solution, which can approximately double the number of boards that could otherwise be connected to a single controller, is a Y cable available from Z-World. Figure C-2 illustartes the use of the Y cable.
Mounting Expansion Boards The XP8500 and Exp-A/D12 expansion boards can be installed in modular plastic circuit-board holders attached to a DIN rail, a widely used mounting system, as shown in Figure C-3. The circuit-baord holders are 77 mm wide and come in lengths of 11.25 mm, 22.5 mm, and 45 mm. The holders, available from Z-World, snap together to form a tray of almost any length. Z-Worlds expansion baords are 72 mm wide and fit directly in these circuit-board holders.
APPENDIX D: SIMULATED PLCBUS CONNECTION XP8500 and Exp-A/D12 Simulated PLCBus Connection s 97
BL1400 and BL1500 XP8500 expansion boards may be connected to header H3 on the BL1400 and BL1500. The signals, listed in Table D-1, are laid out differently from those on the other controllers, and so the special cable used for the BL1000, the BL1100, or the BL1300 controllers will not work. The user may either make a custom cable or use an adapter board available from Z-World. Software from the Dynamic C EZIOMGPL.LIB library may be used. Table D-1.
APPENDIX E: TECHNICAL CIRCUIT DETAILS XP8500 and Exp-A/D12 Technical Circuit Details s 99
XP8500 Quad op-amp U2 buffers the four analog inputs received via Wago connector H1. U2s four op-amp outputs go to the first four inputs of the A/D converter U3s eleven analog inputs. The A/D converter, a TLC2543, is a 12-bit, switched-capacitor, successive-approximation converter. The A/D converters internal multiplexer samples and converts one input channel at a time in response to commands received from the PLCBus. The A/D converter sends converted data out serially.
in a bridge circuit. In such cases, the ratiometric conversion will track any drift or errors in the reference, permitting a more accurate conversion. REF- is hard-wired to analog ground. REF+ connects to one of two sources of 2.5 V. REF+ connects to a precision voltage referenceusually an AD680 or alternatively an LM385for absolute conversion. The voltage divider RP1RP2 derives a 2.5 V reference voltage for ratiometric conversion using the +5 V analog supply.
Exp-A/D12 Input Stability Grounded input signals were used to calculate the standard deviations of A/D converter channels. Tests of 1000 samples per channel were performed on typical boards in both the unipolar and bipolar modes. Under these conditions, the standard deviation of the lower gain channels (gains of 1, 6, 22, and 42) in bipolar mode was typically 0.10.4 (out of 2047). The standard deviation for the higher gain channels (gains of 102 and 202) was typically 0.60.8.
Settling times were also measured for other channels. Reducing the size of the feedback capacitor reduced the settling time at the expense of reduced noise filtering. When C10 (202X gain) was replaced with a 150 pF capacitor, the time constant on this channel was reduced to 35 µs. The stability of the channels suffered disproportionately.
Blank 104 s Technical Circuit Details XP8500 and Exp-A/D12
INDEX Symbols /AT ............................................. 77 /RDX .......................................... 77 /STBX ........................................ 77 /WRX ......................................... 77 4-bit bus operations ..... 77, 78, 80 5 × 3 addressing mode ............... 79 8-bit bus operations ..... 77, 79, 81 A A/D conversion Exp-A/D12 ............................. 52 XP8500 .................................. 14 A/D converter chip Exp-A/D12 ............................. 63 XP8500 ..
bus expansion addresses ............................ 80 devices ........................ 80, 81 functions ....... 82, 83, 84, 85 rules for devices ................. 80 software drivers ................. 81 LCD ....................................... 77 operations 4-bit ...................... 77, 78, 80 8-bit ............................. 77, 81 BUSADR0 .......................... 78, 79 BUSADR1 .......................... 78, 79 BUSADR2 .......................... 78, 79 BUSADR3 ..........................
EX1 Exp-A/D12 ............................. 63 EX4 Exp-A/D12 ............................. 63 excitation resistors XP8500 .................................. 24 Exp-A/D12 .......................... 52, 76 +5 V ....................................... 52 addresses ................................ 66 calibration .............................. 52 constants ................................ 67 conversion modes .................. 68 gain ........................................ 52 input stability ..................
J jumper settings Exp-A/D12 ............................. 61 XP8500 ...................... 21, 24, 34 L LCD ........................................... 77 LCD bus ..................................... 77 LCDX ........................................ 77 libraries function ............................ 35, 78 liquid crystal display .................. 77 logical addresses XP8500 .................................. 34 M memory-mapped I/O register ..... 78 mode addressing ..............................
R ratiometric mode XP8500 .................................. 20 read12data ............... 34, 66, 83 read24data ............................. 85 read4data ................................ 84 read8data ................................ 85 reading data on the PLCBus ..78, 83 relays DIP ......................................... 76 drivers .................................... 81 reset expansion boards ................... 82 resistor tolerance ........................ 29 ribbon cables ...........................
XP8500 calibration ......... 14, 31, 32, 43 calibration coefficients .... 32, 42 calibration software ............... 31 configurations ........................ 22 connections ............................ 25 conversion modes ................ 100 data conversion .................... 101 drift ........................................ 26 EEPROM .......... 14, 24, 43, 44 excitation resistors ................. 24 frequency response ................ 22 gain .................................
Z-World 2900 Spafford Street Davis, California 95616-6800 USA Telephone: Facsimile: Web Site: E-Mail: (530) 757-3737 (530) 753-5141 http://www.z w orld.com zworld@zworld.com Part No. 019-0055 Revision B Printed in U.S.A.