background image

USB DrDAQ Programmer's Guide

37

Copyright © 2010-2011 Pico Technology Ltd. All rights reserved.

usbdrdaqpg.en

3.5.28 PICO_STATUS values

Every function in the USB DrDAQ API returns a status code from the following list of 

PICO_STATUS

 values:

Code
(hex)

Enum

Description

00

PICO_OK

The Data Logger is functioning correctly

01

PICO_MAX_UNITS_OPENED

An attempt has been made to open more than 

UsbDrDaq_MAX_UNITS

02

PICO_MEMORY_FAIL

Not enough memory could be allocated on the
host machine

03

PICO_NOT_FOUND

No USB DrDAQ device could be found

04

PICO_FW_FAIL

Unable to download firmware

05

PICO_OPEN_OPERATION_IN_PROGRESS

A request to open a device is in progress

06

PICO_OPERATION_FAILED

The operation was unsuccessful

07

PICO_NOT_RESPONDING

The device is not responding to commands from
the PC

08

PICO_CONFIG_FAIL

The configuration information in the device has
become corrupt or is missing

09

PICO_KERNEL_DRIVER_TOO_OLD

The 

picopp.sys

 file is too old to be used with

the device driver

0A

PICO_EEPROM_CORRUPT

The EEPROM has become corrupt, so the device
will use a default setting

0B

PICO_OS_NOT_SUPPORTED

The operating system on the PC is not
supported by this driver

0C

PICO_INVALID_HANDLE

There is no device with the handle value passed

0D

PICO_INVALID_PARAMETER

A parameter value is not valid

0E

PICO_INVALID_TIMEBASE

The time base is not supported or is invalid

0F

PICO_INVALID_VOLTAGE_RANGE

The voltage range is not supported or is invalid

10

PICO_INVALID_CHANNEL

The channel number is not valid on this device
or no channels have been set

11

PICO_INVALID_TRIGGER_CHANNEL

The channel set for a trigger is not available on
this device

12

PICO_INVALID_CONDITION_CHANNEL

The channel set for a condition is not available
on this device

13

PICO_NO_SIGNAL_GENERATOR

The device does not have a signal generator

14

PICO_STREAMING_FAILED

Streaming has failed to start or has stopped
without user request

15

PICO_BLOCK_MODE_FAILED

Block failed to start - a parameter may have
been set wrongly

16

PICO_NULL_PARAMETER

A parameter that was required is 

NULL

18

PICO_DATA_NOT_AVAILABLE

No data is available from a run block call

19

PICO_STRING_BUFFER_TOO_SMALL

The buffer passed for the information was too
small

1A

PICO_ETS_NOT_SUPPORTED

ETS is not supported on this device

1B

PICO_AUTO_TRIGGER_TIME_TOO_SHORT

The auto trigger time is less than the time it
will take to collect the data

1C

PICO_BUFFER_STALL

The collection of data has stalled as unread
data would be overwritten

1D

PICO_TOO_MANY_SAMPLES

The number of samples requested is more than
available in the current memory segment

1E

PICO_TOO_MANY_SEGMENTS

Not possible to create number of segments
requested

1F

PICO_PULSE_WIDTH_QUALIFIER

A null pointer has been passed in the trigger
function or one of the parameters is out of
range

Summary of Contents for DrDAQ

Page 1: ...Copyright 2010 2011 Pico Technology Ltd All rights reserved USB DrDAQ Programmer s Guide usbdrdaqpg en 2 Data Logger...

Page 2: ......

Page 3: ...Info 14 5 UsbDrDaqRun 15 6 UsbDrDaqReady 16 7 UsbDrDaqStop 17 8 UsbDrDaqSetInterval 18 9 UsbDrDaqSetTrigger 19 10 UsbDrDaqGetValues 20 11 UsbDrDaqGetTriggerTimeOffsetNs 21 12 UsbDrDaqGetSingle 22 13 U...

Page 4: ...Contents II Copyright 2010 2011 Pico Technology Ltd All rights reserved usbdrdaqpg en 42 4 Glossary 43 Index...

Page 5: ...s done in order to minimise interference You should take care not to connect the ground screw terminal outer shell of BNC or exposed metalwork of USB DrDAQ to anything which may be at some voltage oth...

Page 6: ...t or software is suitable for a given application It is your responsibility therefore to ensure that the product is suitable for your application Mission critical applications This software is intende...

Page 7: ...11 Pico Technology Ltd All rights reserved usbdrdaqpg en 1 4 Contact details Address Pico Technology James House Colmworth Business Park ST NEOTS Cambridgeshire PE19 8YP United Kingdom Tel 44 1480 396...

Page 8: ...eturned as 765 You can call the routine UsbDrDaqGetChannelInfo to find out how many decimal places a channel is using and also to get a divider that converts the integer value to the corresponding rea...

Page 9: ...this entry Pico created numbers are from 100 upwards Resistor 1 The ID resistor value in kiloohms In this example 1 represents 1k 2 2 represents 2k2 and so on For external sensors this resistor shoul...

Page 10: ...es linear scaling Offset 0 Gain 1 These are the offset and gain values for linear scaling OutOfRange 0 This specifies what to do if the raw value is outside the range of the table lookup The options a...

Page 11: ...ite a 32 bit application and run it under WoW64 The driver supports up to 64 units at one time 3 2 Installing the driver The driver is supplied with the USB DrDAQ SDK You can download the latest versi...

Page 12: ...uld not be updated frequently Using windowing it is possible to ask for a new block more frequently for example every second and to receive a block containing 9 seconds of repeat data and 1 second of...

Page 13: ...hannel UsbDrDaqSetSigGenBuiltIn sets the arbitrary waveform generator using standard waveform types UsbDrDaqSetSigGenArbitrary allows full control of the arbitrary waveform generator UsbDrDaqStopSigGe...

Page 14: ...al that the driver will accept depends on the capture mode selected The normal calling sequence to collect a block of data is as follows Check that the driver version is correct Open the driver Set tr...

Page 15: ...unit Arguments handle the function will write a value here that uniquely identifies the data logger that was opened Use this as the handle parameter when calling any other UsbDrDaq API function Retur...

Page 16: ...Ltd All rights reserved usbdrdaqpg en 3 5 3 UsbDrDaqCloseUnit PICO_STATUS UsbDrDaqCloseUnit short handle This function closes the unit Arguments handle handle returned from UsbDrDaqOpenUnit or UsbDrDa...

Page 17: ...the function writes the requested information or NULL if you are only interested in the value of requiredSize stringLength the maximum number of characters that the function should write to string re...

Page 18: ...from UsbDrDaqOpenUnit or UsbDrDaqOpenUnitProgress no_of_values the number of samples the unit should collect method which method to use to collect the data from the following list BM_SINGLE BM_WINDOW...

Page 19: ...CO_STATUS UsbDrDaqReady short handle short ready This function indicates when UsbDrDaqRun has captured the requested number of samples Arguments handle handle returned from UsbDrDaqOpenUnit or UsbDrDa...

Page 20: ...Ltd All rights reserved usbdrdaqpg en 3 5 7 UsbDrDaqStop PICO_STATUS UsbDrDaqStop short handle This function aborts data collection Arguments handle handle returned from UsbDrDaqOpenUnit or UsbDrDaqO...

Page 21: ...or UsbDrDaqOpenUnitProgress us_for_block target total time in which to collect ideal_no_of_samples in microseconds ideal_no_of_samples the number of samples that you want to collect This number is us...

Page 22: ...auto_ms time in milliseconds after which the unit will auto trigger if the trigger condition is not met channel which channel to trigger on dir which edge to trigger on 0 rising edge 1 falling edge t...

Page 23: ...on should collect On exit the number of samples per channel that were actually written to the buffer overflow on exit a bit field indicating which if any input channels overflowed the input range of t...

Page 24: ...imeOffsetNs short handle _int64 time This function returns the time between the trigger point and the first post trigger sample This is calculated using linear interpolation Arguments handle handle re...

Page 25: ...nitProgress channel which channel to sample value a location where the function will write the sample value overflow on exit a bit field indicating which if any input channels overflowed the input ran...

Page 26: ...to finish You can find out when it has finished by periodically calling UsbDrDaqOpenUnitProgress until that function returns a non zero value and a valid data logger handle The driver can support up t...

Page 27: ...dle of the opened data logger if the operation was successful Use this as the handle parameter when calling any other USB DrDAQ API function 0 if no unit is found or the unit fails to open 0 handle of...

Page 28: ...uilt in and custom that are available for a particular channel Arguments handle handle returned from UsbDrDaqOpenUnit or UsbDrDaqOpenUnitProgress channel the channel of interest nScales the function w...

Page 29: ...DAQ_INPUTS channel short scalingNumber This function sets the scaling for a particular channel Arguments handle handle returned from UsbDrDaqOpenUnit or UsbDrDaqOpenUnitProgress channel the channel of...

Page 30: ...m UsbDrDaqOpenUnit or UsbDrDaqOpenUnitProgress offsetVoltage The offset voltage in microvolts The offset voltage must be in the range 1 5 V to 1 5 V pkToPk The peak to peak voltage in microvolts The m...

Page 31: ...e returned from UsbDrDaqOpenUnit or UsbDrDaqOpenUnitProgress offsetVoltage The offset voltage in microvolts The offset voltage must be in the range 1 5 V to 1 5 V pkToPk The peak to peak voltage in mi...

Page 32: ...ts reserved usbdrdaqpg en 3 5 19 UsbDrDaqStopSigGen PICO_STATUS UsbDrDaqStopSigGen short handle This function turns the AWG off Arguments handle handle returned from UsbDrDaqOpenUnit or UsbDrDaqOpenUn...

Page 33: ...gure the general purpose I Os as digital outputs Arguments handle handle returned from UsbDrDaqOpenUnit or UsbDrDaqOpenUnitProgress IOChannel One of the following USB_DRDAQ_GPIO_1 1 USB_DRDAQ_GPIO_2 U...

Page 34: ...ned char cycle This function is used to configure the general purpose I Os as pulse width modulation outputs Arguments handle handle returned from UsbDrDaqOpenUnit or UsbDrDaqOpenUnitProgress IOChanne...

Page 35: ...is used to configure the general purpose I Os as digital inputs Arguments handle handle returned from UsbDrDaqOpenUnit or UsbDrDaqOpenUnitProgress IOChannel All GPIOs can be used for digital inputs pu...

Page 36: ...direction This function is used to configure the general purpose I Os for pulse counting and to start counting Arguments handle handle returned from UsbDrDaqOpenUnit or UsbDrDaqOpenUnitProgress IOCha...

Page 37: ...count This function will return the current pulse count It should be called after pulse counting has been started using UsbDrDaqStartPulseCount Arguments handle handle returned from UsbDrDaqOpenUnit...

Page 38: ...short handle short enabled This function enables or disables RGB mode on the LED Arguments handle handle returned from UsbDrDaqOpenUnit or UsbDrDaqOpenUnitProgress enabled If non zero RGB mode is ena...

Page 39: ...hort red unsigned short green unsigned short blue This function is used to set the colour of the LED once RGB mode has been enabled using USBDRDaqEnableRGBLED Arguments handle handle returned from Usb...

Page 40: ...selected scaling for the specified channel If a parameter is not required you can pass a null pointer to the routine Arguments handle handle returned from UsbDrDaqOpenUnit or UsbDrDaqOpenUnitProgress...

Page 41: ...0E PICO_INVALID_TIMEBASE The time base is not supported or is invalid 0F PICO_INVALID_VOLTAGE_RANGE The voltage range is not supported or is invalid 10 PICO_INVALID_CHANNEL The channel number is not v...

Page 42: ...et stored data is out of range 29 PICO_INVALID_INFO The information number requested is not a valid number 2A PICO_INFO_UNAVAILABLE The handle is invalid so no information is available about the devic...

Page 43: ...he 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...

Page 44: ...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...

Page 45: ...qpg en UsbDrDaqStartStreaming vi starts the device streaming data after the USB DrDAQ has been set up using UsbDrDaqSettings vi The number of values input is used by the driver to create its buffer On...

Page 46: ...ls in a fast signal MS Megasamples 1 000 000 samples PC Oscilloscope A virtual instrument formed by connecting a PicoScope oscilloscope to a computer running the PicoScope software PicoScope software...

Page 47: ...sbDrDaqGetSingle 21 UsbDrDaqGetTriggerTimeOffsetNs 20 UsbDrDaqGetUnitInfo 13 UsbDrDaqGetValues 19 UsbDrDaqOpenUnit 11 UsbDrDaqOpenUnitAsync 22 UsbDrDaqOpenUnitProgress 23 UsbDrDaqReady 15 UsbDrDaqRun...

Page 48: ...en R Repair 1 Running a unit 14 S Safety warning 1 Sampling interval setting 17 Scaling 25 Scaling files 4 Signal Generator 26 28 Software updates 4 Stopping a unit 16 Streaming 8 T Trigger setting 18...

Page 49: ...USB DrDAQ Programmer s Guide 45 Copyright 2010 2011 Pico Technology Ltd All rights reserved usbdrdaqpg en...

Page 50: ...ouse Colmworth Business Park ST NEOTS Cambridgeshire PE19 8YP United Kingdom Tel 44 0 1480 396 395 Fax 44 0 1480 396 296 www picotech com Copyright 2010 2011 Pico Technology Ltd All rights reserved us...

Reviews: