User Manual
ADC-20/ADC-24 User's Guide 14
Copyright © 2005-2010 Pico Technology Ltd. All rights reserved. adc20.en
5 Programmer's reference
5.1
Recording methods
The ADC-20/ADC-24 driver provides three methods of recording data. All these
methods support USB1.1.
Streaming – The driver constantly polls the device, and samples are placed in a
buffer until retrieved by your application. Precise sample timing is controlled by
the unit.
Single Value (blocking) – You make a single request for a sample, blocking the
calling thread, and when the sample has been received the driver returns the value
to your application.
Single Value (non-blocking) – You make a single request for a sample without
blocking the calling thread, and when the sample has been received the driver
returns the value to your application.
5.2
Windows driver
Once you have installed the software, the Drivers\Win32 subdirectory will contain a
demo program, HRDL.c, that shows exactly how to drive the data logger, and a driver,
PicoHRDL.dll. It also contains a copy of this manual as a PDF file (ADC20044.PDF).
PicoHRDL.dll is a Windows Dynamic Link Library (DLL), which can be used with C,
C++, Delphi, Visual Basic, National Instruments LabVIEW and Agilent VEE programs.
It can also be used with programs like Microsoft Excel, where the macro language is a
form of Visual Basic. More than one application can access the Windows DLL at the
same time, as long as the applications do not change the settings for channels that
they are not using. The driver supports all Windows operating systems from Windows
XP onwards.
5.3
Scaling
To convert from ADC values to volts, first obtain the minimum and maximum ADC
values for the selected channel by calling the HRDLGetMinMaxAdcCounts function in
the driver. Next, scale the ADC value to the voltage range you specified when you
called HRDLSetAnalogInChannel. You can calculate the voltage range
programmatically by using
Vmax = 2500 mV / (2^r)
where r is the range constant you supplied to HRDLSetAnalogInChannel (0 for ±2500
mV, 1 for ±1250 mV and so on).