
Writing your own software
40
Copyright © 2010-2011 Pico Technology Ltd. All rights reserved.
usbdrdaqpg.en
3.6.4
LabVIEW
The SDK contains a library of VIs that can be used to control the USB DrDAQ and two
examples of using these VIs.
DrDAQBlockExample.vi
is a simple block mode example that demonstrates using
block mode on a single channel with a trigger.
DrDAQStreamingExample.vi
demonstrates streaming mode acquisition on all
channels with triggering. It also demonstrates use of the general-purpose I/Os, the
arbitrary waveform generator, channel scaling and the RGB LED.
The LabVIEW library (UsbDrDaq.llb) can be placed in the user.lib subdirectory to make
the VIs available on the ‘User Libraries’ palette. You should also copy UsbDrDaq.dll to
the folder containing your LabView project.
The library contains the following VIs:
PicoErrorHandler.vi
- takes an error cluster and, if an error has occurred,
displays a message box indicating the source of the error and the status code returned
by the driver
PicoStatus.vi
- checks the status value returned by calls to the driver If the driver
returns an error, the status member of the error cluster is set to ‘true’ and the error
code and source are set.
UsbDrDaqChannelScaling.vi
– is used to discover available scales for a given
channel, the scale that is currently being used and to change the scale.
UsbDrDaqClose.vi
– Closes the USB DrDAQ.
UsbDrDaqGetBlock.vi
– is used to get a block of data from the USB DrDAQ. The
method can be either single or windowed and the VI returns the trigger index and the
values. The acquisition settings must be specified first using
UsbDrDaqSettings.vi
.
UsbDrDaqGetStreamingData.vi
– is used to get samples once streaming has been
started (using
UsbDrDaqStartStreaming.vi
). The size of the buffer created by this
VI must be specified. This should be large enough to contain all the samples returned
when the VI is called. The VI returns the number of values collected, the trigger index
and the values themselves.
UsbDrDaqGPIO.vi
– is used to control the general-purpose I/Os. GPIOs 1 & 2 can be
used as digital inputs, digital outputs, PWM outputs and pulse-counting inputs. GPIOs
3 & 4 can be used as digital inputs and digital outputs.
UsbDrDaqLEDControl.vi
– can be used to enable and control the RGB LED.
UsbDrDaqOpen.vi
– Opens a USB DrDAQ and returns a handle to the device.
UsbDrDaqSettings.vi
– is used to set up data acquisition and the trigger and
should be called before starting streaming or block-mode collection.
UsbDrDaqSigGen.vi
– is used to control the signal generator. There are a set of
standard waveforms that can be selected and "arbitrary waveform" can also be
selected. When selecting an arbitrary waveform, an array of values and the number of
values should be specified. The update rate can also be selected. Selecting "none"
under waveform stops the signal generator.