NuDAQ / NuIPC 9112 Series Multi-function DAS Cards for PCI / 3U CompactPCI User’s Manual
Copyright ©1996~2000 ADLINK Technology Inc. ALL RIGHTS RESERVED. Manual Rev 3.50: May 25, 2000 The information in this document is subject to change without prior notice in order to improve reliability, design and function and does not represent a commitment on the part of the manufacturer.
Getting service from ADLINK Customer Satisfaction is always the most important thing for ADLINK Tech Inc. If you need any help or service, please contact us and get it. ADLINK Technology Inc. Web Site http://www.adlink.com.tw Sales & Service service@adlink.com.tw Technical NuDAQ nudaq@ADLINK.com.tw Support NuDAM nudam@ADLINK.com.tw NuIPC nuipc@ADLINK.com.tw NuPRO nupro@ADLINK.com.tw Software sw@ADLINK.com.tw AMB amb@ADLINK.com.tw TEL +886-2-82265877 FAX +886-2-82265717 Address 9F, No.
CONTENTS Chapter 1 Introduction ........................................... 1 1.1 1.2 1.3 1.4 Features............................................................................... 1 Applications......................................................................... 2 Specifications ...................................................................... 2 Software Supporting............................................................ 4 1.4.1 1.4.2 1.4.3 1.4.4 1.4.5 1.4.6 1.4.7 1.4.8 1.4.
3.4 3.5 3.6 3.7 3.8 3.9 3.10 A/D control Register ...........................................................22 A/D Status Register ............................................................25 Software Trigger Register...................................................25 Digital I/O register...............................................................26 Internal Timer/Counter Register..........................................27 High Level Programming....................................................
5.21 5.22 5.23 5.24 5.25 5.26 5.27 5.28 5.29 5.30 5.32 _9112_ContDmaStop ..........................................................58 _9112_AD_INT_Start ...........................................................59 _9112_AD_INT_Status ........................................................60 _9112_AD_INT_Stop ...........................................................61 _9112_AD_Timer.................................................................61 _9112_TIMER_Start......................................
How to Use This Guide This manual is for helping users to manipulate the PCI-9112 and cPCI9112. The functionality of PCI-9112 and cPCI-9112 are the same. Therefore, the “PCI-9112” in this manual represent both the PCI-9112 and cPCI-9112 without specifications. The manual describes how to modify various settings on the PCI-9112 card to meet your requirements.
1 Introduction The 9112 series products are multi-function data acquisition cards.. The 9112 series includes: PCI-9112: 12-bit 100KHz Multifunction DAS card cPCI-9112: 12-bit 100KHz Multifunction DAS card for 3U ComptactPCI The 9112 series DAS cards are using state-of-the-art technology to make this card ideal for data logging and signal analysis applications in medical, process control, etc. 1.
Ø Ø Ø 1.2 Applications Ø Ø Ø Ø Ø Ø Ø Ø Ø 1.
u u u Ø Ø Ø Ø Ø External Reference: (unipolar) max. +10V or -10V Converter: DAC7541 or equivalent, monolithic multiplying Settling Time: 30 µ sec Linearity: ±1/2 bit LSB Output Driving Capability: ±5mA max. Ø Ø Ø Ø Ø Ø Ø Ø Ø Ø Ø Ø Ø Digital I/O (DIO) Numbers of channels: 16 TTL compatible inputs and outputs Input Voltage: Low: Min. 0V. Max. 0.8V High: Min. +2.0V Input Load: Low: +0.5V @ -0.2mA max. High: +2.7V @+20mA max. Output Voltage: Low: Min. 0V; Max. 0.4V High: Min. +2.
1.4 Software Supporting ADLink provides versatile software drivers and packages for users’ different approach to built-up a system. We not only provide programming library such as DLL for many Windows systems, but also ® provide drivers for many software package such as LabVIEW , HP TM TM TM TM TM VEE , DASYLab , InTouch , InControl , ISaGRAF , and so on. All the software options are included in the ADLink CD. The non-free software drivers are protected with serial licensed code.
1.4.3 PCIS-VEE: HP-VEE Driver The PCIS-VEE includes the user objects, which are used to interface with HP VEE software package. PCIS-VEE supports Windows 95/98/NT. The HP-VEE drivers are free shipped with the board. You can install and use them without license. For detail information about PCIS-VEE, please refer to the user’s guide in the CD. (\\Manual_PDF\Software\PCIS-VEE) 1.4.
2 Installation This chapter describes how to install the 9112 series cards. Please follow the follow steps to install. u Check what you have (section 2.1) u Unpacking (section 2.2) u Check the PCB and jumper location(section 2.3) u Setup jumpers (section 2.4~2.8) u Install the hardware and setup and jumpers (section 2.10) u Install the software drivers and run utility to test (section 2.11) u Cabling with external devices (section 2.9 and 2.12) 2.
2.2 Unpacking The card contains sensitive electronic components that can be easily damaged by static electricity. Failure to perform the procedure outlined below may damage the on board devices. The board is packaged in an anti-static bag to avoid damage to the sensitive IC on the board. After opening the card module carton, extract the bag and place it only on a grounded anti-static surface to establish grounding. The card should be handled on a grounded anti-static mat.
8 • Installation JP 4 EXTREF DIFF INTREF SING -5V -10V CN3 JP 3 JP 5 VR7 VR5 VR3 VR6 VR4 VR2 ADS-774 ALTERA PCI -Bus Controller DC-DC Converter DIFF INTCLK JP 2 SING EXTCLK .. .. . . .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. CN2 .. .. . . .. .. .. CN1 PCI-9112 Multi-function DA&C JP 1 2.4 PCB Layout PCI-9112 Layout Figure 2.
cPCI-9112 Layout Figure 2.
2.5 Jumper Settings You can set the following configuration by jumpers: the analog input signal mode, counter’s clock source, and analog output range. The card's jumpers and switches are preset at the factory. You can change the jumper settings for your own applications. For system reliability and safety, the design of PCI-9112 still keeps some board configurations to be set through jumpers. These setting are listed as below.
PCI-9112 cPCI-9112 SINGLE Single-ended JP5 SINGLE SINGLE JP1 JP4 SINGLE JP1 (default setting) Differential Input DIFF DIFF DIFF DIFF SINGLE SINGLE SINGLE SINGLE JP5 JP1 DIFF DIFF Figure 2.2 2.7 JP4 JP1 DIFF DIFF Analog Input Mode Setting Clock Source Setting The programmable interval timer 8254 is used in the PCI-9112. It provides 3 independent 16-bit programmable down counters. The input of counter 2 is connected to a precision 2MHz oscillator for internal pacer.
JP4(PCI-9112) JP5(cPCI-9112) D/A CH1 is External D/A CH2 is External D/A CH1 is External D/A CH2 is Internal D/A CH1 is Internal D/A CH2 is External D/A CH1 is Internal D/A CH2 is Internal (default setting) INTREF INTREF ExtRef1 ExtRef2 INTREF INTREF ExtRef1 ExtRef2 INTREF INTREF ExtRef1 ExtRef2 INTREF INTREF ExtRef1 ExtRef2 Figure 2.4 Analog Output Voltage Setting The internal A/D reference voltage can be set to –5V or –10V by JP3. The possible configurations are specified as Figure 2.
2.9 Connectors Pin Assignments 2.9.1 Pin Assignments of PCI-9112 The PCI-9112 comes equipped with two 20-pin insulation displacement connectors - CN1 and CN2 and one 37-pin D-type connector - CN3. The CN1 and CN2 are located on board and CN3 located at the rear plate. CN1 is for digital signal input, CN2 for digital signal output, CN3 for analog input, analog output and timer/counter's signals. The pin assignments for each connector are illustrated in the Figure 2.9.1~ Figure 2.9.3.
GATE COUT n V.ERF A.GND GND : Gate input for 8254 : Signal output of Counter n : Voltage Reference : Analog Ground : Ground CN 1: Digital Signal Input (DI 0 - 15) CN1 DI 1 1 2 DI 3 3 4 DI 5 5 6 DI 7 7 8 DI 9 9 10 DI 11 11 12 DI 13 13 14 DI 15 15 16 GND 17 18 +12V 19 20 Figure 2.9.
2.9.2 Pin Assignments of cPCI-9112 (1) (2) (3) (48) (49) (50) Legend : AINm AINHm AINLm ExtTrig DIN_x DOUT_x ExtCLK COUT n GATE0 GATE ExtRef n DAn REFout 5Vout 12Vout A.
2.10 Hardware Installation Outline PCI configuration The PCI cards (or CompactPCI cards) are equipped with plug and play PCI controller, it can request base addresses and interrupt according to PCI standard. The system BIOS will install the system resource based on the PCI cards’ configuration registers and system parameters (which are set by system BIOS). Interrupt assignment and memory usage (I/O port locations) of the PCI cards can be assigned by system BIOS only.
2.12 Daughter Board Connection The PCI-9112 can be connected with five different daughter boards, ACLD-8125, 9137, 9138, 9182, 9185, and 9188. The functionality and connections are specified in the following sections. The cPCI-9112 is equipped with 100 pin SCSI-II type connector, the DIN100S is a general purpose terminal board for connecting the external devices. 2.12.1 Connect with ACLD-8125 The ACLD-8125 has a 37-pin D-sub connector, which can connect with PCI-9112 through 37-pin assemble cable.
2.12.4 Connect with ACLD-9185 The ACLD-9185 is a 16 channel SPDT relay output board. This board is connected with CN2 of PCI-9112 via 20-pin flat cable. by using this board, you can control outside device through the digital output signals. 2.12.5 Connect with ACLD-9138 and ACLD-9188 ACLD-9138 and ACLD-9188 are general purpose terminal boards for all the card which comes equipped with 37-pin D-sub connector. The ACLD9138 has a LED indicator to show the power ON/OFF of your computer system.
3 Registers Format The detailed descriptions of the register format and structure of the PCI9112 are specified in this chapter. This information is quite useful for the programmer who wish to handle the card by low-level program. In addition, the low level programming syntax is introduced. This information can help the beginners to operate the PCI-9112 in the shortest learning time. 3.1 I/O Registers Map The PCI-9112 functions as 32-bit PCI target device to any master on the PCI bus.
I/O Address Base + 0 Base + 4 Base + 8 Base + C Read Counter 0 Counter 1 Counter 2 ------------- Base + 10 A/D Data Reg. Base + 14 ------------- Base + 18 Base + 1C Base + 20 3.2 A/D Status Reg. Digital IN Reg. ------------Table 3.1 I/O Address Write Counter 0 Counter 1 Counter 2 8254 Counter Control CH1 D/A Data Reg. CH2 D/A Data Reg. A/D Control Reg. Digital OUT Reg.
3.3 D/A Output Register The D/A converter will convert the D/A output register data to the analog signal. The register data of the address Base+10 is used for D/A channel 1, Base+14 is used for D/A channel 2.
3.4 A/D control Register This register is to control the A/D channels to be converted. It is a write only register. When the channel number is written to the register, the multiplexer switches to the new channel and wait for conversion.
Only below modes are legal to be applied on the PCI-9112 card : Bit 3 EIT S Bit 1 IN T X 0 0 Bit 2 T P S T 0 1 0 0 Bit 0 D M A X 0 1 0 1 1 1 1 X X X 1 0 0 1 0 0 1 0 Mode Description Software Trigger & Polling Timer Pacer Trigger & DMA Timer Pacer Trigger & INT External Trigger & Polling External Trigger & DMA External Trigger & INT Auto-Scan: ( Bit 4) 0: Auto Scan is disabled Only channel [M3 M2 M1 M0] is converted only 1: The converted channel will be selected by the sequence [ M3 M2 M1 M0] to
In PCI-9112, the analog input ranges are software programmable and it is controlled by the gain value. The gain value and its corresponding input range is shown as below. ( Bi t1 2) G 3 1 ( Bi t1 1) G 2 0 ( Bi t1 0) G 1 0 ( Bi t9 ) G 0 0 0 0 0 0 0 0 0 1 0 0 1 0 0 0 1 1 0 1 0 0 0 1 0 1 0 1 1 0 0 1 1 1 24 • Registers Format Bipola r or Unipol ar Bipola r Bipola r Bipola r Bipola r Bipola r Unipol ar Unipol ar Unipol ar Unipol ar Input Range ±10V ±5V ±2.5V ±1.25V ±0.
3.5 A/D Status Register Address : BASE + 18 Attribute : read only Data Format: Bit Base + 18 1 DO VR 0 DR DY Base + 19 --- --- Base + 1A --- --- Base + 1B --- --- DOVR: A/D Over-Run ( it is only when A/D is transferred by DMA master mode. ) 1 : A/D converted Data is over run 0 : A/D converted Data is in normal condition bus DRDY : A/D Data is Ready 1 : A/D conversion is completed 0 : A/D conversion is not completed 3.
3.7 Digital I/O register There are 16 digital input channels and 16 digital output channels provided by the PCI-9112. The address Base + 1C is used to access digital inputs and control digital outputs.
3.8 Internal Timer/Counter Register Two counters of 8254 are used for periodically triggering the A/D conversion, the left one is left free for user applications. The 8254 occupies 4 I/O address locations in the PCI-9112 as shown blow. Users can refer to NEC's or Intel's data sheet for a full description of the 8254 features.
4 Operation Theorem The operation theorem of the functions on PCI-9112 card is described in this chapter. The functions include the A/D conversion, D/A conversion, Digital I/O and counter / timer. The operation theorem can help you to understand how to manipulate or to program the PCI-9112. 4.1 A/D Conversion Before programming the PCI-9112 to perform the A/D conversion, you should u nderstand the following issues: Ø Ø Ø Ø Ø 4.
Single-ended Mode The single-ended mode has only one input relative to ground and it suitable for connecting with the floating signal source. The floating source means it does not have any connection to ground. Figure 3.4 shows the single-ended connection. Note that when more than two floating sources are connected, the sources must be with common ground. Figure 4.2.
A differential mode must be used when the signal source is differential. A differential source means the ends of the signal are not grounded. To avoid the danger of high voltage between the local ground of signal and the ground of the PC system, a shorted ground path must be connected. Figure 3.6 shows the connection of differential source. n = 0, n = 0, ..., 8 To A/D Converter AIHn Differential Signal Source + - AILn GND Vcm = VG1 - VG2 VG1 VG2 Figure 4.2.
4.2.1 A/D Conversion Procedure The A/D conversion is starting by a trigger source, then the A/D converter will start to convert the signal to a digital value. The PCI-9112 provides three trigger modes, s ee section 5.1.2. While A/D conversion, the DRDY bit in A/D status register is cleared to indicate the data is not ready. After conversion being completed, the DRDY bit will return to high(1) level. It means users can read the converted data from the A/D data registers. Please refer section 4.
External Trigger Through the pin-17 of CN3 (ExtTrig), the A/D conversion also can be performed when a rising edge of external signal is occurred. The conversion rate of this mode is more flexible than the previous two modes, because the users can handle the external signal by outside device. The external trigger can combine with the DMA transfer, interrupt data transfer, or even program polling data transfer. Generally, the interrupt data transfer is often used when external trigger mode is used. 4.2.
DMA Transfer (DMAX) The DMA (Direct Memory Access) bus master allows data to be transferred directly between the PCI-9112 and the PC memory at the fastest possible rate, without using any CPU time. The A/D data will be queue at local FIFO on the PCI-9112 itself and it is automatically transferred to PC's memory. The DMA transfer mode is very complex to program. It is recommended to use the high level program library to operate this card.
4.4 Digital Input and Output The PCI-9112 provides 16 digital input and 16 digital output channels through the connector CN1 and CN2 on board. The digital I/O signal are fully TTL/DTL compatible. The detailed digital I/O signal are specified in section 1.3. To program digital I/O operation is fairly straight forward. The digital input operation is just to read data from the corresponding registers, and the digital output operation is to write data to the corresponding registers.
4.5 Timer/Counter Operation The PCI-9112 has an interval timer/counter 8254 on board. It offers 3 independent 16-bit programmable down counters; counter 1 and counter 2 are cascaded together for A/D timer pacer trigger of A/D conversion, and counter 0 is free for your applications. Figure 3.10 shows the 8254 timer/counter connection.
Ø Ø Ø Ø Ø event counter binary rate multiplier real-time clock Digital one-shot motor control For more information about the 8254, please refer to the NEC Microprocessors and peripherals or Intel Microsystems Components Handbook. Pacer Trigger Source The counter 1 and counter 2 are cascaded together to generate the timer pacer trigger of A/D conversion. The frequency of the pacer trigger is software controllable.
Control Byte Before loading or reading any of these individual counters, the control byte (BASE+3) must be loaded first.
• BCD - Select Binary/BCD Counting (Bit 0) 0 1 N ot e 16-BITS BINARY COUNTER BINARY CODED DECIMAL (BCD) COUNTER (4 DIGITAL) The count of the binary counter is from 0 up to 65,535 and the count of the BCD counter is from 0 up to 9,999 Mode Definitions In 8254, six operating modes can be selected. They are : Ø Mode 0: Interrupt on Terminal Count Ø Mode 1: Programmable One-Shot. Ø Mode 2: Rate Generator. Ø Mode 3: Square Wave Rate Generator. Ø Mode 4: Software Triggered Strobe.
5 C/C++ Library This chapter describes the software library for operating this card. Only the functions in DOS library and Windows 95 DLL are described. Please refer to the PCIS-DASK function reference manual, which included in ADLINK CD, for the descriptions of the Windows 98/NT/2000 DLL functions. The function prototypes and some useful constants are defined in the header files LIB directory (DOS) and INCLUDE directory (Windows 95). For Windows 95 DLL, the developing environment can be Visual Basic 4.
5.2 Programming Guide 5.2.1 Naming Convention The functions of the NuDAQ PCI cards or NuIPC CompactPCI cards’ software driver are using full-names to represent the functions' real meaning. The naming convention rules are: In DOS Environment : _{hardware_model}_{action_name}. e.g. _9112_Initial(). All functions in PCI-9112 driver are with 9112 as {hardware_model}. But they can be used by PCI-9112, cPCI-9112.
5.3 _9112_Initial @ Description A PCI-9112 card is initialized according to the card number. Becaus e the PCI-9112 is PCI bus architecture and meets the plug and play design, the IRQ and base_address (pass-through address) are assigned by system BIOS directly. Every PCI-9112 card has to be initialized by this function before calling other functions. Note : Because configuration of PCI-9112 is handled by the system, there is no jumpers or DMA selection on the PCI boards that need to be set up by the users.
exit(0); errCode = _9112_Initial( CARD_2, &baseAddr2, &irqNo2); if ( errCode != ERR_NoError ) exit(0); . } 5.4 _9112_DI @ Description This function is used to read data from digital input port. There are 16-bit digital inputs on the PCI-9112. You can get all 16 input data from _9112_DI one shot.
u Syntax Visual C++ (Windows-95) int W_9112_DI_Channel (int card_number, int di_ch_no, unsigned int *di_data) Visual Basic (Windows-95) W_9112_DI_Channel (ByVal card_number As Long, ByVal di_ch_no As Long, di_data As Long) As Integer C/C++ ( DOS) int _9112_DI_Channel (int card_number, int di_ch_no, unsigned int *di_data ) u Argument card_number : di_ch_no : from 0 to 15. di_data : u return value, either 0 or 1.
u Syntax Visual C++ (Windows-95) int W_9112_DO (int card_number, unsigned int do_data) Visual Basic (Windows-95) W_9112_DO (ByVal card_number As Long, ByVal do_data As Long) As Integer C/C++ ( DOS) int _9112_DO(int card_number, unsigned int u Argument card_number : do_data : u the card number of PCI-9112 value will be written to digital output port Return Code ERR_NoError, 5.7 do_data ) ERR_BoardNoInit _9112_DA u Description This function is used to write data to D/A converters.
u Example #include main() { Int “9112.h” baseAddr, irqNo; _9112_Initial( CARD_1, &baseAddr, &irqNo); /* Assume NoError when Initialize PCI-9112 */ /* if the hardware setting for DA output range is 0~5V */ _9112_DA(CARD_1, DA_CH_1 , 0x800 ); printf( "The output voltage of CH1 is 2.5V \n" ); _9112_DA(CARD_1, DA_CH_2 , 0xFFF ); printf( "The output voltage of CH2 is 5V \n" ); } A more complete program is specified in Appendix A Program 'DA_DEMO.C' 5.8 Demo.
u Return Code : ERR_NoError, ERR_BoardNoInit ERR_InvalidADChannel 5.9 _9112_AD_Set_Range u Description This function is used to set the A/D analog input range by means of writing data to the A/D range control register. There are two factors will change the analog input range - Gain and Input type. The Gain can be choice from 0.5, 1, 2, 4, and 8 . The input type is either Bipolar or Unipolar. The initial value of gain is '1‘ and input type is bipolar, which are pre-set by the PCI-9112 hardware.
u Syntax Visual C++ (Windows-95) int W_9112_ AD_Set_Range (int card_number, int ad_range) Visual Basic (Windows-95) W_9112_AD_Set_Channel (ByVal card_number As Long, ByVal ad_range As Long) As Long C/C++ ( DOS) int _9112_AD_Set_Range (int card_number, int ad_range ) u Argument card_number : the card number of PCI-9112 ad_range : the programmable range of A/D conversion, please refer the the above table for the possible range values. u Return Code ERR_NoError ERR_BoardNoInit ERR_AD_InvalidRange 5.
u Syntax Visual C++ (Window s-95) int W_9112_AD_Set_Mode (int card_number, int ad_mode) Visual Basic (Windows-95) W_9112_AD_Set_Mode (ByVal card_number As Long, ByVal ad_mode As Long) As Long C/C++ ( DOS) int _9112_AD_Set_Mode (int card_number, int ad_mode ) u Argument card_number : ad_mode : u the card number of PCI-9112 AD trigger and data transfer mode ( please refer to above table.) Return Code ERR_NoError ERR_BoardNoInit ERR_InvalidMode u Example #include “9112.
4, 3, 2, 1, 0, 4, 3, 2, 1, 0, 4, 3, 2, 1, 0, 4, 3, ...... If the auto-scan is set as disable, the channel will be kept as single channel only, such as channel 4.
5.13 _9112_AD_Aquire u Description This function is used to poll the AD conversion data. It will trigger the AD conversion, and read the 12-bit A/D data until the data is ready ('data ready' bit becomes low).
5.14 _9112_AD_DMA_Start u Description The function will perform A/D conversion N times with DMA data transfer. It takes place in the background which will not stop until the N-th conversion has completed or your program execute _9112_AD_DMA_Stop() function to stop the process. After executing this function, it is necessary to check the status of the operation by using the function _9112_AD_DMA_Status(). The function is performed on single A/D channel when the A/D channel auto-scan is set as FALSE.
3. After the A/D conversion is started, the A/D converted data is stored in the FIFO of PCI controller. Each bus mastering data transfer continually tests if any data in the FIFO and then blocks transfer, the system will continuously loop until the conditions are satisfied again but will not exit the block transfer cycle if the block count is not complete. If there is momentarily no A/D data, the PCI-9112 will relinquish the bus temporarily but returns immediately when more A/D samples appear.
ad_ch_no : A/D channel number ad_range : A/D analog input range, the possible values are shown in section 4.3.8. count : the number of A/D conversion ad_buffer(DOS) : the start address of the memory buffer to store the AD data, the buffer size must large than the number of AD conversion. In DOS environment, please make sure this memory is double-word alignment. Every 16-bit unsigned integer data in ad_buffer: D11 D10 D9 .......................D1 D0 C3 C2 C1 C0 D11, D10, ...
C/C++ ( DOS) int _9112_AD_DMA_Status(int card_number, int *status , int *count ) u Argument card_number : the card number of PCI-9112 status : status of the DMA data transfer 0: AD_DMA_STOP : DMA is completed 1: AD_DMA_RUN : DMA is not completed count : the number of A/D data which has been transferred. u Return Code ERR_NoError, u ERR_BoardNoInit Example See Demo Program 'AD_DEMO3.C' , 'AD_DEMO6.C' 5.16 _9112_AD_DMA_Stop u Description This function is used to stop the DMA data transferring.
5.17 _9112_ContDmaStart u Description The function will perform A/D conversion continuous with DMA data transfer. It will takes place in the background which will not be stop until your program execute _9112_ContDmaStop() function to stop the process. After executing this function, it is necessary to check the status of double buffer by using the function _9112_CheckHalfReady() and using _9112_DblBufferTransfer() to get the A/D converted data.
AD data, the buffer size must large than the number of AD conversion. In DOS environment, please make sure this memory is double-word alignment. Every 16-bit unsigned integer data in ad_buffer: D11 D10 D9 .......................D1 D0 C3 C2 C1 C0 D11, D10, ..., D1, D0 : A/D converted data C3, C2, C1, C0 : converted channel no. memID(Windows-95) : the memory ID of the allocated system DMA memory to act as the circular buffer.
u Argument card_number : the card number of PCI-9112 halfReady : TRUE or FALSE. u Return Code ERR_NoError, u ERR_BoardNoInit Example See Demo Program 'AD_DEMO5.C' 5.19 _9112_DblBufferTransfer u Description Using this function to move the converted A/D data to user buffer.
Visual Basic (Windows-95) W_9112_GetOverrunStatus(ByVal card_number As Long, overrunCount As Long) As Long C/C++ ( DOS) int _9112_GetOverrunStatus (int card_number, int *overrunCount ) u Argument card_number : overrunCount: u Return Code ERR_NoError, u the card number of PCI-9112 number of overrun counts. ERR_BoardNoInit Example See Demo Program 'AD_DEMO5.C' 5.21 _9112_ContDmaStop u Description This function is used to stop the continuous DMA data transferring.
5.22 _9112_AD_INT_Start u Description The function will perform A/D conversion N times with interrupt data transfer. It takes place in the background which will not stop until the N-th conversion has been completed or your program execute _9112_AD_INT_Stop() function to stop the process. After executing this function, it is necessary to check the status of the operation by using the function 9112_AD_INT_Status(). The function is performed on single A/D channel with fixed analog input range.
D11 D10 D9 .......................D1 D0 C3 C2 C1 C0 D11, D10, ..., D1, D0 : A/D converted data C3, C2, C1, C0 : converted channel no. c1 : the 16-bit timer frequency divider of timer channel #1 c2 : the 16-bit timer frequency divider of timer channel #2 u Return Code ERR_NoError, ERR_BoardNoInit ERR_InvalidADChannel , ERR_AD_InvalidRange ERR_InvalidTimerValue u Example See Demo Program 'AD_DEMO2.C' , ‘AD_DEMO5.C’ 5.
5.24 _9112_AD_INT_Stop @ Description This function is used to stop the interrupt data transfer function. After executing this function, the internal AD trigger is disable and the AD timer is stopped. The function returns the number of the data which has been transferred, no matter whether if the AD interrupt data transfer is stopped by this function or by the _9112_AD_INT_Stop() itself.
u Syntax Visual C++ (Windows-95) int W_9112_AD_Timer (int card_number, unsigned int c1, unsigned int c2) Visual Basic (Windows-95) W_9112_Timer (ByVal card_number As Long, c1 As Long, c2 As Long) As Long C/C++ ( DOS) int _9112_AD_Timer(int card_number, unsigned int c1 , unsigned int c2 ) u Argument card_number : the card number of PCI-9112 c1 : frequency divider of timer #1 c2 : frequency divider of timer #2 Note : the A/D sampling rate is equal to : 2MHz / (c1 * c2), when c1 = 0 or c2 = 0, the pacer trig
5.26 _9112_TIMER_Start u Description The Timer #0 on the PCI-9112 can be freely programmed by the users. This function is used to program the Timer #0. This timer can be used as frequency generator if internal clock is used. It also can be used as event counter if external clock is used. All the 8253 mode is available. Please refer to section5.4"Timer/Counter operation.
u Argument : card_number : the card number of PCI-9112 counter_value : the counter value of the Timer #0 @ Return Code : ERR_NoError, ERR_BoardNoInit 5.28 _9112_TIMER_Stop u Description This function is used to stop the timer operation. The timer is set to the 'One-shot' mode with counter value ' 0 '. That is, the clock output signal will be set to high after executing this function.
u Argument : buf_size: Bytes to allocate. Please be careful, the unit of this argument is BYTE, not SAMPLE. memID: If the memory allocation is successful, driver returns the ID of that memory in this argument. Use this memory ID in W_9112_AD_DMA_Start or W_9112_ContDmaStart function call. linearAddr: The linear address of the allocated DMA memory. You can use this linear address as a pointer in C/C++ to access the DMA data. u Return Code : ERR_NoError ERR_AllocDMAMemFailed 5.
u Argument : linearAddr: The linear address of the allocated DMA memory. index: The index of the sample to retrieve. The first sample is with index 0. ai_data: Returns the sample retrieved.
6 Calibration In data acquisition process, how to calibrate your measurement devices to maintain its accuracy is very important. Users can calibrate the analog input and analog output channels under the users' operating environment for optimizing the accuracy. This chapter will guide you to calibrate your PCI-9112 to an accuracy condition. 6.
6.2 VR Assignment There are five variable resistors (VR) on the PCI-9112 board to allow you making accurate adjustment on A/D and D/A channels. The function of each VR is specified as Table 6.1. VR1 VR2 VR3 VR4 VR5 VR6 VR7 6.3 A/D bipolar offset adjustment A/D full scale adjustment D/A channel 1 full scale adjustment D/A channel 2 full scale adjustment A/D unipolar offset adjustment D/A reference voltage adjustment A/D programmable amplifier offset adjustment Table 6.1 Function of VRs A/D Adjustment 6.
6.4 D/A Adjustment There are two steps to calibrate the analog output channels, D/A 1 and D/A 2. The first step is to adjust the reference voltage, and the second step is to adjust each channel of D/A. 6.4.1 Reference Voltage Calibration 1. Set reference voltage as -5V (the D/A reference voltage is selected by JP3, see section 2.8). 2. Connect VDM (+) to CN3 pin-11 (V.REF) and VDM (-) to GND. Trim the variable resister VR6 to obtain -5V reading in the DVM.
7 Software Utilities The PCI-9112 is a PCI-based high performance multi-function data acquisition card, which provides 16 single-ended analog or 8 differential analog inputs and auto scan channel by hardware, two double-buffered multiplexing analog outputs. In addition to analog I/O, 16 digital inputs and outputs and three 16-bit timer/counter channels are also included in the board. The utility program in the software package includes System Configuration, Calibration, and Functional testing.
7.1.1 Running the Utility After finishing the installation, you can execute the utility by typing as follows : C> cd \ADLINK\9112\DOS\UTIL C> 9112UTIL The 9112UTIL.EXE includes six functions: 1. Configuration : Check the hardware setting of your PCI-9112. 2. Calibration : Calibrate the A/D and D/A measurement accuracy of your PCI-9112. 3. Software Trigger Testing: Testing utility for software polling A/D, D/A and Digital I/O. 4. Interrupt Testing : Testing utility for interrupt A/D data transfer mode. 5.
When you choose the calibration function from the main menu list, a diagram shown below is displayed on the screen, the upper window shows the calibration items, such as DAC channel 1 or channel 2 full range adjust, Gain Amplifier offset adjust. etc. The bottom window shows the detailed procedures should be followed when you proceed the calibration. The instructions will guide you to calibrate each item step by step. 7.1.
Appendix A. Demo. Programs DOS Software: In this software CD, there are 8 DOS demonstration programs are provided. They could help you to program your application by using C Language Library easily. The description of these programs are specified as follows: AD_DEMO1.C : AD_DEMO2.C AD_DEMO3.C : AD_DEMO4.C : AD_DEMO5.C AD_DEMO6.C : AD_DEMO5.C : DA_DEMO.C : DIO_DEMO.C : A/D conversion uses software trigger and program data transfer. A/D conversion uses interrupt and program data transfer.
The description of these programs are specified as follows: Samples \sdk\9112\ 9112util.exe A/D conversion uses software trigger and program data transfer. Visual C/C++ program. Samples \sdk\9112int\ 9112int.exe A/D conversion uses interrupt data transfer. Visual C/C++ program. Samples \sdk\9112dma\ 9112dma.exe A/D conversion uses DMA data transfer. Visual C/C++ program. Samples \sdk\9112cdma\ 9112cdma.exe A/D conversion uses DMA data transfer with double-buffering mechanism. Visual C /C++ program.
Product Warranty/Service Seller warrants that equipment furnished will be free form defects in material and workmanship for a period of one year from the confirmed date of purchase of the original buyer and that upon written notice of any such defect, Seller will, at its option, repair or replace the defective item under the terms of this warranty, subject to the provisions and specific exclusions liste d herein.