User`s guide
Creating PCIS-DASK Application ? 11
3
Creating PCIS-DASK Application
3.1 Contiguous Memory Allocation in Driver for Continuous Operation
The continuous data transfer functions in PCIS-DASK input or output blocks of data to or from a plug-
in NuDAQ PCI device. To avoid the data transfer performance reduction caused by memory fragment,
PCIS-DASK allocates physically contiguous buffers in device driver at system startup time (windows
98) or when system boots (Windows NT/2000/XP).
PCIS-DASK provides a utility, PciUtil to set/modify the sizes of contiguous memory allocated in driver
for continuous analog input, analog output, digital input, digital output. Device driver will try to allocate
these sizes of memory. The size of initially allocated memory is the maximum memory size that
continuous data transfer can be performed. Please refer to the section, NuDAQ Registry/Configuration
utility, for the description of this utility.
PCIS-DASK inputs or outputs blocks of data stored in the driver buffer to or from a NuDAQ PCI device.
For input operations, the specifed count of data are transfered to the driver buffer and PCIS-DASK
copies the data from the driver buffer (kernel level) to a user buffer (user level). For output operations,
PCIS-DASK copies the data from a user buffer (driver level) to the driver buffer (kernel level) and
transfers outgoing data from the driver buffer to the NuDAQ PCI device.
However, if only polling I/O is performed, the initially allocated memory is not needed and you can use
the utility, NuDAQ Registry/Configuration utility to set the buffer size to be 0.
3.2 The Fundamentals of Building Windows NT/98/2000 Applications
3.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.H
contains all the function declarations and constants that you can use to develop your data
acquisition application. Incorporate the following statement in your code to include the header
file.
#include “DASK.H”
step 3.
Build your application.
Setting the appropriate compile and link options, then build your application by selecting the
Build command from Build menu (Visual C/C++ 4.0). Remember to link PCIS-DASK’s import
library, PCI-DASK.LIB.
3.2.1 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