User`s manual

CYDAS UDR Library User’s Guide CYDAS UDR Library Description and Use
8
The Windows library contains four functions for managing these Windows global memory buffers:
cbWinBufAlloc()
cbWinBufFree()
cbWinArrayToBuf()
cbWinBufToArray()
Real-time acquisition under Windows
Real-time acquisition is available for Windows. To operate at full speed in Windows, the A/D board must
have an onboard FIFO buffer. All of our advanced designs have FIFO buffers, including our CYDAS xP
boards (except for the CYDAS 8P), and many of our ISA boards, such as the CYDAS 80x, CYDAS 160x,
CYDAS 140x, and CYDAS 1802ST. All of these data acquisition boards will operate at full speed in
Windows.
Applying software calibration factors in real time on a per-sample basis eats up machine cycles. If your CPU
is slow, or if processing time is at a premium, withhold calibration until after the acquisition run is complete.
Turning off real-time software calibration saves CPU time during a high speed acquisition run.
Processor speed
Processor speed remains a factor for DMA transfers and for real-time software calibration. Processors of less
than a 150 megahertz (MHz) Pentium class may impose speed limits below the capability of the board (refer
to specific board information.)
If your processor is less than a 150 MHz Pentium and you need an acquisition speed in excess of 200 kilohertz
(
kHz), use the NOCALIBRATEDATA option to a turn off real-time software calibration and save CPU time.
After the acquisition is run, calibrate the data with
cbACalibrateData().
Visual Basic for Windows
To use the CYDAS UDR Library with Visual Basic, include the CYDAS UDR Library declaration file
CBW.BAS in your program. Include the file as a module in the project, or include it by reference inside those
Forms which call into the CYDAS UDR Library. Once the declarations for the CYDAS UDR Library have
been added to your project, call the library functions from any Form's event handlers.
When using the 32-bit version of Visual Basic, CBW.BAS references CBW32.DLL to call CYDAS UDR
Library functions. This is accomplished with conditional compile statements. When using 16-bit versions of
the Visual Basic (such as versions 3.0 or older), these conditional compile statements must be deleted.
For Visual Basic 6.0 and older, Windows memory buffers cannot be mapped onto arrays. As a consequence,
the
cbWinArrayToBuf() and cbWinBufToArray() functions must be used to copy data between arrays and
Windows buffers.
Example:
Count = 100
MemHandle = cbWinBufAlloc (Count)
cbAInScan (......,MemHandle,...)
cbWinBufToArray (MemHandle, DataArray(0), 0, Count)
For i = 0 To Count
Print DataArray(i)
Next i
cbWinBufFree (MemHandle)