Summary of Contents for ADLINK Technology PCI-9118 DG
Page 1
PCI-9118 DG/HG/HR PCI-Bus Advanced Data Acquisition Card...
Page 2
Trademarks NuDAQ is a registered trademark of ADLink Technology Inc., Intel is a registered trademark of Intel Corporation, MS-DOS & Windows 95 are registered trademarks of Microsoft Corporation, Borland C++ is a registered trademark of Borland International, Inc.
CONTENTS How to Use This Guide ......v Introduction ..........1 Features................1 Applications.................2 Specifications ..............2 Installation..........5 What You Have ..............5 Unpacking ................6 Device Installation for Windows 95 ........6 PCI-9118DG/HG Layout............8 PCI-9118HR Layout ............9 PCI Configuration ..............10 Signal Connections ......... 11 Connectors Pin Assignment ..........11 Analog Input Signal Connection.........13 Analog Output Signal Connection ........15...
Page 4
A/D Gain/Channel Register ..........25 4.10 A/D Burst Number Register ..........26 4.11 A/D Auto Scan Mode............26 4.12 A/D Function Register ............27 4.13 A/D FIFO Reset Register...........28 4.14 Interrupt Control Register ..........29 4.15 Interrupt Status Register............29 Operation Theorem ......... 31 A/D Conversion ..............31 5.1.1 A/D Conversion Procedure ..........
How to Use This Guide This manual is designed to help you use the PCI-9118. The manual describes how to modify various settings on the PCI-9118 card to meet your requirements. It is divided into six chapters: • Chapter 1, "Introduction", gives an overview of the product features, applications, and specifications.
Introduction The PCI-9118 series is a family of advanced performance, data acquisition card based on the 32-bit PCI Bus architecture. High performance designs and the state-of-the-art technology make this card ideal for data logging and signal analysis applications in medical, process control, and etc. Software Supporting : For the customer who are writing their own programs, we provide MS-DOS C/C++ programming library and Windows 95 DLL library for PCI-9118.
Installation This chapter describes how to install the PCI-9118DG/HG/HR. At first, the contents in the package and unpacking information that you should be careful are described. The PCI-9118DG/HG/HR does an automatic configuration of the IRQ, port address, and BIOS address. So, you do not need to set above configuration as you use ISA form factor DAS card.
Unpacking Your PCI-9118 card contains sensitive electronic components that can be easily damaged by static electricity. The card should be handled on a grounded anti-static mat. The operator should be wearing an anti-static wristband, grounded at the same point as the anti-static mat. Inspect the card module carton for obvious damage.
Page 15
Choose the default option “ Driver from disk provided by hardware manufacturer ” and then a dialog box is shown to prompt you give the path of installation disk. Place ADLink’ s “Manual & Software Utility” CD into the appropriate CD driver.
PCI Configuration 1. Plug and Play : As a plug and play component, the board requests an interrupt number via a system call. The system BIOS responds with an interrupt assignment based on the board information and on known system parameters. These system parameters are determined by the installed drivers and the hardware load seen by the system.
Signal Connections This chapter describes the connector of the PCI-9118, also the signal connection between the PCI-9118 and external devices, such as daughter boards or other devices. Connectors Pin Assignment The PCI-9118 is equipped one 50-pin D-type connector - CN1. CN1 for digital signal input, digital signal output, analog input, analog output and timer/counter's signals.
Page 20
• CN 1 : Digital Signal Input, Digital Signal Output, Analog Input/Output & Counter/Timer (diff) (diff) U_CMMD AIH0 AIL0 AIH1 AIL1 AIH2 AIL2 AI10 AIH3 AIL3 AI11 AIH4 AIL4 AI12 AIH5 AIL5 AI13 AIH6 AIL6 AI14 AIH7 AIL7 AI15 A.GND DAC0 DAC1 +15V...
DACn : Analog Output Channel n SSHO : SSH Output Signal DOSTB : Strobe Signal ADCHNn : Multiplexer Control Line n ADGAIN2 : External Gain Control Line A.GND : Analog Ground D.GND : Digital Ground Analog Input Signal Connection The PCI-9118 provides 16 single-ended or 8 differential analog input channels.
Page 22
Differential input mode The differential input mode provides two inputs that respond to the difference signal between them. If the signal source has one side connected to local ground, the differential mode can be used for reducing ground loop. Figure 3.3 shows the connection of the differential input mode.
n = 0, … , 7 n = 0, ..., 8 To A/D Converter AIHn Differential Signal Source AILn Vcm = VG1 - VG2 Figure 3.4 Differential source and differential input If your signal source is both floating and local ground, you should use the differential mode, and the floating signal source should be connected as the Figure 3.5.
-5 or -10 INT or Ext Pin-30 ( AO0) Ref In Pin-32 ( AO1) D/A Converter To D/A Output D/A Output Pin-14 ( A.GND) Analog GND Figure 3.6 Connection of Analog Output Connection Digital I/O Connection The PCI-9118 provides 4 digital input and 4 digital output channels on board.
Page 25
shows the 8254 timer/counter connection. TGOUT SSHO EXTTRG Trigger/Gate and TGIN Burst Mode Control Counter 0 CLK0 GATE0 Counter 1 CLK1 GATE1 Counter 2 CLK1 GATE1 82C54 Timer/Counter Prescaler 4MHz Osc. Figure 3.8 Block Diagram of 8254 Timer/Counter The clock source of counter 0 can be internal or external from EXTTRIG (pin44).
DG/HG/HR in the shortest learning time. I/O Port Address The PCI-9118 DG/HG/HR functions as 32-bit PCI target device to any master on the PCI bus. It supports burst transfer to memory space by using 32-bit data. So, all data read and write will base on 32-bit data.
I/O Address Read Write Base + 0x00 Counter 0 Counter 0 Base + 0x04 Counter 1 Counter 1 Base + 0x08 Counter 2 Counter 2 Base + 0x0C ---------- 8254 Counter Control Base + 0x10 A/D Data Reg. CH1 D/A Data Reg. Base + 0x14 ---------- CH2 D/A Data Reg.
AD11 .. AD0 : Analog to digital data. AD11 is the Most Significant Bit (MSB). AD0 is the Least Significant Bit (LSB). CH3 ~ CH0 : A/D channel number from which the data is derived. --- : Don‘ t care D/A Output Register The D/A converter will convert the D/A output register data to the analog signal.
A/D control Register This register is used to control the A/D mode. It's a write only register. Address : BASE + 18 Attribute : write only Data Format : Base + 18 UniP Diff SoftG ExtG ExtM TmrTr Base + 19 Base + 1A Base + 1B UniP (Bit7) :...
A/D Status Register Address : BASE + 18 Attribute : read only Data Format : Base + 18 nHFull NEpty Acmp Bover ADOS ADOR ADrdy Base + 19 nFull Base + 1A Base + 1B nFull (Bit8) : A/D FIFO Full status (Fatal Error !) 0: FIFO Full 1: FIFO not Full nHFull(Bit7):...
Digital I/O register There are 4 digital input channels and 4 digital output channels provided by the PCI-9118. The address Base + 1C is used to access digital inputs and control digital outputs. Address : BASE + 1C Attribute : read only Data Format : Base + 1C Base + 1D...
BASE+20 BASE+21 BASE+22 BASE+23 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-9118 as shown blow. Users can refer to NEC's or Intel's data sheet for a full description of the 8254 features.
Gain1~Gain0 (bit9~bit8) : Gain selection bits bits 9~8 (Gain1 Gain 0) 1000/8 100/4 10/2 4.10 A/D Burst Number Register Address : BASE + 0x28 Attribute : write only Data Format : Base+0x28 Burst Number[7..0] Base+0x29 Base+0x2A Base+0x2B 4.11 A/D Auto Scan Mode Address : BASE + 0x2C Attribute : write only Data Format :...
4.12 A/D Function Register Address : BASE + 0x30 Attribute : write only Data Format : Base+0x30 PDTrg PETrg BSSH BM Start Base+0x31 Base+0x32 Base+0x33 PDTrg (bit7): Digital Trigger Positive/Negative Active 1: Positive Trigger 0: Negative Trigger Note: Only “Positive Trigger” setting is valid for the trigger acquisition of PCI-9118.
AM (bit 1) : About Trigger Mode 1: About Trigger 0: not About Trigger Start (bit 0) : Trigger Start Control 1: Trigger Start 0: Trigger Stop Start Description Post Trigger Mode ,user can initialize 8254 for setting trigger number Post Trigger Mode Start About Trigger Mode ,user can initialize 8254 for setting trigger number...
Operation Theorem The operation theorem of the functions on PCI-9118DG/HG/HR 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-9118DG/HG/HR.
5.1.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. PCI- 9118DG/HG/HR provides three trigger modes, described in section 5.1.4. While A/D conversion, the ADrdy bit in A/D status register is cleared to indicate the data is not ready.
Page 41
Software trigger The trigger source is software controllable in this mode. That is, the A/D conversion is starting when any value is written into the software trigger register (BASE+20). This trigger mode is suitable for low speed A/D conversion. Under this mode, the timing of the A/D conversion is fully controlled under software.
Page 42
Burst Mode with SSH Use burst mode with SSH if you want to accurately control both the period between conversions of the entire scan and if you want to simultaneously sample all channels in a scan. Each pulse from the pacer clock starts a simultaneous scan of all channels.
5.1.3 A/D Data Transfer Modes On the PCI-9118DG/HG/HR, three A/D data transfer modes can be used when the conversion is completed. The data transfer mode is controlled by the A/D mode control bits (Int, Dma) of the A/D control register (BASE+18). The different data transfer modes are specified as follows: Software Data Transfer (ADrdy) Usually, this mode is used with software A/D trigger mode.
DMA Transfer (Dma) The DMA (Direct Memory Access) bus master allows data to be transferred directly between the PCI-9118 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-9118 itself and it is automatically transferred to PC's memory.
Pre-trigger Use pre-trigger acquisition in application where you want to collect data before a specified trigger event. The trigger is a digital trigger which is input from pin 46 (TGIN) on CN1. To set pre-trigger mode, set AM bit of A/D Function Register as ‘ 1’ and set 8254 counter value as 1.
For analog input operation through interrupt and DMA mode, the channel and ranges you want to acquire samples can be specified in a hardware channel-gain queue. You can fill the channel number in the channel-gain queue in consecutive order or in nonconsecutive order.
Digital Input and Output 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. The digital I/O registers ‘ format are shown in section 4.6.
Page 48
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. The maximum pacer signal rate is 4MHz/4=1000K which exceeds the maximum A/D conversion rate of the PCI-9118.
Page 49
Select Counter 1 Select Counter 2 ILLEGAL • RL1 & RL0 - Select Read/Load operation (Bit 5 & Bit 4) OPERATION COUNTER LATCH FOR STABLE READ READ/LOAD LSB ONLY READ/LOAD MSB ONLY READ/LOAD LSB FIRST, THEN MSB • M2, M1 & M0 - Select Operating Mode (Bit 3, Bit 2, & Bit 1) MODE •...
Page 50
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. •...
C/C++ Software Library There are 49 function calls provided by the C Language library. This library includes all the functions of PCI-9118 DG/HG/HR. The capabilities of these function calls include A/D conversion, D/A conversion, Digital Input and Output, etc. In addition, there are some sample programs to help you use this library.
Page 52
u Window 95 Software Installation step 1. Place the ADLink’ s “Manual & Software Utility” CD into the appropriate CD driver. step 2. If Windows 95 is loaded, choose Run from the Start menu. step 3. Type X:\Software\NuDAQPCI\9118\Win95\Setup.exe in the Run dialog box. (X indicates the CD ROM driver).
files (W95_9118.VXD and PCIW95.VXD) are also copied to the appropriate directory. C/C++ Programming Library We defined some data type in acl_pci.h. These data types are used by PCI-9118 library. We suggest you to use these data types in your application programs. The following table shows the data type names and their range.
Page 54
In order to recognize the difference between DOS library and Windows 95 library, A capital "W" is put on the head of each function name of the Windows 95 DLL driver. e.g. W_9118_Initial(). There are 52 functions provided by PCI-9118 software drivers. The detail descriptions of each function are specified in the following sections.
6.2.2 _9118_Initial @ Description This function is used to initialize PCI-9118. Every PCI-9118 has to be initialized by this function before calling other functions. @ Syntax C/C++ (DOS) int _9118_Initial (I16 cardNo, I16 *base_address, I16 *irq_no ) C/C++ (Windows 95) int W_9118_Initial (int cardNo, U16 *base_address1,U16 *base_address2, U8 *irq_no, U8 *pci_master) Visual Basic (Windows 95)
pci_master : BIOS enables or disables bus mastering in PCI Command Register @ Return Code ERR_NoError ERR_PCIBiosNotExist ERR_PCICardNotExist ERR_PCIIrqNotExist 6.2.3 _9118_Switch_Card_No @ Description This function is used on multi-cards system. After the PCI-9118 cards are initialized by _9118_Initial function, you can use this function to select which one you want to operate.
6.2.4 _9118_DI @ Description This function is used to read data from digital input port. There are 4 digital input channels on PCI_9118. The all 4 bits can be accessed by this function directly. @ Syntax C/C++ (DOS) int _9118_DI (unsigned int far *data ) C/C++ (Windows 95) int W_9118_DI(U16 cardNo, unsigned int *data ) Visual Basic (Windows 95)
@ Syntax C/C++ (DOS) int _9118_DI_Channel (I16 di_ch_no , unsigned int far *data ) C/C++ (Windows 95) int W_9118_DI_Channel(U16 cardNo, I16 di_ch_no , U16 *data ) Visual Basic (Windows 95) W_9118_DI_Channel (ByVal cardNo As Integer, ByVal di_ch_no As Long, data As Long) As Long @ Argument cardNo (Win-95): the card number of PCI-9118 to be initialized, totally 4 cards can be initialized, the valid...
As Long @ Argument cardNo (Win-95): the card number of PCI-9118 to be initialized, totally 4 cards can be initialized, the valid card numbers are PCI_CARD1, PCI_CARD2, … , PCI_CARD12. data: the data written to output port. @ Return Code ERR_NoError ERR_BoardNoInit 6.2.7 _9118_DA...
@ Return Code ERR_NoError ERR_InvalidDAChannel ERR_BoardNoInit 6.2.8 _9118_AD_Reset_AFIFO @ Description This function is used to reset A/D Channel/Gain Register. Before calling _9118_AD_Set_GainChn (refer to section 6.2.14) to set A/D channel and input range, you have to perform this function to clear A/D Channel/Gain Register.
6.2.9 _9118_AD_Bgnset_AFIFO @ Description Users can not set the A/D channel and input range unless this function is executed. Therefore after this function is performed, the program can start to fill out A/D Channel/Gain register to set the A/D channel and range. @ Syntax C/C++ (DOS) int _9118_AD_Bgnset_AFIFO()
Visual Basic (Windows 95) W_9118_AD_Endset_AFIFO (ByVal cardNo As Integer) As Long @ Argument cardNo (Win-95): the card number of PCI-9118 to be initialized, totally 4 cards can be initialized, the valid card numbers are PCI_CARD1, PCI_CARD2, … , PCI_CARD12. @ Return Code ERR_NoError ERR_BoardNoInit 6.2.11 _9118_AD_Reset_DFIFO...
6.2.12 _9118_AD_Set_Burst_No @ Description If the A/D conversion mode is set as burst mode, this function is used to set the number of conversion channels in a scan trigger. @ Syntax C/C++ (DOS) int _9118_AD_Set_Burst_No(int BurstNo) C/C++ (Windows 95) int W_9118_AD_Set_Burst_No(U16 cardNo, int BurstNo) Visual Basic (Windows 95) W_9118_AD_Set_Burst_No (ByVal cardNo As Long, ByVal BurstNo As Integer) As Long...
C/C++ (Windows 95) int W_9118_INT_Set_CtrlReg(U16 cardNo, int CtrlVal) Visual Basic (Windows 95) W_9118_INT_Set_CtrlReg (ByVal cardNo As Long, ByVal CtrlVal As Integer) As Long @ Argument cardNo (Win-95): the card number of PCI-9118 to be initialized, totally 4 cards can be initialized, the valid card numbers are PCI_CARD1, PCI_CARD2, …...
Page 65
@ Syntax C/C++ (DOS) int _9118_AD_Set_GainChn (int ch, int gain ) C/C++ (Windows 95) int W_9118_AD_Set_GainChn(U16 cardNo, int ch,int gain) Visual Basic (Windows 95) W_9118_AD_Set_GainChn (ByVal cardNo As Integer, ByVal ch As Long, ByVal gain As Long) As Long @ Argument cardNo (Win-95): the card number of PCI-9118 to be initialized, totally 4 cards can be initialized, the valid card numbers are PCI_CARD1, PCI_CARD2, …...
Page 67
@ Argument cardNo (Win-95): the card number of PCI-9118 to be initialized, totally 4 cards can be initialized, the valid card numbers are PCI_CARD1, PCI_CARD2, … , PCI_CARD12. ch : the channel on which perform start : the First channel number in a group of consecutive channels, the valid value is 0 to end : the last channel number in a group of...
@ Return Code ERR_NoError ERR_AD_InvalidChannel ERR_BoardNoInit ERR_InvalidADGain 6.2.16 _9118_AD_Soft_Trig @ Description This function is used to trigger the A/D conversion by software. This function generates a trigger pulse to PCI-9118 for A/D conversion and the converted data will be stored in A/D data register.
@ Syntax C/C++ (DOS) int _9118_AD_Set_Unip (int Unip) C/C++ (Windows 95) int W_9118_AD_Set_Unip(U16 cardNo, int Unip) Visual Basic (Windows 95) W_9118_AD_Set_Unip (ByVal cardNo As Integer, ByVal Unip As Long) As Long @ Argument cardNo (Win-95): the card number of PCI-9118 to be initialized, totally 4 cards can be initialized, the valid card numbers are PCI_CARD1, PCI_CARD2, …...
cardNo (Win-95): the card number of PCI-9118 to be initialized, totally 4 cards can be initialized, the valid card numbers are PCI_CARD1, PCI_CARD2, … , PCI_CARD12. Diff: 0: single-ended 1: differential @ Return Code ERR_NoError ERR_BoardNoInit 6.2.19 _9118_AD_Set_SoftG @ Description This function is used to specify the status of software Gate, i.e.
6.2.20 _9118_AD_Set_ExtG @ Description This function is used to specify the A/D control as External Gate control mode or Software Gate Control mode. @ Syntax C/C++ (DOS) int _9118_AD_Set_ExtG (int ExtG) C/C++ (Windows 95) int W_9118_AD_Set_ExtG(U16 cardNo, int ExtG) Visual Basic (Windows 95) W_9118_AD_Set_ExtG (ByVal cardNo As Integer, ByVal ExtG As Long) As Long @ Argument...
@ Syntax C/C++ (DOS) int _9118_AD_Set_ExtM (int ExtM) C/C++ (Windows 95) int W_9118_AD_Set_ExtM(U16 cardNo,int ExtM) Visual Basic (Windows 95) W_9118_AD_Set_ExtM (ByVal cardNo As Integer, ByVal ExtM As Long) As Long @ Argument cardNo (Win-95): the card number of PCI-9118 to be initialized, totally 4 cards can be initialized, the valid card numbers are PCI_CARD1, PCI_CARD2, …...
cardNo (Win-95): the card number of PCI-9118 to be initialized, totally 4 cards can be initialized, the valid card numbers are PCI_CARD1, PCI_CARD2, … , PCI_CARD12. TmrTr: 1: 8254 Timer (Counter) is internal trigger source. 0: Software Trigger is internal trigger source.
ERR_NoError ERR_BoardNoInit 6.2.24 _9118_AD_Set_Dma @ Description This function is used to specify the status of DMA transfer mode. To enable DMA Transfer opreration, ‘ Dma’ should be set as 1; otherwise the DMA operation will not be performed. @ Syntax C/C++ (DOS) int _9118_AD_Set_Dma (int Dma) C/C++ (Windows 95)
i.e. the A/D mode is set as bi-polar, single-ended and software trigger). The definition of each bit of ‘ CtrlVal’ is as follows: UniP Diff SoftG ExtG ExtM TmrTr Int @ Syntax C/C++ (DOS) int _9118_AD_Set_CtrlReg(int CtrlVal) C/C++ (Windows 95) int W_9118_AD_Set_CtrlReg(U16 cardNo, int CtrlVal) Visual Basic (Windows 95) W_9118_AD_Set_CtrlReg (ByVal cardNo As Integer, ByVal...
PDTrg As Long) As Long @ Argument cardNo (Win-95): the card number of PCI-9118 to be initialized, totally 4 cards can be initialized, the valid card numbers are PCI_CARD1, PCI_CARD2, … , PCI_CARD12. PDTrg: 0: Negative Trigger 1: Positive Trigger @ Return Code ERR_NoError ERR_BoardNoInit...
ERR_BoardNoInit 6.2.28 _9118_AD_Set_BSSH @ Description This function is used to enable and disable A/D Burst Mode with Sample and Hold. @ Syntax C/C++ (DOS) int _9118_AD_Set_BSSH (int BSSH) C/C++ (Windows 95) int W_9118_AD_Set_BSSH(U16 cardNo, int BSSH) Visual Basic (Windows 95) W_9118_AD_Set_BSSH (ByVal cardNo As Integer, ByVal BSSH As Long) As Long @ Argument...
@ Syntax C/C++ (DOS) int _9118_AD_Set_BM (int BM) C/C++ (Win95) int W_9118_AD_Set_BM(U16 cardNo, int BM) Visual Basic (Windows 95) W_9118_AD_Set_BM (ByVal cardNo As Integer, ByVal BM As Long) As Long @ Argument cardNo (Win-95): the card number of PCI-9118 to be initialized, totally 4 cards can be initialized, the valid card numbers are PCI_CARD1, PCI_CARD2, …...
@ Argument cardNo (Win-95): the card number of PCI-9118 to be initialized, totally 4 cards can be initialized, the valid card numbers are PCI_CARD1, PCI_CARD2, … , PCI_CARD12. 0: stops Burst Mode 1: starts Burst Mode @ Return Code ERR_NoError ERR_BoardNoInit 6.2.31 _9118_AD_Set_PM @ Description...
6.2.32 _9118_AD_Set_AM @ Description This function is used to enable and disable About Trigger Mode. @ Syntax C/C++ (DOS) int _9118_AD_Set_AM (int AM) C/C++ (Windows 95) int W_9118_AD_Set_AM(U16 cardNo, int AM) Visual Basic (Windows 95) W_9118_AD_Set_AM (ByVal cardNo As Integer, ByVal AM As Long) As Long @ Argument cardNo (Win-95): the card number of PCI-9118 to be initialized,...
Visual Basic (Windows 95) W_9118_AD_Set_Start (ByVal cardNo As Integer, ByVal Start As Long) As Long @ Argument cardNo (Win-95): the card number of PCI-9118 to be initialized, totally 4 cards can be initialized, the valid card numbers are PCI_CARD1, PCI_CARD2, … , PCI_CARD12.
card numbers are PCI_CARD1, PCI_CARD2, … , PCI_CARD12. FuncVal: the value written to A/D Function Register. @ Return Code ERR_NoError ERR_BoardNoInit 6.2.35 _9118_AD_Aquire @ Description This function is used to poll the A/D conversion data. It will trigger the A/D conversion, and read the A/D data when the data is ready ('data ready' bit becomes low).
For PCI-9118HR, all the 16 bits are the converted A/D data. @ Return Code ERR_NoError ERR_BoardNoInit ERR_AD_AquireTimeOut 6.2.36 _9118_AD_DMA_Start @ Description This function will perform A/D conversion N times with DMA data transfer by using the pacer trigger (internal timer trigger). It takes place in the background which will not stop until the N-th conversion has been completed or your program execute _9118_AD_DMA_Stop() function to stop the process.
Page 84
@ Argument cardNo (Win-95): the card number of PCI-9118 to be initialized, totally 4 cards can be initialized, the valid card numbers are PCI_CARD1, PCI_CARD2, … , PCI_CARD12. clk_src : the clock source for the timer trigger of AD conversion. The valid clock sources are: A_9118_AD_IntSrc , A_9118_AD_ExtSrc count : the number of A/D conversion in samples.
as the linear address of the AI memory for user to access the data. The format of the A/D data is the same as DOS buffer ( ad_buff argument). Note: After the DMA operation stops, the data stored in ad_buffer or stored in the memory space allocated by memID are the last count transferred data, where count is the value of argument count.
Visual Basic (Windows 95) W_9118_AD_DMA_Status (ByVal cardNo As Integer, status As Long, count As Long) As Long @ Argument cardNo (Win-95): the card number of PCI-9118 to be initialized, totally 4 cards can be initialized, the valid card numbers are PCI_CARD1, PCI_CARD2, … , PCI_CARD12.
Visual Basic (Windows 95) W_9118_AD_DMA_Stop (ByVal cardNo As Integer, count As Long, start_idx As Long) As Long @ Argument cardNo (Win-95): the card number of PCI-9118 to be initialized, totally 4 cards can be initialized, the valid card numbers are PCI_CARD1, PCI_CARD2, …...
There is a group function for continuous A/D conversion using double-buffered DMA transfer as following: _9118_ContDmaStart(); _9118_CheckHalfReady(); _9118_DblBufferTransfer(); _9118_GetOverrunStatus(); _9118_ContDmaStop(); The value of converted A/D data is from 0 to 4095 (9118DG/HG) or from 0 to 65535 (9118HR). @ Syntax C/C++ (DOS) _9118_ContDmaStart(int clk_src, unsigned int count , unsigned long *doubleBuf, int c1 , int c2 )
Page 89
the data format of ad_buffer is as follows: DATA1 DATA0 DATA3 DATA2 ………… DATAN DATAN-1 Every 16-bit data: D11 D10 D9 ....D1 D0 C3 C2 C1 C0 Where D11, D10, ... , D0 : A/D converted data C3, C2, C1, C0 : converted channel no (for 9118DG/HG) D15, D14, …...
Page 90
ERR_InvalidTimerValue 6.2.40 _9118_CheckHalfReady @ Description When you use _9118_ContDmaStart() to convert A/D data then you must use _9118_CheckHalfReady() to check whether data half full or not in circular buffer, and then can use _9118_DblBufferTransfer() to copy data to transfer buffer. @ Syntax C/C++ (DOS) int _9118_CheckHalfReady(int *halfReady, int *stop_flag)
Page 91
Using this function to copy the converted A/D data from circular to transfer buffer. The value of converted A/D data is from 0 to 4095 (9118DG/HG) or from 0 to 65535 (9118HR). @ Syntax C/C++ (DOS) int _9118_DblBufferTransfer(unsigned short *userBuffer) C/C++ (Windows 95) int W_9118_DblBufferTransfer(U16 cardNo, unsigned short *userBuffer)
Page 92
C/C++ (DOS) int _9118_GetOverrunStatus(int *overrunCount) C/C++ (Windows 95) int W_9118_GetOverrunStatus(U16 cardNo, int *overrunCount) Visual Basic (Windows 95) W_9118_GetOverrunStatus (ByVal cardNo As Integer, overrunCount As Long) As Long @ Argument cardNo (Win-95): the card number of PCI-9118 to be initialized, totally 4 cards can be initialized, the valid card numbers are PCI_CARD1, PCI_CARD2, …...
card numbers are PCI_CARD1, PCI_CARD2, … , PCI_CARD12. count : the next position after the position the last A/D data is stored in the circular buffer. @ Return Code ERR_NoError ERR_BoardNoInit ERR_AD_DMANotSet 6.2.44 _9118_AD_INT_Start @ Description This function performs A/D conversion N times with interrupt data transfer by using pacer trigger.
Page 94
numbers are PCI_CARD1, PCI_CARD2, … , PCI_CARD12. count : the number of A/D conversion in samples ad_buffer (DOS): the start address of the memory buffer to store the A/D data, the buffer size must large than the number of A/D conversion. This memory should be double-word alignment, The ad_buff format is as following: (Note: the...
Note : the A/D sampling rate is equal to 4MHz / (c1 * c2) @ Return Code ERR_NoError ERR_BoardNoInit ERR_InvalidTimerValue 6.2.45 _9118_AD_INT_Status @ Description Since the _9118_AD_INT_Start() function executes in background, you can issue the function _9118_AD_INT_Status() to check the status of interrupt operation. @ Syntax C/C++ (DOS) int _9118_AD_INT_Status( int *status, int *count )
6.2.46 _9118_AD_INT_Stop @ Description This function is used to stop the interrupt data transfer function. After executing this function, the internal A/D trigger is disable and the A/D timer is stopped. The function returns the number of the data which has been transferred. @ Syntax C/C++ (DOS) int _9118_AD_INT_Stop( int *count )
can be used as frequency generator if internal clock is used. It also can be used as event counter if external clock is used. @ Syntax C/C++ (DOS) int _9118_TIMER_Start( int timer_mode, unsigned int c0 ) C/C++ (Windows 95) int W_9118_TIMER_Start(U16 cardNo, int timer_mode, U16 c0 ) Visual Basic (Windows 95) W_9118_TIMER_Start (ByVal cardNo As Integer, ByVal...
@ Syntax C/C++ (DOS) int _9118_TIMER_Read( unsigned int *counter_value ) C/C++ (Windows 95) int W_9118_TIMER_Read(U16 cardNo, unsigned int *counter_value) Visual Basic (Windows 95) W_9118_TIMER_Read (ByVal cardNo As Integer, counter_value As Long) As Long @ Argument cardNo (Win-95): the card number of PCI-9118 to be initialized, totally 4 cards can be initialized, the valid card numbers are PCI_CARD1, PCI_CARD2, …...
@ Argument cardNo (Win-95): the card number of PCI-9118 to be initialized, totally 4 cards can be initialized, the valid card numbers are PCI_CARD1, PCI_CARD2, … , PCI_CARD12. counter_value : the current counter value of the Timer #0 @ Return Code ERR_Board_NoInit ERR_NoError 6.2.50 W_9118_Set_Trig...
post_trig_cnt: The post trigger count. it will count down the Timer#0 after the trigger condition was met (About trigger) or at the moment DMA operation starts(Post-trigger). When the count reaches 0, the counter stops. The counter is used to control the post trigger sampling count of about trigger and control the sampling count of post trigger mode.
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_9118_AD_DMA_Start, W_9118_AD_INT_Start and W_9118_ContDmaStart function calls.
For the language without pointer support such as Visual Basic, programmer can use this function to access the index-th data in AI buffer. @ Syntax C/C++ (Windows 95) int W_9118_Get_Sample (U32 linearAddr, U32 index, I16 *ai_data) Visual Basic (Windows 95) W_9118_Get_Sample (ByVal linearAddr As Long, ByVal idx As Long, ai_data As Integer) As Long @ Argument...
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-9118 to an accuracy condition.
VR Assignment There are five variable resistors (VR) on the PCI-9118 board to allow you making accurate adjustment on A/D and D/A channels. The function of each VR is specified as Table 7.1. D/A channel 1 full scale adjustment D/A channel 1 offset adjustment D/A channel 2 full scale adjustment D/A channel 2 offset adjustment A/D full scale adjustment...
D/A Adjustment 7.4.1 DA Channel 1 Calibration 1. Connect VDM (+) to CN1 pin-35 (AO1) and VDM (-) to CN1 pin-34 (A.GND). 2. DA1 output 0x000. 3. Trim the variable resister VR2 to obtain -10V reading in the DVM. 4. DA1 output 0xFFF. 5.
Software Utility This software CD provides a utility program, 9118util.exe which provides three functions, System Configuration, Calibration, and Functional Testing. This utility is designed as menu-driven based windowing style. Not only the text messages are shown for operating guidance, but also has the graphic to indicate you how to set right hardware configuration.
****** Calibration of PCI9118 ****** <1> Card Type 9118DG <2> ADC Trigger Source Internal <3> Timer Clock Source Internal <4> AD Input Channel Config Single-Ended <5> AD Polarity setting Bipolar <6> AD Input Range Gain=1 Bipolar(-5V~5V) >>> <Up/Down>: Select Item, <PgUp/PgDn>: Change Setting <<<...
Page 110
calibration. The instructions will guide you to calibrate each item step by step. The bottom window shows the layout of PCI-9118. In addition, the proper Variable Resister (VR) will blink to indicate the related VR which needs to be adjusted for the current calibration step.
Page 111
If you select 3, the following figure displays on the screen: <F10> Completed AD Bipolr calibration, otherwise repeat Step 1 to 4. Software Utility • 103...
Functional Testing This function is used to test the functions of PCI-9118, it includes Digital I/O testing, D/A testing, A/D polling testing, A/D Interrupt Testing, A/D with DMA testing, A/D with DMA & Burst Mode testing, A/D with DMA & BSSH testing, and A/D with DMA & post-trigger testing.
Page 113
>>> Press <ESC> to stop <<< Figure 8.2 A/D with Polling Test window A calibration utility is supported in the software CD which is included in the product package. The detailed calibration procedures and description can be found in the utility. Users only need to run the software calibration utility and follow the procedures.
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 listed herein.
Need help?
Do you have a question about the PCI-9118 DG and is the answer not in the manual?
Questions and answers