NuDAQ® / NuIPC® 9112 Series Multi-function DAS Cards For PCI / 3U CompactPCI User’s Guide Recycled Paper
©Copyright 1996~2002 ADLINK Technology Inc. ALL RIGHTS RESERVED. Manual Rev 3.90: January 24, 2003 Part No. 50-11111-203 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 the most important priority for ADLINK Tech Inc. If you need any help or service, please contact us. ADLINK Technology Inc. Web Site http://www.adlinktech.com Sales & Service Service@adlinktech.com NuDAQ + USBDAQ nudaq@adlinktech.com Automation automation@adlinktech.com Technical Support TEL Address NuIPC nuipc@adlinktech.com NuPRO / EBC nupro@adlinktech.com +886-2-82265877 FAX +886-2-82265717 9F, No.
Table of Contents Chapter 1 Introduction .................................................................................1 1.1 Features...............................................................................................2 1.2 Applications .........................................................................................3 1.3 Specifications.......................................................................................4 1.4 Software Supporting ........................................
Chapter 3 Registers ....................................................................................25 3.1 I/O Registers Map..............................................................................25 3.2 A/D Data Registers ............................................................................26 3.3 D/A Output Register...........................................................................27 3.4 A/D control Register...........................................................................
5.22 5.23 5.24 5.25 5.26 5.27 5.28 5.29 5.30 5.31 _9112_AD_INT_Start ........................................................................66 _9112_AD_INT_Status ......................................................................68 _9112_AD_INT_Stop.........................................................................69 _9112_AD_Timer...............................................................................70 _9112_TIMER_Start ...................................................................
How to Use This Guide This manual is designed to help the users to understand and configure the PCI-9112 and cPCI-9112. The functionality of both the PCI-9112 and cPCI9112 are the same. Therefore, the “PCI-9112” in this manual represents both the PCI-9112 and cPCI-9112 unless otherwise specified. The manual is divided into 7 chapters: Chapter 1, “Introduction”, gives an overview of the product features, applications, and specifications. Chapter 2, “Installation”, describes how to install the PCI-9112.
1 Introduction The 9112 series products are multi-function data acquisition cards. The 9112 series includes: • PCI-9112: 12-bit 110KHz Multifunction DAS card • cPCI-9112: 12-bit CompactPCI • cPCI-9112R: 12-bit 110kHz Multifunction CompactPCI with Rear I/O connector 110KHz Multifunction DAS card for 3U DAS card for 3U The 9112 series DAS cards uses state-of-the-art technology, making it ideal for data logging and signal analysis applications in medicine, process control, etc.
1.1 Features The 9112 series Data Acquisition Card provides the following advanced features: • 32-bit PCI-Bus • 12-bit analog input resolution • On-board A/D FIFO memory • Auto-scanning channel selection • Up to 110KHz A/D sampling rates • 16 single-ended or 8 differential analog input channels • Bipolar or Unipolar input signals • Programmable Gain Control (x0.
1.
1.3 Specifications Analog Input (A/D) • Converter: ADS774 or equivalent, successive approximation type • Resolution: 12-bit • Numbers of Input Channel: 16 single-ended or 8 differential • Input Range: (Programmable) ±10V, ± 5V, ±2.5V, ±1.25V, ±0.625V 9 Bipolar: 9 Unipolar: 0~10V, 0~5V, 0~2.5V, 0~1.25V • Conversion Time: 8 µ sec • Throughput: 110KHz multiplexing (maximum) • Analog Input Over-voltage Protection: Continuous ± 35V max. • Accuracy: GAIN = 0.5, 1 GAIN = 2, 4 GAIN = 8 0.
• Output Range: 9 Internal Reference: (unipolar) 0~5V or 0~10V 9 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: • • • 9 Low: Min. 0V. Max. 0.8V 9 High: Min. +2.0V Input Load: 9 Low: +0.5V @ -0.2mA max. 9 High: +2.7V @+20mA max.
Programmable Counter • Timer / Counter Device: 8254 • A/D pacer timer: 32-bit timer (two 16-bit counter cascaded together) with a 2MHz time base • Pacer Frequency Range: 0.
• 1.4 PCB Dimension: 9 PCI-9112: Compact size only 102mm(H) X 173mm(L) 9 cPCI-9112/R: Standard CompactPCI form factor Software Supporting ADLINK provides versatile software drivers and packages for users’ different approach to building up a system. ADLINK not only provides programming libraries such as DLL for most Windows based systems, but also provide ® drivers for other software packages such as LabVIEW , HP VEETM, DASYLabTM, InTouchTM, InControlTM, ISaGRAFTM, and so on.
1.4.2 PCIS-LVIEW: LabVIEW® Driver PCIS-LVIEW contains the VIs, which are used to interface with NI’s ® LabVIEW software package. The PCIS-LVIEW supports Windows ® 95/98/NT/2000. The LabVIEW drivers is shipped free with the board. You can install and use them without a license. For more information about PCIS-LVIEW, please refer to the user’s guide in the CD. (\\Manual_PDF\Software\PCIS-LVIEW) 1.4.
1.4.7 PCIS-ISG: ISaGRAFTM driver The ISaGRAF WorkBench is an IEC1131-3 SoftPLC control program development environment. The PCIS-ISG includes ADLINK product drivers for ISaGRAF under Windows NT environment. The PCIS-ISG is included in the ADLINK CD. A license is needed to use the drivers. 1.4.8 PCIS-ICL: InControlTM Driver PCIS-ICL is the InControl driver, which supports Windows NT. The PCIS-ICL is included in the ADLINK CD. A license is needed to use the drivers 1.4.
2 Installation This chapter describes how to install the 9112 series cards. Please follow the steps carefully. • Check what you have (section 2.1) • Unpacking (section 2.2) • Check the PCB and jumper locations (section 2.3) • Setup jumpers (section 2.4~2.8) • Install the hardware (section 2.10) • Install the software drivers and run utility to test (section 2.11) • Set cabling with external devices (section 2.9 and 2.
2.1 What You Have In addition to this User's Guide, the package should include the following items: • PCI-9112 or cPCI-9112/R Enhanced Multi-function DAS Card • ADLINK Software CD • Software Installation Guide If any of these items are missing or damaged, contact the dealer from whom you purchased the product. Save the shipping materials and carton in case you want to ship or store the product in the future. 2.
2.3 Device Installation for Windows Systems Once Windows 95/98/2000 has started, the Plug and Play functions of Windows will find the new NuDAQ/NuIPC cards. If this is the first time a NuDAQ/NuIPC cards is running on your Windows system, you will be prompted to input the device information source. Please refer to the “Software Installation Guide” for step-by-step installation procedures.
2.4 PCB Layout PCI-9112 Layout Figure 2.
cPCI-9112 Layout Figure 2.
cPCI-9112R Layout Figure 2.
2.5 Jumper Settings The following configuration can be set with 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.
2.7 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 to counter 2 is connected to a precision 2MHz oscillator for the internal pacer. The input of counter 1 is cascaded from the output of counter 2. Channel 0 is free for user applications. There are two selections for the clock source of channel 0: the internal 2MHz clock or an external clock signal from connector CN3 pin 35.
JP4(PCI-9112, cPCI-9112R) 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.6 Analog Output Voltage Setting The internal D/A reference voltage can be set to –5V or –10V by JP3.
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. CN1 and CN2 are located on the board and CN3 is located at the rear plate. CN1 is for digital signal inputs, CN2 is for digital signal output, and CN3 is for analog input/output and timer/counter signals. The pin assignments for each connector are illustrated in Figure 2.8.1~ Figure 2.8.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 0 DI 2 DI 4 DI 6 DI 8 DI 10 DI 12 DI 14 GND +5V 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 DI 1 DI 3 DI 5 DI 7 DI 9 DI 11 DI 13 DI 15 GND +12V Figure 2.8.
2.9.
2.10 Hardware Installation Outline PCI configuration The PCI cards (or CompactPCI cards) are equipped with plug and play PCI controllers, it can request base addresses and interrupts according to PCI standards. The system BIOS will install the system resources based on the PCI cards’ configuration registers and system parameters (which are set by the system BIOS). Interrupt assignment and memory usage (I/O port locations) of the PCI cards can only be assigned by system BIOS.
2.11 Device Installation for Windows Systems Once Windows 95/98/2000 has started, the Plug and Play function of Windows system will find the new NuDAQ/NuIPC cards. If this is the first time the NuDAQ/NuIPC cards are running on your Windows system, you will be prompted to input the device information source. Please refer to the “Software Installation Guide” for step-by-step installation procedures. 2.12 Daughter Board Connection The PCI-9112 can be connected with five different daughter boards.
CN2 ACLD-9185 CN1 ACLD-9182 PCI-9112 2.12.4 Connect with ACLD-9185 The ACLD-9185 is a 16-channel SPDT relay output board. This board is connected to CN2 of the PCI-9112 via a 20-pin flat cable. By using this board, you can control external devices 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 it is equipped with a 37-pin D-sub connector.
3 Registers The descriptions of the registers and structure of the PCI-9112 are outlined in this chapter. The information in this chapter will assist programmers, who wish to handle the card with low-level programs. 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 a 32-bit PCI target device to any master on the PCI bus.
I/O Address Base + 0 Base + 4 Base + 8 Base + C Base + 10 Base + 14 Base + 18 Base + 1C Base + 20 Read Counter 0 Counter 1 Counter 2 ------------A/D Data Reg. ------------A/D Status Reg. Digital IN Reg. ------------- 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. Software Trigger Table 3.1 I/O Address 3.
3.3 D/A Output Register The D/A converter will convert the D/A output register data to analog signals. 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 controls 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 waits for the conversion.
The modes below applies only to the PCI-9112 card: Bit 3 EITS 0 0 0 1 1 1 Bit 2 TPST 0 1 1 X X X Bit 1 INTX 0 0 1 0 0 1 Bit 0 DMAX 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.
Gain: (Bit12 ~ Bit9) With the PCI-9112, the analog input ranges are software programmable and is controlled by the gain value. The gain values and its corresponding input range are shown below. (Bit12) (Bit11) (Bit10) G3 G2 G1 1 0 0 0 0 0 0 0 0 3.5 0 0 0 0 0 1 1 1 1 (Bit9) G0 0 0 0 1 1 0 0 1 1 0 0 1 0 1 0 1 0 1 Bipolar or Unipolar Bipolar Bipolar Bipolar Bipolar Bipolar Unipolar Unipolar Unipolar Unipolar Input Range ±10V ±5V ±2.5V ±1.25V ±0.625V 0V ~ 10V 0V ~ 5V 0V ~ 2.5V 0V ~ 1.
3.6 Software Trigger Register If you want to generate a trigger pulse to the PCI-9112 for A/D conversion, you just write any data to this register, and then the A/D converter will be triggered. Address: BASE + 20 Attribute: write only Data Format: Bit BASE+20 3.7 7 X 6 X 5 X 4 X 3 X 2 X 1 X 0 X 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 8254 counters are used to periodically trigger the A/D conversion, A third counter is left free for user applications. The 8254 occupies four I/O address locations in the PCI-9112 as shown below. Users can refer to NEC's or Intel's data sheet for a full description of the 8254 features.
4 Operation Theory The operation theory 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 theory can help you to understand how to configure or to program the PCI-9112. 4.
4.2 Analog Input Signal Connection The PCI-9112 provides 16 single-ended or 8 differential analog input channels. The analog signals can be converted to digital value by the A/D converter. To avoid ground loops and to obtain more accurate measurements, it is quite important to understand the signal source type and how to choose the analog input modes: signal-ended or differential. The PCI-9112 offers jumpers to select 16 single-ended or 8 different analog inputs.
n = 0, ..., 7 AIHn To A/D Converter + - Ground Signal AILn Source GND Vcm = VG1 - VG2 VG1 VG2 Figure 4.2.2 Ground source and differential input A differential mode must be used when the signal source is differential. A differential source means that the ends of the signal are not grounded. To avoid the danger of high voltages between the local ground of the signal and the ground of the PC system, a shorted ground path must be connected. Figure 4.2.3 shows the connection for a differential source.
If the signal source are both floating, you should use the differential mode, and the floating signal source should be connected as the Figure 4.2.4. n = 0, ..., 7 AIHn High AILn Low Floating Signal To A/D Converter Source GND Figure 4.2.4 Floating source and differential input 4.2.1 A/D Conversion Procedure The A/D conversion starts when a trigger is set by the trigger source. The PCI-9112 provides three trigger modes. See section 4.2.2.
Software trigger This trigger source is software controllable. That is, the A/D conversion starts when any value is written into the software trigger register (BASE+20). This trigger mode is suitable for low speed A/D conversions. Under this mode, the timing of the A/D conversion is fully controlled by the software. However, it is difficult to control a fixed A/D conversion rate unless another timer interrupt service routine is used to generate a fixed rate trigger.
Interrupt Transfer (INTX) The PCI-9112 provides hardware interrupt capability. Under this mode, an interrupt signal is generated when the A/D conversion has ended and the data is ready to be read. It is useful to combine the interrupt transfer with the timer pacer trigger mode. Under this mode, the data transfer is essentially asynchronous with the control software.
4.3 D/A Conversion The operation of the D/A conversion is less complex than the A/D operation. You only need to write digital values into the D/A data registers and the corresponding voltage will be outputted to AO1 or AO2. Refer to section 3.3 for information about the D/A data registers.
4.4 Digital Input and Output The PCI-9112 provides 16 digital input and 16 digital output channels through the connectors CN1 and CN2 on-board. The digital I/O signal is fully TTL/DTL compatible. The digital I/O signals are illustrated in Figure 4.4 . To program the digital I/O operation is fairly straightforward. The digital input operation is used to read data from 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 8254 timer/counter 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 conversions, and counter 0 is free for user applications. Figure 4.5 illustrates the 8254 timer/counter connections.
• Programmable baud rate generator • Event counter • Binary rate multiplier • Real-time clock • Digital one-shot • Motor control Pacer Trigger Source Counter 1 and 2 are cascaded together to generate the timer pacer trigger for A/D conversion. The frequency of the pacer trigger is software controllable. The maximum pacer signal rate is 2MHz/4=500KHz which exceeds the maximum A/D conversion rate of the PCI-9112.
5 C/C++ Library This chapter describes the software libraries for operating this card. Only the functions in the DOS library and Windows 95 DLL are described. Please refer to the PCIS-DASK function reference manual, which is included in the ADLINK CD, for descriptions for Windows 98/NT/2000 DLL functions. The function prototypes and useful constants are defined in the header files located in LIB (DOS) and INCLUDE (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 or NuIPC CompactPCI card software drivers uses full-names to represent the functions' real meaning. The naming convention rules are: In DOS Environment: _{hardware_model}_{action_name}. e.g. _9112_Initial().
5.3 _9112_Initial @ Description A PCI-9112 card is initialized according to the card number. Because the PCI-9112 has a 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 any other function calls are allowed.
@ Example #include "9112.h" main() { int errCode; int baseAddr1, irqNo1; int baseAddr2, irqNo2; errCode = _9112_Initial( CARD_1, &baseAddr1, &irqNo1); if ( errCode != ERR_NoError ) 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 the digital input port. There are 16 digital inputs on the PCI-9112. You can get all 16 input data from _9112_DI in one shot.
5.5 _9112_DI _Channel @ Description This function is used to read data from the digital input channels (bit). There are 16 digital input channels on the PCI-9112. When performing this function, the digital input port is read and the value of the corresponding channel is returned. * Channel means each bit of digital input ports.
@ Example #include “9112.h” main() { unsigned int data; int ch; int baseAddr, irqNo; _9112_Initial( CARD_1, &baseAddr, &irqNo); /* Assume NoError when Initialize PCI-9112 */ . . for( ch=0; ch<16; ch++ ) { _9112_DI_Channel(CARD_1, ch , &data ); printf( "The value of DI channel %d is %d.\n",ch , data); } } 5.6 _9112_DO @ Description This function is used to write data to the digital output port.
5.7 _9112_DA @ Description This function is used to write data to the D/A converters. There are two Digital-to-Analog conversion channels on the PCI-9112. The resolution of each channel is 12-bit, i.e. the range is from 0 to 4095.
5.8 _9112_AD_Set_Channel @ Description This function is used to set the AD channel by means of writing data to the multiplexed scan channel register. There are 16 single-ended or 8 differential analog input channels in the PCI-9112, so the channel number can be set between 0 to 15 for single-ended analog input mode, and 0 to 7 for differential analog input mode. The initial state is channel 0 which is the default setting for the PCI-9112 hardware configuration.
5.9 _9112_AD_Set_Range @ 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 that will change the analog input range - Gain and Input type. The Gain can be from 0.5, 1, 2, 4, and 8 .The input type can be either Bipolar or Unipolar. The initial gain value is '1‘ and input type is bipolar, which are pre-set by the PCI-9112 hardware.
5.10 _9112_AD_Set_Mode @ Description This function is used to set the A/D trigger and data transfer mode by means of writing data to the mode control register. The hardware initial state is set as AD_MODE_0 software (internal) trigger with program polling data. For a detailed description of the DMA bus-mastering mode refer to section 4.13.
_9112_AD_Set_Mode(CARD_1, AD_MODE_4 ); printf( "Now, The Internal Timer Pacer trigger is set \n" ); /* All A/D conversion will be trigger by internal timer pacer, and the converted data should be transfered in the interrupt service routine. (ISR). */ } 5.11 _9112_AD_Set_Autoscan @ Description This function is used to enable or disable an automatic hardware channel scan.
5.12 _9112_AD_Soft_Trig @ Description This function is used to trigger the A/D conversion by software. When the function is called, a trigger pulse will be generated and A/D conversion will start, and the converted data will be stored in the base address Base + 0x10 after the conversion.
@ Argument card_number: the card number of PCI-9112 ad_data: 12-bit A/D converted value, the value should be within 0 to 4095. Bit 0 ~ Bit 3: is the converted channel number Bit 4 ~ Bit 15: is the converted A/D data. @ Return Code: ERR_NoError, ERR_BoardNoInit ERR_AD_AquireTimeOut @ Example #include “9112.
5.14 _9112_AD_DMA_Start @ Description This function will perform A/D conversion N times with DMA data transfer. It takes place in the background which will not stop until the Nth conversion has completed or your program executes a _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(). This 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 has started, the A/D converted data is stored in the FIFO of the 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 PCI9112 will relinquish the bus temporarily but returns immediately when more A/D samples appear.
@ Argument card_number: the card number of PCI-9112 auto_scan: TRUE or FALSE Example1: auto_scan is FALSE, ad_ch_no is 3. Using DMA mode to read A/D data only channel 3. Example2: auto_scan is TRUE, ad_ch_no is 3. Using DMA mode to read A/D data with multi-channel , channel 3, 2, 1 and 0. Reading sequence is channel 3,2,1,0, 3,2,1,0,3,2,1,0.... ad_ch_no: A/D channel number ad_range: A/D analog input range, the possible values are shown in section 4.3.8.
5.15 _9112_AD_DMA_Status @ Description Since the _9112_AD_DMA_Start function executes in the background, you can issue the function _9112_AD_DMA_Status to check its operation status.
5.16 _9112_AD_DMA_Stop @ Description This function is used to stop the DMA data transferring. After executing this function, the internal A/D trigger is disable and the A/D timer ( timer #1 and #2) is stopped. The function returns the amount of data, which have been transferred, no matter if the A/D DMA data transfer is stopped by this function or by the DMA terminal counts ISR.
5.17 _9112_ContDmaStart @ Description This function will perform A/D conversion continuously with DMA data transfer. It takes place in the background which will not stop until your program execute _9112_ContDmaStop() function to stop the process. After executing this function, it is necessary to check the status of the double buffer by using the function _9112_CheckHalfReady() and using _9112_DblBufferTransfer() to get the A/D converted data.
@ Argument card_number: the card number of PCI-9112 auto_scan: TRUE or FALSE Example1: auto_scan is FALSE, ad_ch_no is 3. Using DMA mode to read A/D data only channel 3. Example 2: auto_scan is TRUE, ad_ch_no is 3. Using DMA mode to read A/D data with multi-channel, channel 3, 2, 1 and 0. Reading sequence is channel 3,2,1,0, 3,2,1,0,3,2,1,0.... ad_ch_no: A/D channel number ad_range: A/D analog input range, please refer to the section 4.3.8 for the possible values.
5.18 _9112_CheckHalfReady @ Description When using _9112_ContDmaStart() to convert A/D data, you must use _9112_CheckHalfReady() to check the data ready or not status in the circular buffer. The size of the data is half of the circular buffer (count/2) and can be retrieved using _9112_DblBufferTransfer().
5.19 _9112_DblBufferTransfer @ Description Use this function to move converted A/D data to user buffers.
5.20 _9112_GetOverrunStatus @ Description When using _9112_ContDmaStart() to convert A/D data and _9112_DblBufferTransfer is not used to move converted data the double buffer overrun will occur, you can use this function to check overrun counts.
5.21 _9112_ContDmaStop @ Description This function is used to stop continuous DMA data transfers. @ Syntax Visual C++ (Windows-95) int W_9112_ContDmaStop (int card_number) Visual Basic (Windows-95) W_9112_ContDmaStop (ByVal card_number As Long) As Long C/C++ ( DOS) int _9112_ContDmaStop (int card_number) @ Argument: card_number: the card number of PCI-9112 @ Return Code: ERR_NoError, ERR_BoardNoInit @ Example: See Demo Program 'AD_DEMO5.C' 5.
@ Argument card_number: the card number of PCI-9112 auto_scan: TRUE or FALSE Example1: auto_scan is FALSE, ad_ch_no is 3. Using DMA mode to read A/D data only channel 3. Example2: auto_scan is TRUE, ad_ch_no is 3. Using INT mode to read A/D data with multi-channel , channel 3, 2, 1 and 0. Reading sequence is channel 3,2,1,0, 3,2,1,0,3,2,1,0.... ad_ch_no: A/D channel number ad_range: A/D analog input range, please refer to the section 4.3.8 for the possible values.
5.23 _9112_AD_INT_Status @ Description Since the _9112_AD_INT_Start() function executes in the background, you can issue the function _9112_AD_INT_Status to check the status of interrupt operation.
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 disabled and the AD timer is stopped. The function returns the amount of 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.
5.25 _9112_AD_Timer @ Description This function is used to setup Timer #1 and #2. Timer #1 and #2 are used as frequency divider for generating constant A/D sampling rate. It is possible to stop the pacer trigger by setting any one of the dividers as 0. Because the AD conversion rate is limited due to the conversion time of the AD converter, the highest sampling rate of the PCI-9112 cannot exceed 100 KHz. The multiplication of the dividers must be larger than 20.
@ Example main() { int errCode; Int baseAddr, irqNo; _9112_Initial( CARD_1, &baseAddr, &irqNo); /* Assume NoError when Initialize PCI-9112 */ .. _9112_AD_Timer(CARD_1,10 , 10 ); /* set AD sampling rate to 2MHz/(10*10) */ _9112_AD_Timer(CARD_1, 0 , 0 ); /* stop the pacer trigger */ } 5.26 _9112_TIMER_Start @ Description Timer #0 on the PCI-9112 is available for programming by the user. This function is used to program Timer #0. This timer can be used as a frequency generator if internal clocks are used.
5.27 _9112_TIMER_Read @ Description This function is used to read the counter value of Timer #0.
5.29 _9112_Alloc_DMA_Mem @ Description Contacts Windows 95 system to allocate a block of contiguous memory for DMA transfer. This function is only available in Windows 95 version. @ Syntax Visual C++(Windows-95) int W_9112_Alloc_DMA_Mem (unsigned long buf_size, HANDLE *memID, unsigned long *linearAddr) Visual Basic (Windows-95) W_9112_Alloc_DMA_Mem (ByVal buf_size As Long, memID As Long, linearAddr As Long) As Long @ Argument: buf_size: Bytes to allocate.
5.30 _9112_Free_DMA_Mem @ Description De-allocate a system DMA memory under Windows 95 environment. This function is only available in Windows 95 version. @ Syntax Visual C++(Windows-95) int W_9112_Free_DMA_Mem (HANDLE memID) Visual Basic (Windows-95) W_9112_Free_DMA_Mem (ByVal memID As Long) As Long @ Argument: memID: The memory ID of the system DMA memory to deallocate. @ Return Code: ERR_NoError 5.
6 Calibration In data acquisition processes, how to calibrate your measurement devices to maintain its accuracy is very important. Users can calibrate the analog input and output channels under the users' operating environment to maximize the accuracy. This chapter will guide you though how to calibrate the PCI-9112. 6.
6.2 VR Assignment There are five variable resistors (VR) on the PCI-9112 board for making adjustments on the A/D and D/A channels. The function of each VR is specified in Table 6.1. VR1 VR2 VR3 VR4 VR5 VR6 VR7 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 Functions of VRs 6.
6.3.2 Unipolar Calibration (Gain = 1, i.e. input range = 0~+10V) 1. Set the A/D input range to bipolar 5V. 2. Adjust the voltage calibrator’s voltage output to –4.9987V (i.e. –Vfull scale + 1/2 LSB). Apply this signal to A/D channel 0. 3. Trim VR1 to obtain a reading which toggles between 0 and 1. 4. Set A/D input range to unipolar 10V (i.e. gain = 1, 0 to +10V range). 5. Adjust the voltage calibrator’s voltage output to +1.22mV (-Vfull scale + 1/2 LSB, i.e. 0V+1.22mV).
6.4 D/A Adjustment There are two steps in calibrating the analog output channels, D/A 1 and D/A 2. The first step is to adjust the reference voltage for the D/A channel, and then adjust the full range of each D/A channel. 6.4.1 Reference Voltage Calibration 1. Set the reference voltage as -5V (Refer to section 2.8 to see the internal reference setting). 2. Connect the DVM (+) to CN3 pin-11 (V.REF) and DVM (-) to GND. Trim the variable resister VR6 to obtain a -5V reading on the DVM.
D/A CH2 calibration 1. Connect the DVM (+) to CN3 pin-32 (AO2) and the DVM (-) to A.GND. 2. Write the Digital value 0x0FFF into the register at Base+14 address 3. Trim the variable resister VR4 to obtain a +5V reading on the DVM. A calibration utility is included with the ADLINK CD, which is included with the product package. A detailed calibration procedure and description can be found in the utility. Users only need to run the software calibration utility and follow the procedures.
7 Software Utilities The utility program in the software package includes System Configuration, Calibration, and Functional testing. All the utilities use menu-driven operating mode based on Windows environment, so it is very easy to operate and not much learning effort is required. In addition to the Utility and C/C++, DLL Libraries, some demonstration programs are also included; users can refer them and save a lot of programming time and get some other benefits as well.
2. Calibration: Calibrate the A/D and D/A measurement accuracy 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. DMA Testing: Testing utility for DMA (bus-mastering) A/D data transfer mode. 6. Quit: Exit the utility. 7.1.2 System Configuration This function is used to guide you through on how to install the PCI-9112 card, and set the right hardware configuration.
7.1.4 Functional Testing This function is used to test the multi-functionalities of PCI-9112; it includes Digital I/O, D/A, A/D, Timer, and DMA testing. When you choose this test function from the main menu list, a diagram is displayed on the screen; the upper window shows the testing items, and the bottom window shows the testing results. 7.2 PCI SCAN Utility A PCI bus devices scanning utility (PCI_SCAN.EXE) for DOS is included in the CD. This utility is used for trouble shooting the board.
Appendix A. Demo Programs DOS Examples: There are 8 DOS demonstration programs available in the software CD. They can provide assistance when programming your application using C programming Language. The description of these programs are specified in the table below: 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 using software trigger and program data transfer. A/D conversion using interrupts and program data transfer.
The description of these programs are specified as follows: Samples\sdk\9112\ 9112util.exe A/D conversion using software trigger and program data transfer. Visual C/C++ program. Samples\sdk\9112int\ 9112int.exe A/D conversion using interrupt transfer. Visual C/C++ program. Samples\sdk\9112dma\ 9112dma.exe A/D conversion using DMA data transfer. Visual C/C++ program. Samples\sdk\9112cdma\ 9112cdma.exe A/D conversion using DMA data transfer with double-buffering mechanism. Visual C/C++ program.
Warranty Policy Thank you for choosing ADLINK. To understand your rights and enjoy all the after-sales services we offer, please read the following carefully. 1. Before using ADLINK’s products please read the user manual and follow the instructions exactly. When sending in damaged products for repair, please attach an RMA application form which can be downloaded from: http://rma.adlinktech.com/policy/. 2. All ADLINK products come with a limited two-year warranty, one year for products bought in China.
4. • Damage caused by inappropriate storage environments such as with high temperatures, high humidity, or volatile chemicals. • Damage caused by leakage of battery fluid during or after change of batteries by customer/user. • Damage from technicians. • Products with altered and/or damaged serial numbers are not entitled to our service. • This warranty is not transferable or extendible. • Other categories not protected under our warranty.