PCIS-DASK Data Acquisition Software Development Kit For NuDAQ PCI-bus Cards, Windows NT/98/2000 User’s Guide
@Copyright 1997-2002 ADLink Technology Inc. All Rights Reserved. Manual Rev. 3.25: Sep. 07, 2002 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.
CONTENTS INTRODUCTION TO PCIS-DASK..........................................................................1 1.1 ABOUT THE PCIS-DASK SOFTWARE ...............................................................1 1.2 PCIS-DASK HARDWARE SUPPORT ..................................................................2 1.3 PCIS-DASK LANGUAGE SUPPORT ..................................................................3 THE FUNDAMENTALS OF BUILDING WINDOWSNT/98/2000 APPLICATIONS WITH PCIS-DASK................................
.3.4 Asynchronous Analog Input Monitoring Functions..........................22 4.4 ANALOG OUTPUT FUNCTION GROUP ..............................................................22 4.4.1 Analog output Configuration Functions..............................................23 4.4.2 One-Shot Analog Output Functions.....................................................24 4.5 DIGITAL INPUT FUNCTION GROUP ..................................................................24 4.5.
.1.3 Non-Trigger Non-double-buffered Asynchronous Continuous Analog input programming Scheme ..................................................................36 5.1.4 Non-Trigger Double-buffered Asynchronous Continuous Analog input programming Scheme ................................................................................37 5.1.5 Trigger Mode Non-double-buffered Asynchronous Continuous Analog input programming Scheme ..................................................................39 5.1.
CONTINUOUS DATA TRANSFER IN PCIS-DASK........................................64 6.1 CONTINUOUS DATA TRANSFER MECHANISM ................................................64 6.2 DOUBLE-BUFFERED AI/DI OPERATION .........................................................65 6.2.1 Double Buffer Mode Principle..............................................................65 6.2.2 Single-Buffered Versus Double-Buffered Data Transfer..................66 6.3 TRIGGER M ODE DATA ACQUISITION FOR ANALOG INPUT ............
How to Use This Manual This manual is to help you use the PCIS-DASK software driver for NuDAQ PCI-bus data acquisition cards. The manual describes how to install and use the software library to meet your requirements and help you program your own software applications. It is organized as follows: l Chapter 1, "Introduction to PCIS-DASK" describes the hardware and language support of PCIS-DASK.
1 Introduction to PCIS-DASK 1.1 About the PCIS-DASK Software PCIS-DASK is a software development kit for NuDAQ PCI-bus data acquisition cards. It contains a high performance data acquisition driver for developing custom applications under Windows NT, Windows 98 and Windows 2000 environments. The memory and data buffer management capabilities free developers from dealing with there complex issues.
1.2 PCIS-DASK Hardware Support ADLink will periodically upgrade PCIS-DASK for new NuDAQ PCI-bus data acquisition cards and NuIPC CompactPCI cards. Please refer to Release Notes for the cards that the current PCIS-DASK actually supports.
l cPCI-7433R : Isolation 64 Digital Inputs Module with Rear I/O l cPCI-7434R : Isolation 64 Digital Outputs Module with Rear I/O l PCI-8554 : 16-CH Timer/Counter & DIO card l PCI-9111 : advanced multi-function card l PCI-9112/cPCI-9112: advanced multi-function card with bus mastering DMA transfer capability l PCI-9113 : 32 isolated channels A/D card l PCI-9114 : 32-channel high gain multi-function card l cPCI-9116: 64-channel advanced multi-function card with bus mastering DMA transfer capability l PCI-9118
2 The Fundamentals of Building WindowsNT/98/2000 Applications with PCIS-DASK 2.1 Creating a Windows NT/98/2000 PCIS-DASK Applications Using Microsoft Visual C/C++ To create a data acquisition application using PCIS-DASK and Microsoft Visual C/C++, follow these steps after entering Visual C/C++: step 1. Open the project in which you want to use PCIS-DASK. This can be a new or existing project step 2. Include header file DASK.H in the C/C++ source files that call PCIS-DASK functions. DASK.
2.2 Creating a Windows NT/98/2000 PCIS-DASK Applications Using Microsoft Visual Basic To create a data acquisition application using PCIS-DASK and Visual Basic, follow these steps after entering Visual Basic: step 1. Open the project in which you want to use PCIS-DASK. This can be a new or existing project Open a new project by selecting the New Project command from the File menu. If it is an existing project, open it by selecting the Open Project command from the File menu.
Select DASK.BAS from the Files list by double clicking on it. If you can't find this file in the list, make sure the list is displaying files from the correct directory. By default, DASK.BAS is installed in C:\ADLink\PCI-DASK\INCLUDE. step 3. Design the interface for the application. To design the interface, you place the desired elements, such as command button, list box, text box, etc., on the Visual Basic form. These are standard controls from the Visual Basic Toolbox.
step 6. Run your application. To run the application, choose Start from the Run menu, or click the Start icon on the toolbar (you can also press F5). step 7. Distribute your application. Once you have finished a project, you can save the application as an executable (.EXE) file by using the Make EXE File command on the File menu. And once you have saved your application as an executable file, you've ready to distribute it.
3 PCIS-DASK Utilities This chapter introduces the tools that accompanied with the PCIS-DASK package. 3.1 NuDAQ Registry/Configuration utility (PciUtil) PciUtil is used for the users to register PCIS-DASK drivers (Windows NT4 only), remove installed drivers (Windows NT4 only), and set/modify the allocated buffer sizes of AI, AO, DI and DO. The default location of this utility is \Util directory. [PciUtil in Windows NT] The PciUtil main window is shown as the following window.
To register one of PCIS-DASK drivers, click “New …” button and a Driver Configuration window appears. In this window, users can select the driver you want to register and input the parameters in the box corresponding to AI, AO, DI, or DO for the requirement of your applications. The “Buffer Allocated” of AI, AO, DI, DO represent the sizes of contiguous Initially Allocated memory for continuous analog input, analog output, digital input, digital output respectively. Its unit is KB, i.e. 1024 bytes.
DMA or Interrupt transfer can be performed. It will induce an unexpected result in that DMA or Interrupt transfer performed exceeds the initially allocated size. After the device configurations of the driver you select is finished, click “OK” to register the driver and return to the PciUtil main window.
Using PciUtil to change the buffer allocated settings of one of the PCISDASK drivers, select the driver from the Registered Driver list and click “Modify …” button and then a “Driver Configuration” window is shown as below. Inside the allocated buffer size fields of AI, AO, DI and DO are the originally set values. Type the value in the box corresponding to AI, AO, DI, or DO according to the requirement of your applications, and then click “OK” button.
[PciUtil in Windows 98] This utility is used to set/modify the allocated buffer sizes of AI, AO, DI and DO. The allocated buffer sizes of AI, AO, DI, DO represent the sizes of contiguous Initially Allocated memory for continuous analog input, analog output, digital input, digital output respectively. Its unit is page KB, i.e. 1024 bytes. Device driver will try to allocate these sizes of memory at system startup time.
[PciUtil in Windows 2000] This utility is used to set/modify the allocated buffer sizes of AI, AO, DI and DO. The allocated buffer sizes of AI, AO, DI, DO represent the sizes of contiguous Initially Allocated memory for continuous analog input, analog output, digital input, digital output respectively. Its unit is page KB, i.e. 1024 bytes. Device driver will try to allocate these sizes of memory at system startup time.
3.2 PCIS-DASK Data File Converter utility (DAQCvt) The data files, generated by the PCIS-DASK functions performing continuous data acquisition followed by storing the data to disk, is written in binary format. Since a binary file can’t be read by the normal text editor and can’t be used to analyze the accessed data by Excel, PCIS-DASK provides a convenient tool DAQCvt to convert the binary file to the file format read easily. The default location of this utility is \Util directory.
The default destination file with a .cvt extension is located in the same directory as the source one. To change the default setting, type the file path you wish or click the Browser button from Output File frame to select the destination file location. DAQCvt provides three types of data format conversion.
and Tab . If you want to add title/head which includes the card type information at the beginning of file, check the “Title/Head” box. After setting the properties (File Path, Format, …etc) related to the converted file, you can push Start Convert button from the Output File frame to perform the file conversion. 3.3 PCIS-DASK Sample Programs Browser (Examples.exe) PCIS-DASK provides a sample program browser, Examples.exe, for you to view and execute the sample programs that PCIS-DASK package includes.
4 PCIS-DASK Overview This chapter describes the classes of functions in PCIS-DASK and briefly describes each function.
- Dual-Interrupt System Setting function 4.1 General Configuration Function Group Use these functions to initializes and configures data acquisition card. 4.2 Register_Card Initializes the hardware and software states of an NuDAQ PCI-bus data acquisition card. Register_Card must be called before any other DASK library functions can be called for that card. Release_Card Tells DASK library that this registered card is not used currently and can be released.
to perform continuous analog input operation of PCI9112. AI_9113_Config Informs PCIS-DASK library of the trigger source selected for the analog input operation of PCI9113. You must call this function before calling function to perform continuous analog input operation of PCI9113. AI_9114_Config Informs PCIS-DASK library of the trigger source selected for the analog input operation of PCI9114. You must call this function before calling function to perform continuous analog input operation of PCI9114.
calling function to perform continuous analog input operation of PCI9812. AI_9116_CounterInterval Informs PCIS-DASK library of the scan interval value and sample interval value selected for the analog input operation of PCI9116. You must call this function before calling function to perform continuous analog input operation of PCI9116. AI_InitialMemoryAllocated Gets the actual size of analog input memory that is available in the device driver. 4.3.2 One-Shot Analog Input Functions AI_ReadChannel 4.3.
AI_ContScanChannels Performs continuous A/D conversions on the specified continuous analog input channels at a rate as close to the rate you specified. This function is only available for those cards that support autoscan functionality. AI_ContReadMultiChannels Performs continuous A/D conversions on the specified analog input channels at a rate as close to the rate you specified. This function is only available for those cards that support auto-scan functionality.
This function is only available for those cards that support auto-scan functionality. 4.3.4 AI_ContVScale Converts the values of an array of acquired data from an continuous A/D conversion call to the actual input voltages. AI_ContStatus Checks the current status of the continuous analog input operation. Asynchronous Analog Input Monitoring Functions AI_AsyncCheck Checks the current status of the asynchronous analog input operation. AI_AsyncClear Stops the asynchronous analog input operation.
4.4.1 Analog output Configuration Functions AO_6208A_Config Informs PCIS-DASK library of the current range selected for the analog output operation of PCI6208A. You must call this function before calling function to perform current output operation. AO_6308A_Config Informs PCIS-DASK library of the current range selected for the analog output operation of PCI6308A. You must call this function before calling function to perform current output operation.
4.4.2 One-Shot Analog Output Functions AO_WriteChannel Writes a binary value to the specified analog output channel. AO_VWriteChannel Accepts a voltage value, scales it to the proper binary value and writes a binary value to the specified analog output channel. AO_VoltScale Scales a voltage to a binary value. AO_SimuWriteChannel Writes binary values to the specified analog output channels simultaneously.
Rev.B. You must call this function before calling function to perform continuous digital input operation of PCI7300A Rev.A or PCI7300A Rev.B. DI_InitialMemoryAllocated Gets the actual size of digital input DMA memory that is available in the device driver. 4.5.2 4.5.3 One-Shot Digital Input Functions DI_ReadLine Reads the digital logic state of the specified digital line in the specified port. DI_ReadPort Reads digital data from the specified digital input port.
DI_ContMultiBufferStart 4.5.4 Starts the multi-buffered continuous digital input on the specified digital input port at a rate as close to the rate you specified. Asynchronous Digital Input Monitoring Functions DI_AsyncCheck Checks the current status of the asynchronous digital input operation. DI_AsyncClear Stops the asynchronous digital input operation. DI_AsyncDblBufferMode Enables or Disables double buffer data acquisition mode.
4.6.1 Digital Output Configuration Functions DO_7200_Config Informs PCIS-DASK library of the trigger source and trigger properties selected for the digital input operation of PCI7200. You must call this function before calling function to perform continuous digital output operation of PCI7200. DO_7300A_Config/ DO_7300B_Config Informs PCIS-DASK library of the trigger source and trigger properties selected for the digital input operation of PCI7300A Rev.A or PCI7300A Rev.B.
DO_ReadLine Reads the specified digital output line in the specified digital output port. DO_ReadPort Reads digital data from the specified digital output port. DO_Write ExtTrigLine Sets the digital output trigger line to the specified state. This function is only available for PCI-7200. 4.6.3 Continuous Digital Output Functions DO_ContWritePort Performs continuous digital output on the specified digital output port at a rate as close to the rate you specified.
DO_AsyncClear Stops the asynchronous digital output operation. DO_AsyncMultiBufferNextReady Checks whether the next buffer is ready for new data during an asynchronous multi-buffered digital output operation. 4.7 4.7.1 Timer/Counter Function Group Timer/Counter Functions CTR_Setup Configures the selected counter to operate in the specified mode. CTR_Read Reads the current contents of the selected counter. CTR_Clear Sets the output of the selected counter to the specified state.
GCTR_Clear 4.8 4.8.1 DIO Function Group Digital Input/Output Configuration Functions DIO_PortConfig 4.8.2 Clears the general-purpose timer/counter control register and counter register. This function is only used by the Digital I/O cards whose I/O port can be set as input port or output port. This function informs PCIS-DASK library of the port direction selected for the digital input/output operation. You must call this function before calling functions to perform digital input/output operation.
and notifies the user’s application when an interrupt event occurs. The notification is performed through a user-specified callback function or the Windows PostMessage API. 4.8.3 Local Interrupt Setting Functions DIO_7300SetInterrupt Controls the interrupt sources (AUXDI and Timer2) of local Interrupt system of PCI7300A/cPCI7300A. DIO_AUXDI_EventMessage Controls AUXDI Interrupt and notifies the user’s application when an interrupt event occurs.
5 PCIS-DASK Application Hints This chapter provides the programming schemes showing the function flow of that PCIS-DASK performs analog I/O and digital I/O. The figure below shows the basic building blocks of a PCIS-DASK application. However, except using Register_Card at the beginning and Release_Card at the end, depending on the specific devices and applications you have, the PCIS-DASK functions comprising each building block vary.
5.1 Analog Input Programming Hints PCIS-DASK provides two kinds of analog input operation nonbuffered single-point analog input readings and buffered continuous analog input operation. The non-buffered single-point AI uses software polling method to read data from the device. The programming scheme for this kind of AI operation is described in section 5.1.1. The buffered continuous analog input uses interrupt transfer or DMA transfer method to transfer data from device to user’s buffer.
5.1.1 One-Shot Analog input programming Scheme This section described the function flow typical of non-buffered single-point analog input readings. While performing one-shot AI operation, most of the cards (except PCI-9118 series cards) don’t need to include AI configuration step at the beginning of your application.
5.1.2 Synchronous Continuous Analog input programming Scheme This section described the function flow typical of synchronous analog input operation. While performing continuous AI operation, the AI configuration function has to be called at the beginning of your application. In addition, for synchronous AI, the SyncMode argument in continuous AI functions has to be set as SYNCH_OP. AI_xxxx_Config (xxxx means the card type, e.g.
5.1.3 Non-Trigger Non-double-buffered Asynchronous Continuous Analog input programming Scheme This section described the function flow typical of non-trigger, non-doublebuffered asynchronous analog input operation. While performing continuous AI operation, the AI configuration function has to be called at the beginning of your application. In addition, for asynchronous AI, the SyncMode argument in continuous AI functions has to be set as ASYNCH_OP. AI_xxxx_Config (xxxx means the card type, e.g.
[Example Code Fragment] card = Register_Card(PCI_9112, card_number); … AI_9112_Config(card,TRIG_INT_PACER); AI_AsyncDblBufferMode (card, 0); //non-double-buffered AI AI_ContScanChannels (card, channel, range, ai_buf, data_size, (F64)sample_rate, ASYNCH_OP); or AI_ContReadChannel(card, channel, range, ai_buf, data_size, (F64)sample_rate, ASYNCH_OP) do { AI_AsyncCheck(card, &bStopped, &count); } while (!bStopped); AI_AsyncClear(card, &count); … Release_Card(card); 5.1.
AI_xxxx_Config (xxxx means the card type, e.g.
[Example Code Fragment] card = Register_Card(PCI_9112, card_number); … AI_9112_Config(card,TRIG_INT_PACER); AI_AsyncDblBufferMode (card, 1); // Double-buffered AI AI_ContScanChannels (card, channel, range, ai_buf, data_size, (F64)sample_rate, ASYNCH_OP); or AI_ContReadChannel(card, channel, range, ai_buf, data_size, (F64)sample_rate, ASYNCH_OP) do { do { AI_AsyncDblBufferHalfReady(card, &HalfReady, &fstop); } while (!HalfReady); AI_AsyncDblBufferTransfer(card, ai_buf); … } while (!clear_op); AI_AsyncClear(c
AI_xxxx_Config / With Trigger mode enebled (xxxx means the card type, e.g.
AI_ContReadChannel(card, channel, range, (F64)sample_rate, ASYNCH_OP) do { AI_AsyncCheck(card, &bStopped, &count); } while (!bStopped); ai_buf, data_size, AI_AsyncClear(card, &count); … Release_Card(card); 5.1.6 Trigger Mode Double-buffered Asynchronous Continuous Analog input programming Scheme This section described the function flow typical of trigger mode double-buffered asynchronous analog input operation. A trigger is an event that occurs based on a specified set of conditions.
AI_xxxx_Config / With Trigger mode enebled (xxxx means the card type, e.g.
[Example Code Fragment] card = Register_Card(PCI_9118, card_number); … AI_9118_Config(card,P9118_AI_BiPolar|P9118_AI_SingEnded, P9118_AI_DtrgPositive|P9118_AI_EtrgPositive| P9118_AI_AboutTrgEn,0,postCount) AI_AsyncDblBufferMode (card, 1); Double-buffered AI AI_ContScanChannels (card, channel, range, ai_buf, data_size, (F64)sample_rate, ASYNCH_OP); or AI_ContReadChannel(card, channel, range, ai_buf, data_size, (F64)sample_rate, ASYNCH_OP) do { do { AI_AsyncDblBufferHalfReady(card, &HalfReady, &fstop); } whil
5.2 Analog Output Programming Hints This section described the function flow typical of single-point analog output conversion. While performing the following operation, the AO configuration function has to be called at the beginning of your application: a. Use PCI-6208A, PCI-6308A to perform current output b. Use the analog output function that can convert a voltage value to a binary value and then write it to device, the AO configuration function has to be called at the beginning of your application.
5.3 Digital Input Programming Hints PCIS-DASK provides two kinds of digital input operation non-buffered single-point digital input operation and buffered continuous digital input operation. The non-buffered single-point DI uses software polling method to read data from the device. The programming scheme for this kind of DI operation is described in section 5.3.1. The buffered continuous DI uses DMA transfer method to transfer data from device to user’s buffer.
5.3.1 One-Shot Digital input programming Scheme This section described the function flow typical of non-buffered single-point digital input readings. While performing one-shot DI operation, the devices whose I/O port can be set as input or out put port (PCI-7248 and PCI7296) need to include port configuration function at the beginning of your application.
5.3.2 Synchronous Continuous Digital input programming Scheme This section described the function flow typical of synchronous digital input operation. While performing continuous DI operation, the DI configuration function has to be called at the beginning of your application. In addition, for synchronous DI, the SyncMode argument in continuous DI functions has to be set as SYNCH_OP. DI_xxxx_Config (xxxx means the card type, e.g.
5.3.3 Non-double-buffered Asynchronous Continuous Digital input programming Scheme This section described the function flow typical of non-double-buffered asynchronous digital input operation. While performing continuous DI operation, the DI configuration function has to be called at the beginning of your application. In addition, for asynchronous DI operation, the SyncMode argument in continuous DI functions has to be set as ASYNCH_OP. DI_xxxx_Config (xxxx means the card type, e.g.
do { DI_AsyncCheck(card, &bStopped, &count); } while (!bStopped); DI_AsyncClear(card, &count); … Release_Card(card); 5.3.4 Double-buffered Asynchronous Continuous Digital input programming Scheme This section described the function flow typical of double-buffered asynchronous digital input operation. While performing continuous DI operation, the DI configuration function has to be called at the beginning of your application.
DI_xxxx_Config (xxxx means the card type, e.g.
DI_TRIG_FALLING, IREQ_FALLING); DI_AsyncDblBufferMode (card, 1); // Double-buffered mode DI_ContReadPort(card, 0, pMem, data_size, (F64)sample_rate, ASYNCH_OP) do { do { DI_AsyncDblBufferHalfReady(card, &HalfReady); } while (!HalfReady); DI_AsyncDblBufferTransfer(card, pMem); } while (!clear_op); DI_AsyncClear(card, &count); … Release_Card(card); 5.3.
DI_xxxx_Config (xxxx means the card type, e.g.
//setting the DMA buffers repeatedly DI_ContMultiBufferSetup (card, in_buf, data_size, &BufferId); DI_ContMultiBufferSetup (card, in_buf, data_size, &BufferId); … // start multi-buffered DI DI_ContMultiBufferStart (card, 0, 1); do { do { DI_AsyncDblBufferHalfReady(card, &HalfReady); } while (!HalfReady); //Handling the ready data } while (!clear_op); DI_AsyncClear(card, &count); … Release_Card(card); 5.
predetermined rate. The programming scheme for this kind of DO operation is described in section 5.4.4.
5.4.1 One-Shot Digital output programming Scheme This section described the function flow typical of non-buffered single-point digital output operation. While performing one-shot DO operation, the cards whose I/O port can be set as input or out put port (PCI-7248, PCI7249 and PCI-7296) need to include port configuration function at the beginning of your application.
5.4.2 Synchronous Continuous Digital output programming Scheme This section described the function flow typical of synchronous digital output operation. While performing continuous DO operation, the DO configuration function has to be called at the beginning of your application. In addition, for synchronous DO operation, the SyncMode argument in continuous DO functions for synchronous mode has to be set as SYNCH_OP. DO_xxxx_Config (xxxx means the card type, e.g.
5.4.3 Asynchronous Continuous Digital output programming Scheme This section described the function flow typical of asynchronous digital output operation. While performing continuous DO operation, the DO configuration function has to be called at the beginning of your application. In addition, for asynchronous DO operation, the SyncMode argument in continuous DO functions for asynchronous mode has to be set as ASYNCH_OP. DO_xxxx_Config (xxxx means the card type, e.g.
DO_AsyncCheck(card, &bStopped, &count); } while (!bStopped); DO_AsyncClear(card, &count); … Release_Card(card); 5.4.4 Pattern Generation Digital output programming Scheme This section described the function flow typical of pattern generation for digital output. While performing pattern generation of DO, the DO configuration function has to be called at the beginning of your application. DO_xxxx_Config (xxxx means the card type, e.g.
5.4.5 Multiple-buffered Asynchronous Continuous Digital output programming Scheme This section described the function flow typical of multi-buffered asynchronous digital output operation. While performing continuous DO operation, the DO configuration function has to be called at the beginning of your application. For asynchronous DO, the SyncMode argument in continuous DO functions has to be set as ASYNCH_OP.
DI_xxxx_Config (xxxx means the card type, e.g.
//setting the DMA buffers repeatedly DO_ContMultiBufferSetup (card, out_buf, data_size, &BufferId); DO_ContMultiBufferSetup (card, out_buf, data_size, &BufferId); … // start multi-buffered DO DO_ContMultiBufferStart (card, 0, 1); do { do { DO_AsyncDblBufferHalfReady(card, &HalfReady); } while (!HalfReady); // Copy prepared data to the ready buffer } while (!clear_op); DO_AsyncClear(card, &count); … Release_Card(card); PCIS-DASK Application Hints • 61
5.5 Interrupt Event Message Programming Hints PCIS-DASK provides two methods to perform interrupt occurrence notification for NuDAQ DIO cards that have dual interrupt system. The Event Message method handles event notification through user-defined callbacks and/or the Windows Message queue (for VB5, through user-defined callbacks only).
case WM_INT: //interrupt event occurring message …. break; …. case WM_DESTROY: //Disable interrupts DIO_INT1_EventMessage (card, INT1_DISABLE, hMainWnd, NULL, NULL); DIO_INT2_EventMessage (card, INT2_DISABLE, hMainWnd, NULL, NULL); //Release card if (card >= 0) Release_Card(card); PostQuitMessage(0); break; …. } } …. //call back function LRESULT CALLBACK cbfn() { …. } 2.
6 Continuous Data Transfer in PCIS-DASK The continuous data transfer functions in PCIS-DASK input or output blocks of data to or from a plug-in NuDAQ PCI device. For input operations, PCIS-DASK must transfer the incoming data to a buffer in the computer memory. For output operations, PCIS-DASK must transfer outgoing data from a buffer in the computer memory to the NuDAQ PCI device.
6.2 Double-Buffered AI/DI Operation PCIS-DASK uses double-buffering techniques in its driver software for continuous input of large amounts of data. 6.2.1 Double Buffer Mode Principle The data buffer for double-buffered continuous input operation is a circular buffer logically. It is logically divided into two equal halves. The double-buffered input begins when device starts writing data into the first half of the circular buffer (Figure 6-1a).
The PCIS-DASK double buffer mode functions were designed according to the principle described above. If you use AI_AsyncDblBufferMode/DI_AsyncDblBufferMode to enable double buffer mode, the following continuous AI/DI function will perform doublebuffered continuous AI/DI. You can call AI_AsyncDblBufferHalfReady/DI_AsyncDblBufferHalfReady to check if data in the circular buffer is half full and ready for copying to the transfer buffer.
6.3 Trigger Mode Data Acquisition for Analog Input A trigger is an event that occurs based on a specified set of conditions. An interrupt mode or DMA-mode analog input operation can use a trigger to determinate when acquisition stops or starts. PCIS-DASK also provides two buffering methods for trigger mode AI – doublebuffering and single-buffering. However, the single buffer in trigger mode AI is different from that in non-trigger mode AI.
7 Sample Programs There are several sample programs provided in this software diskette. They could help you to program your own applications by using PCIS-DASK easily.
PCI-7200 C7200File 1. Digital input of PCI-7200/cPCI-7200 through DMA transfer 2. Storing the data to disk Visual C/C++ console Program C7200DbfFile 1. Double buffer mode digital input of PCI7200/cPCI-7200 through DMA transfer 2. 2.
SDK7230DbEvtMsg D/I, and D/O of PCI-7230/cPCI-7230 by Interrupt Event Message method (Dual Interrupt Events) Visual C/C++ Program VB7230 D/I, and D/O of PCI-7230/cPCI-7230 Visual Basic Program PCI-7233 SDK7233 D/I of PCI-7233 Visual C/C++ Program SDK7233Int D/I of PCI-7233 by Interrupt Event Status checking and waiting method Visual C/C++ Program SDK7233DbEvt D/I of PCI-7233 by Interrupt Event Status checking and waiting method (Dual Interrupt Events) Visual C/C++ Program VB7233 D/I of PCI-7233
SDK7248DbEvtMsg D/I, and D/O of PCI-7248/cPCI-7248 by Interrupt Event Message method (Dual Interrupt Events) Visual C/C++ Program VB7248 D/I, and D/O of PCI-7248/cPCI-7248 Visual Basic Program PCI-7249 SDK7249 D/I, and D/O of cPCI-7249 Visual C/C++ Program SDK7249Int D/I, and D/O of cPCI-7249 by Interrupt Event Status checking and waiting method Visual C/C++ Program SDK7249DbEvt D/I, and D/O of cPCI-7249 by Interrupt Event Status checking and waiting method (Dual Interrupt Events) Visual C/C++ Pro
VB7256 D/I, and D/O of PCI-7256 Visual Basic Program PCI-7296 SDK7296 D/I, and D/O of PCI-7296 Visual C/C++ sample program SDK7296Int D/I, and D/O of PCI-7296 by Interrupt Event Status checking and waiting method Visual C/C++ Program SDK7296DbEvt D/I, and D/O of PCI-7296 by Interrupt Event Status checking and waiting method (Dual Interrupt Events) Visual C/C++ Program SDK7248IntMsg D/I, and D/O of PCI-7296 by Interrupt Event Message method Visual C/C++ Program SDK7248DbEvtMsg D/I, and D/O of PCI
C7300File 1. Digital input of PCI-7300A_Rev.A/cPCI7300A_Rev.A through DMA transfer 2. Storing the data to disk Visual C/C++ console program PCI-7300 Rev.B SDK7300Wave Digital input of PCI-7300A_Rev.B/cPCI7300A_Rev.B through DMA transfer Visual C/C++ Program S7300PGwav Pattern generation of PCI-7300A_Rev.B/cPCI7300A_Rev.B Visual C/C++ program SDK7300aMBufWav Multiple buffer mode digital input of PCI7300A_Rev.B/cPCI-7300A_Rev.
SDK7348DbEvt D/I, and D/O of PCI-7348 by Interrupt Event Status checking and waiting method (Dual Interrupt Events) Visual C/C++ Program SDK7348COSi COS of Interrup operation of D/I, and D/O of PCI-7348 by Interrupt Event Status checking and waiting method Visual C/C++ Program SDK7348IntMsg D/I, and D/O of PCI-7348 by Interrupt Event Message method Visual C/C++ Program SDK7348DbEvtMsg D/I, and D/O of PCI- PCI-7348 by Interrupt Event Message method (Dual Interrupt Events) Visual C/C++ Program VB7348
PCI-7432 SDK7432 D/I, and D/O of PCI-7432/cPCI-7432 Visual C/C++ sample program SDK7432Int D/I, and D/O of PCI-7432/cPCI-7432 by Interrupt Event Status checking and waiting method Visual C/C++ Program SDK7432DbEvt D/I, and D/O of PCI-7432/cPCI-7432 by Interrupt Event Status checking and waiting method (Dual Interrupt Events) Visual C/C++ Program SDK7432IntMsg D/I, and D/O of PCI-7432/cPCI-7432 by Interrupt Event Message method Visual C/C++ Program SDK7432DbEvtMsg D/I, and D/O of PCI-7432/cPCI-7432
PCI-7434 SDK7434 D/O of PCI-7434/cPCI-7434 Visual C/C++ sample program SDK7434R D/O of cPCI-7434R Visual C/C++ sample program VB7434 D/O of PCI-7434/cPCI-7434 Visual Basic Program PCI-8554 SDK8554 Timer/counter of PCI-8554 Visual C/C++ sample program SDKEventCnt Event counter of PCI-8554 Visual C/C++ sample program VB8554 Timer/counter of PCI-8554 Visual Basic Program PCI-9111 SDK9111 A/D conversion, D/A conversion, D/I, and D/O of PCI9111 Visual C/C++ Program SDK9111Int Analog input of PC
VB9111Int Analog input of PCI-9111 through Interrupt operation Visual Basic Program VB9111PreTrg Pre-trigger with Double buffer mode analog input of PCI-9111 through Interrupt operation Visual Basic Program VB9111Scan Autoscan Analog input of PCI-9111 Visual Basic Program PCI-9112 SDK9112 A/D conversion, D/A conversion, D/I, and D/O of PCI9112/cPCI-9112 Visual C/C++ program SDK9112DMA Analog input of PCI-9112/cPCI-9112 through DMA data transfer Visual C/C++ Program SDK9112DbfDma Double buffer mo
SDK9113DbfInt Double buffer mode analog input of PCI-9113 through Interrupt operation Visual C/C++ sample program C9113File 5. Analog input of PCI-9113 through Interrupt operation 6. Storing the data to disk Visual C/C++ console Program C9113DbfFile 5. Double buffer mode analog input of PCI9113 through Interrupt operation 6.
VB9114 A/D conversion, D/A conversion, D/I, and D/O of PCI9114 Visual Basic Program VB9114Int Analog input of PCI-9114 through Interrupt operation Visual Basic Program VB9114Scan Autoscan Analog input of PCI-9114 Visual Basic Program cPCI-9116 SDK9116 A/D conversion of CPCI-9116 Visual C/C++ Program SDK9116ScanDma Software trigger with Single buffer mode analog input of CPCI-9116 through DMA data transfer Visual C/C++ Program SDK9116PostTrg Post trigger with Single buffer mode analog input of CP
C9116File 9. Analog input of cPCI-9116 through DMA data transfer 10. Storing the data to disk Visual C/C++ console Program C9116DbfFile 9. Double buffer mode analog input of cPCI9116 through DMA data transfer 10.
SDK9118AboutTrg About trigger with Single buffer mode analog input of PCI-9118 through DMA data transfer Visual C/C++ Program SDK9118HRAboutTrg About trigger with Single buffer mode analog input of PCI-9118HR through DMA data transfer Visual C/C++ Program SDK9118PostTrg Post trigger with Single buffer mode analog input of PCI-9118 through DMA data transfer Visual C/C++ Program C9118File 11. Analog input of PCI-9118 through DMA data transfer 12.
PCI-9812 SDK9812SoftTrg Software trigger with Single buffer mode analog input of PCI-9812/cPCI-9812 through DMA data transfer Visual C/C++ Program SDK9812PreTrg Pre-trigger with Single buffer mode analog input of PCI-9812/cPCI-9812 through DMA data transfer Visual C/C++ Program SDK9812PostTrg Post trigger with Single buffer mode analog input of PCI-9812/cPCI-9812 through DMA data transfer Visual C/C++ Program SDK9812MidTrg Middle trigger with Single buffer mode analog input of PCI-9812/cPCI-9812 thr
C9812DbfFile 13. Double buffer mode analog input of PCI9812/10 through DMA data transfer 14. Storing the data to disk Visual C/C++ console Program VB9812 Analog input of PCI-9812/cPCI-9812 through DMA data transfer Visual Basic 4.0 Program 9812 VB5 Analog input of PCI-9812/cPCI-9812 through DMA data transfer Visual Basic 5.
7.1 7.1.1 Sample Programs Development Environment Visual Basic Sample Programs There are several Visual Basic sample programs provided for each card in this software package. The following files are included in each sample program (Using VB9112DMA as an example): l VB project file --- VB9112D.VBP l VB form files --- VB9112D.FRM l Executable file --- VB9112D.EXE You must have 32-bit Microsoft Visual Basic 4.0 Professional Edition or above to deal with these sample programs.
You can use any editor or Microsoft Visual C++ 4.0 to view or modify these source files. However, to build the executable 7200WAV.EXE, you must have Microsoft Visual C++ 4.0 or above. Please refer to Visual C++ Manual or related reference books to get the information about how to use Visual C++. 7.2 Execute Sample Programs To run the sample programs, please follow these steps: step 1. Open the sample program You can use Microsoft Visual C++ 4.0 or Visual Basic 4.0 to open and execute the sample programs.
Figure 7.2 Analog Input (A/D) : This is used to show the results of A/D conversion. You can select the Input channels (allows multiple channels) and the input range (gain) you want to test from the main screen. Analog output (D/A): This is used to show the results of D/A conversion. Turning the turner to set the output voltage. You can also choose the output waveform (sine or square). D/I and D/O: This is used to show the results of Read/Write data from/to digital input/output channels.
7.3.2 Data I/O through DMA Data Transfer or Interrupt operation This kind of programs is used to demonstrate how to use PCIS-DASK to operate data I/O through DMA data transfer or Interrupt operation. The main screen of this kind of programs is shown below (Figure 7.3): Figure 7.
In this kind of programs you can select Input channels, Input range (PCI-7200 does not have these two options), sampling rate, and data size (transfer count) as you wish. To view the input data, push “Data Value” button in the main screen as data transfer is finished (Figure 7.4). Figure 7.
7.3.3 Double buffer mode data I/O through DMA transfer or Interrupt operation This kind of programs is used to demonstrate how to use PCIS-DASK to operate double-buffered data I/O through DMA transfer or Interrupt operation. The screen of this kind of programs is shown below (Figure 7.5) : Figure 7.5 In this kind of programs you can select Input channel, input range (PCI-7200 does not have this two options), sampling rate, and data size (transfer count) as you wish.
7.3.4 Trigger Mode Data I/O through DMA Data Transfer or Interrupt operation This kind of programs is used to demonstrate how to use PCIS-DASK to operate Trigger Mode data I/O through DMA data transfer or Interrupt operation. Except an additional input item, postCount, the running steps and the main screen of this kind of programs (Figure 7.6) are almost the same as those mentioned in section 7.3.2 (For Single-Buffer Mode) or section 7.3.3 (For Double-Buffer Mode).
8 Distribution of Applications 8.1 Files To install an application using PCIS-DASK on another computer, you also must install the necessary driver files and supporting libraries on the target machine. You can create an automatic installer to install your program and all of the files needed to run that program or you can manually install the program and program files. Whichever installation method you choose, you must install the following files: l Required support DLLs: – Pci-dask.
– Device configuration utility in \Software\Pcisdask\W98NT2K/redist\Wnt\Util. Windows 2000 – The corresponding driver file in \Software\Pcis-dask\W98NT2K \redist\W2000\drivers, e.g. pci7200.sys for PCI-7200. These files should be copied to Winnt\system32\drivers directory. – The corresponding INF file in \Software\Pcis-dask\W98NT2K \redist\W2000\Inf, e.g. p7200.inf for PCI-7200. These files should be copied to Winnt\inf directory.
The installation program not only copies all the required files into the appropriated location, but executes Device configuration utility to configure the devices.
8.3 Manual Installation If your programming environment does not include a setup or distribution kit tool, you can perform the installation task manually. To install your program on another computer, follow these steps: 1. Copy the program executable to the target computer. 2. Copy all required PCIS-DASK files described in the section 8.1.1 to the appropriate directory on the target computer. 3. Use NuDAQ Device Configuration utility to configure the device.