User`s guide
Universal Library User's Guide Universal Library Description and Use
17
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 Universal Library with Visual Basic, include the Universal 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 Universal Library. Once the declarations for the Universal Library have been added to your
project, call the library functions from any Form's event handlers.
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)
Visual Basic example programs
A complete set of Visual Basic example programs is included in the VBWIN folder of the Universal Library
installation directory. Each program illustrates the use of a Universal Library function from within a Visual
Basic program. The .FRM files contain the programs, and the corresponding .VBP files are the project files
used to build the programs for Visual Basic.
Microsoft Visual C++
To use the Universal Library with MS Visual C++, include the Universal Library header file CBW.H in your
C/C++ program and add the library file CBW32.LIB to your library modules for linking to the CBW32.DLL.
Microsoft Visual C++ example programs
The CWIN folder of the Universal Library installation directory contains three sample programs - Wincai01,
Wincai02 and Wincai03. Each program is an example of a simple C program that calls a few of the Universal
Library functions from a Windows application. Use the .DSP project files to build a 32-bit application.
The non-Windows C examples in the C folder of the installation directory provide a more complete set of
examples. You can compile these programs as 32-bit console applications for Windows by using the
MAKEMC32.BAT file.
Borland C /C++ for Windows
For 32-bit Borland (or Inprise) C/C++ compilers, include the Universal Library header file CBW.H in your
program and link with the import library file CBW32BC.LIB.
Borland C/C++ example programs
The non-Windows C examples provide an extensive set of examples. These can be compiled as 32-bit console
applications using the MAKEBC32.BAT file.