
USB DrDAQ Programmer's Guide
39
Copyright © 2010-2011 Pico Technology Ltd. All rights reserved.
usbdrdaqpg.en
3.6
Programming support
3.6.1
Introduction
We supply examples for the following programming languages:
3.6.2
C and C++
C
To compile the program, create a new project for an Application containing the
following files:
usbdrdaqcon.c
and
usbdrdaq.lib
(Microsoft Visual C 32-bit applications).
or
usbdrdaqbc.lib
(Borland 32-bit applications)
The following files must be in the compilation directory:
usbdrdaqapi.h
picostatus.h
The following file must be in the same directory as the executable, or in the search
path.
usbdrdaq.dll
C++
C++ programs can access all versions of the driver. If
ubsdrdaqapi
.h
is included in
a C++ program, the
PREF1
macro expands to
extern "C"
: this disables name-
decoration, and enables C++ routines to make calls to the driver routines using C
headers.
3.6.3
Excel
The easiest way to transfer data to Excel is to use PicoLog. However, you can also
write an Excel macro which calls
ubsdrdaq.dll
to read in a set of data values. The
Excel macro language is similar to Visual Basic.
The example
ubsdrdaq.xls
reads in 20 values from Channels 1 and 2, one per
second, and assigns them to cells A1..B20.
Use Excel Version 7 or higher.
Note that it is usually necessary to copy the DLL file to the
\windows\system
directory.
39
39
40