PICO ADC-20 Programmer's Manual

High-resolution data loggers
Hide thumbs Also See for ADC-20:
Table of Contents

Advertisement

Quick Links

ADC-20/ADC-24
High-Resolution Data Loggers
Programmer's Guide
adc20.en r1

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the ADC-20 and is the answer not in the manual?

Questions and answers

Subscribe to Our Youtube Channel

Summary of Contents for PICO ADC-20

  • Page 1 ADC-20/ADC-24 High-Resolution Data Loggers Programmer's Guide adc20.en r1...
  • Page 2: Table Of Contents

    2 Collecting windowed or streaming data ................. 29 2 Single-value recording methods ......................30 1 Collecting a single reading, blocking ..................30 2 Collecting a single reading, non-blocking ................30 7 Glossary ..........................31 adc20.en r1 Copyright © 2005–2019 Pico Technology Ltd. All rights reserved.
  • Page 3: Overview

    ADC-20/ADC-24 Programmer's Guide Overview The ADC-20 and ADC-24 High-Resolution Data Loggers are multichannel, high-accuracy USB data loggers for use with PCs. They require no external power supply. We provide 32-bit and 64-bit Windows drivers to allow you to control the data loggers from your own software.
  • Page 4: Notices

    Access. The licensee agrees to allow access to this software only to persons who have been informed of these conditions and agree to abide by them. Usage. The software in this release is for use only with Pico products or with data collected using Pico products.
  • Page 5: Getting Started

    ADC-20/ADC-24 Programmer's Guide Getting started Installing the software Before you connect the ADC-20 or ADC-24 to your computer for the first time, you must install the driver using PicoSDK. You can download 32-bit and 64-bit versions of PicoSDK from www.picotech.com/downloads.
  • Page 6: Concepts

    (DLL) in the subdirectory of your SDK installation is a driver that allows you to program your ADC-20 or ADC-24 data logger. It is supplied in 32-bit and 64-bit versions. The driver exports the function definitions in standard C format, but this does not limit you to programming in C.
  • Page 7: Driver Functions

    ADC-20/ADC-24 Programmer's Guide Driver functions The following sections describe the functions available to an application using the ADC-20 and ADC-24. All functions are C functions using the standard call naming convention (__stdcall) and are exported with both decorated and undecorated names.
  • Page 8: Hrdlcloseunit - Shuts Down Unit

    HRDLCloseUnit – shuts down unit int16_t HRDLCloseUnit int16_t handle Shuts down an ADC-20 or ADC-24 device. Arguments handle, device identifier returned by HRDLOpenUnit() Returns if a valid handle is passed if not adc20.en r1 Copyright © 2005–2019 Pico Technology Ltd. All rights reserved.
  • Page 9: Hrdlcollectsinglevalueasync - Sample A Single Value, Non-Blocking

    0. singleEnded, The type of voltage to be measured: 0: differential <>0: single-ended Returns if a valid handle is passed and the settings are correct if not Copyright © 2005–2019 Pico Technology Ltd. All rights reserved. adc20.en r1...
  • Page 10: Hrdlgetminmaxadccounts - Return The Maximum And Minimum Adc Count

    Pointer to an int32_t, used to return the maximum ADC count available for the unit · referred to by handle channel, · Channel number for which maximum and minimum ADC count are required Returns if a valid handle is passed if not adc20.en r1 Copyright © 2005–2019 Pico Technology Ltd. All rights reserved.
  • Page 11: Hrdlgetnumberofenabledchannels - Return The Number Of Analog Channels Enabled

    HRDLOpenUnit() nEnabledChannels, pointer to an int16_t where the number of channels enabled will be written Returns if a valid handle is passed if not Copyright © 2005–2019 Pico Technology Ltd. All rights reserved. adc20.en r1...
  • Page 12: Hrdlgetsinglevalue - Take One Sample For The Specified Channel

    If the function fails, call with to obtain the HRDL_SETTINGS (5), then call HRDLGetUnitInfo() error code. If the error code is again with info = HRDL_SETTINGS_ERROR (8) to determine the settings error. adc20.en r1 Copyright © 2005–2019 Pico Technology Ltd. All rights reserved.
  • Page 13: Hrdlgetsinglevalueasync - Retrieves Reading After Call To Hrdlcollectsinglevalueasync()

    // Open and initialize the unit // Set the channel parameters channelNo = HRDL_ANALOG_IN_CHANNEL_1; range = HRDL_2500_MV; singleEnded = TRUE; bConversionFinished = FALSE; while (true) PollSingleValue(handle, &bConversionFinished, &value, channelNo, range, Copyright © 2005–2019 Pico Technology Ltd. All rights reserved. adc20.en r1...
  • Page 14 Driver functions singleEnded); (bConversionFinished == TRUE) // Do something with the value channelNo++; // This would be HRDL_ANALOG_IN_CHANNEL_8 for the ADC-20 (channelNo > HRDL_ANALOG_IN_CHANNEL_16) channelNo = HRDL_ANALOG_IN_CHANNEL_1; else // Do something else while waiting for the reading from the unit...
  • Page 15: Hrdlgettimesandvalues - Return Time-Stamped Samples

    DI the digital inputs. The channels are always ordered from channel 1 up to the maximum channel number (ADC-24: channel 16, ADC-20: channel 8). If one or more digital channels are set as inputs then the first sample contains the digital channels.
  • Page 16: Hrdlgetunitinfo - Returns Unit Information As Character String

    This function writes information about the ADC-20 or ADC-24 device to a character string. If the info = HRDL_ERROR (7) logger fails to open, only is available to explain why the last open unit call failed. When retrieving the driver version, the handle value is ignored.
  • Page 17 SE_CONVERSION_IN_PROGRESS (7) A conversion is in progress for a single asynchronous operation SE_COMMUNICATION_FAILED (8) The PC has lost communication with the device SE_OK (9) All settings have been completed successfully Copyright © 2005–2019 Pico Technology Ltd. All rights reserved. adc20.en r1...
  • Page 18: Hrdlgetvalues - Return Samples For Each Enabled Channel

    The channels are always ordered from channel 1 up to the maximum channel number (ADC-24: channel 16, ADC-20: channel 8). If one or more digital channels are set as inputs, and digital inputs HRDLSetDigitalIOChannel() enabledDigitalIn=1,...
  • Page 19: Hrdlopenunit - Open A Data Logger

    ADC-20/ADC-24 Programmer's Guide 5.10 HRDLOpenUnit – open a data logger int16_t HRDLOpenUnit void This function opens an ADC-20 or ADC-24 device. The API driver can support up to 20 units. Arguments None Returns –1 if the unit fails to open...
  • Page 20: Hrdlopenunitasync - Open A Unit Without Blocking The Calling Thread

    Driver functions 5.11 HRDLOpenUnitAsync – open a unit without blocking the calling thread int16_t HRDLOpenUnitAsync void Opens an ADC-20 or ADC-24 device without blocking the calling thread. Arguments None Returns if there is already an open operation in progress if the open operation has been initiated adc20.en r1...
  • Page 21: Hrdlopenunitprogress - Check Progress Of An Asynchronous Open Operation

    100% implies that the open operation is complete. Returns if open operation is still in progress if the open operation is complete Copyright © 2005–2019 Pico Technology Ltd. All rights reserved. adc20.en r1...
  • Page 22: Hrdlready - Find Out If Readings Are Ready To Be Collected

    This function indicates when the readings are ready to be retrieved from the driver. Arguments handle, device identifier returned by HRDLOpenUnit() Returns 0 if not ready, or failed 1 if ready adc20.en r1 Copyright © 2005–2019 Pico Technology Ltd. All rights reserved.
  • Page 23: Hrdlrun - Start Sampling

    Sampling methods method Description Value of BM_BLOCK (0) Collect a single block and stop BM_WINDOW (1) Collect a sequence of overlapping blocks BM_STREAM (2) Collect a continuous stream of data Copyright © 2005–2019 Pico Technology Ltd. All rights reserved. adc20.en r1...
  • Page 24: Hrdlsetanaloginchannel - Enable Or Disable An Analog Channel

    HRDL_625_MV (2) ±625 mV ADC-24 only HRDL_313_MV (3) ±312.5 mV ADC-24 only HRDL_156_MV (4) ±156.25 mV ADC-24 only HRDL_78_MV (5) ±78.125 mV ADC-24 only HRDL_39_MV (6) ±39.0625 mV ADC-24 only adc20.en r1 Copyright © 2005–2019 Pico Technology Ltd. All rights reserved.
  • Page 25: Hrdlsetdigitaliochannel - Set A Digital Output Or Input (Adc-24 Only)

    Pin values for Pin value Description HRDL_DIGITAL_IO_CHANNEL_1 (1) IO Pin 1 HRDL_DIGITAL_IO_CHANNEL_2 (2) IO Pin 2 HRDL_DIGITAL_IO_CHANNEL_3 (4) IO Pin 3 HRDL_DIGITAL_IO_CHANNEL_4 (8) IO Pin 4 Copyright © 2005–2019 Pico Technology Ltd. All rights reserved. adc20.en r1...
  • Page 26 When a digital channel has been configured as an output, it can then be driven high or low with the digitalOutputPinState parameter, again using bit patterns to represent the different digital channels. The default setting for the digital channels is "output, low". adc20.en r1 Copyright © 2005–2019 Pico Technology Ltd. All rights reserved.
  • Page 27: Hrdlsetinterval - Set The Sampling Time Interval

    Conversion times conversionTime Conversion time Value of HRDL_60MS (0) 60 ms HRDL_100MS (1) 100 ms HRDL_180MS (2) 180 ms HRDL_340MS (3) 340 ms HRDL_660MS (4) 660 ms Copyright © 2005–2019 Pico Technology Ltd. All rights reserved. adc20.en r1...
  • Page 28: Hrdlsetmains - Set The Mains Noise Rejection Frequency

    HRDLOpenUnit() sixtyHertz, specifies whether 50 Hz or 60 Hz noise rejection is applied: reject 50 Hz <> 0: reject 60 Hz Returns 0 if failed 1 if successful adc20.en r1 Copyright © 2005–2019 Pico Technology Ltd. All rights reserved.
  • Page 29: Hrdlstop - Stop The Device When Streaming

    This is particularly important in streaming mode, to ensure that the scope is ready for the next capture. When running the device in block mode, you can call this function to interrupt data capture. Arguments handle, device identifier returned by HRDLOpenUnit() Copyright © 2005–2019 Pico Technology Ltd. All rights reserved. adc20.en r1...
  • Page 30: Sequence Of Calls And Data Flow

    Repeat Loop until ready (HRDLReady()) HRDLGetValues() · Collect data with · Repeat from "Start the unit" until you have finished collecting data. HRDLCloseUnit() · Close the connection to the unit with adc20.en r1 Copyright © 2005–2019 Pico Technology Ltd. All rights reserved.
  • Page 31: Collecting Windowed Or Streaming Data

    Repeat Loop until ready (HRDLReady()) HRDLGetValues() · Collect data whenever you want with HRDLStop() · Call to end data collection HRDLCloseUnit() · Close the connection to the unit with Copyright © 2005–2019 Pico Technology Ltd. All rights reserved. adc20.en r1...
  • Page 32: Single-Value Recording Methods

    Start the conversion for a single reading with · Wait until the reading is ready (HRDLReady()) HRDLGetSingleValueAsync() · Get the reading from the driver with HRDLCloseUnit() · Close the connection to the unit with adc20.en r1 Copyright © 2005–2019 Pico Technology Ltd. All rights reserved.
  • Page 33: Glossary

    MSB. Most significant bit. In an n-bit binary word, the most significant bit has the value 2 Noise rejection. The ability of the data logger to attenuate noise in a given frequency range. The ADC-20/ADC-24 can be programmed to reject noise at either 50 hertz or 60 hertz. The noise rejection ratio is defined as:...
  • Page 34 Shanghai 200070 PE19 8YP PR China United Kingdom Tel: +44 (0) 1480 396 395 Tel: +1 800 591 2796 Tel: +86 21 2226-5152 sales@picotech.com sales@picotech.com support@picotech.com support@picotech.com pico.china@picotech.com www.picotech.com adc20.en r1 2019-06-11 Copyright © 2005–2019 Pico Technology Ltd. All rights reserved.

This manual is also suitable for:

Adc-24

Table of Contents