pico Technology PicoScope 2000 Series Programmer's Manual

Pc oscilloscopes
Hide thumbs Also See for PicoScope 2000 Series:

Advertisement

Quick Links

PicoScope 2000 Series
PC Oscilloscopes
Programmer's Guide
ps2000pg.en-4
Copyright © 2006-2011 Pico Technology Ltd. All rights reserved.

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the PicoScope 2000 Series and is the answer not in the manual?

Questions and answers

Summary of Contents for pico Technology PicoScope 2000 Series

  • Page 1 PicoScope 2000 Series PC Oscilloscopes Programmer's Guide ps2000pg.en-4 Copyright © 2006-2011 Pico Technology Ltd. All rights reserved.
  • Page 3: Table Of Contents

    ............................24 9 ps2000_get_unit_info ............................25 10 ps2000_get_values ............................26 11 ps2000_last_button_press ............................27 12 ps2000_open_unit ............................28 13 ps2000_open_unit_async ............................29 14 ps2000_open_unit_progress ............................30 15 ps2000_overview_buffer_status ............................31 16 ps2000_ready ............................32 17 ps2000_run_block ............................33 18 ps2000_run_streaming Copyright © 2006-2011 Pico Technology Ltd. All rights reserved. ps2000pg.en...
  • Page 4 28 ps2000SetPulseWidthQualifier ............................47 29 ps2000SetSigGenArbitrary ............................49 30 ps2000SetSigGenBuiltIn ............................51 31 ps2000_set_trigger ............................52 32 ps2000_set_trigger2 ............................53 33 ps2000_stop ............................54 34 my_get_overview_buffers ............................55 6 Driver error codes 4 Glossary .............................56 ..............................59 Index ps2000pg.en Copyright © 2006-2011 Pico Technology Ltd. All rights reserved.
  • Page 5: Introduction

    Liability. Pico Technology and its agents shall not be liable for any loss, damage or injury, howsoever caused, related to the use of Pico Technology equipment or software, unless excluded by statute.
  • Page 6: Warranty

    Goods will be free from defects in material and workmanship. Pico Technology shall not be liable for a breach of the warranty if the defect has been caused by fair wear and tear, wilful damage, negligence, abnormal working conditions...
  • Page 7: Installation

    PicoScope 2000 Series Programmer's Guide Installation Minimum system requirements For the PicoScope 2000 series PC Oscilloscope to operate correctly, a computer with the minimum system requirements to run Windows or the following (whichever is the higher specification) is required: Item...
  • Page 8: Technical Information

    Important You must install the PicoScope software, which includes the driver for the PicoScope 2000 Series PC Oscilloscope, before plugging the oscilloscope into your computer for the first time. (If you do plug in an oscilloscope before installing the driver, Windows will designate the device as U nknow n .
  • Page 9: Oversampling

    PicoScope 2203, 2204 and 2205 oscilloscopes only. 3.3.6 Triggering PicoScope 2000 Series PC Oscilloscopes can either start collecting data immediately, or be programmed to wait for a trigger event to occur. In both cases you need to use ps2000_set_trigger() function or (for scopes that support advanced triggering) ps2000SetAdvTriggerChannelConditions() function.
  • Page 10: Combining Oscilloscopes

    3.3.7 Combining oscilloscopes The 2000 Series driver can collect data from up to 64 PicoScope 2000 Series PC O scilloscopes at the same time. Each oscilloscope must be connected to a separate USB port. If a USB hub is used it must be a powered hub.
  • Page 11 The maximum number of values depends upon the size of the oscilloscope's memory. A PicoScope 2000 Series oscilloscope can sample at a number of different rates that correspond to the maximum sampling rate divided by 1, 2, 4, 8 and so on.
  • Page 12 Wait until the oscilloscope says it is ready using ps2000_ready(). Transfer the block of data from the oscilloscope using ps2000_get_times_and_values(). Display the data. Repeat steps 6 to 8 as necessary. 10. Stop the oscilloscope using ps2000_stop(). ps2000pg.en Copyright © 2006-2011 Pico Technology Ltd. All rights reserved.
  • Page 13 Start the oscilloscope running using ps2000_run_streaming(). Transfer the block of data from the oscilloscope using ps2000_get_values(). Display the data. Repeat steps 4 and 5 as necessary. Stop the oscilloscope using ps2000_stop(). Copyright © 2006-2011 Pico Technology Ltd. All rights reserved. ps2000pg.en...
  • Page 14 Retrieve any part of the data at any time scale by calling ps2000_get_streaming_values(). If you require raw data, retrieve it by calling ps2000_get_streaming_values_no_aggregation(). Repeat steps 10 to 11 as necessary. Close the oscilloscope by calling ps2000_close_unit(). ps2000pg.en Copyright © 2006-2011 Pico Technology Ltd. All rights reserved.
  • Page 15: Programming Examples

    (Microsoft Visual C 32-bit applications). ps2000.lib The following files must be in the compilation directory: ps2000.h and the following file must be in the same directory as the executable. ps2000.dll Copyright © 2006-2011 Pico Technology Ltd. All rights reserved. ps2000pg.en...
  • Page 16: Visual Basic

    TRUE rather than > 0 = TRUE 3.4.3 Delphi The program demonstrates how to operate PicoScope 2000 Series PC ps2000.dpr Oscilloscopes. The file contains procedure prototypes that you can ps2000.inc include in your own programs. Other required files include: ps2000.res ps2000fm.dfm...
  • Page 17: Functions

    PicoScope 2000 Series Programmer's Guide Functions 3.5.1 Introduction The PicoScope 2000 Series API exports the following functions for you to use in your own applications: ps2000_close_unit ps2000_flash_led ps2000_get_streaming_last_values ps2000_get_streaming_values ps2000_get_streaming_values_no_aggregation ps2000_get_timebase ps2000_get_times_and_values ps2000_get_unit_info ps2000_get_values ps2000_last_button_press ps2000_open_unit ps2000_open_unit_async ps2000_open_unit_progress ps2000_overview_buffer_status ps2000_ready...
  • Page 18: Ps2000_Close_Unit

    Shuts down a PicoScope 2000 Series oscilloscope. Applicability All modes Arguments the handle, returned by ps2000_open_unit(), of the handle: oscilloscope being closed. Returns non-zero: if a valid handle is passed. 0: if handle is not valid. ps2000pg.en Copyright © 2006-2011 Pico Technology Ltd. All rights reserved.
  • Page 19: Ps2000_Flash_Led

    Flashes the LED on the front of the oscilloscope (or in the pushbutton, for the PicoScope 2104 and 2105 oscilloscopes) three times and returns within one second. Applicability All modes Arguments the handle of the PicoScope 2000 Series oscilloscope. handle: Returns non-zero: if a valid handle is passed. 0: if handle is invalid.
  • Page 20: Ps2000_Get_Streaming_Last_Values

    1: if the callback will be called. 0: if the callback will not be called, either because one of the inputs is out of range or because there are no samples available. ps2000pg.en Copyright © 2006-2011 Pico Technology Ltd. All rights reserved.
  • Page 21 Each sample of aggregated data is created by processing a block of raw samples. The aggregated sample is stored as a pair of values: the minimum and the maximum values of the block. Copyright © 2006-2011 Pico Technology Ltd. All rights reserved. ps2000pg.en...
  • Page 22 Returns The number of values written to each buffer, if successful. 0: if a parameter was out of range. ps2000pg.en Copyright © 2006-2011 Pico Technology Ltd. All rights reserved.
  • Page 23 . The special value PS2000_MIN_VALUE PS2000_MAX_VALUE PS2000_LOST_DATA is stored in the buffer when data could not be collected because of a buffer overrun. (See Scaling for more details of data values.) Copyright © 2006-2011 Pico Technology Ltd. All rights reserved. ps2000pg.en...
  • Page 24 Returns The number of values written to each buffer, if successful. 0: if a parameter was out of range. ps2000pg.en Copyright © 2006-2011 Pico Technology Ltd. All rights reserved.
  • Page 25 If is null, the max_samples function will write nothing. Returns non-zero: if all parameters are in range. 0: on error. Copyright © 2006-2011 Pico Technology Ltd. All rights reserved. ps2000pg.en...
  • Page 26 *times, short *buffer_a, short *buffer_b, short *buffer_c, short *buffer_d, short *overflow, short time_units, long no_of_values This function is used to get values and times in block mode after calling ps2000_run_block(). ps2000pg.en Copyright © 2006-2011 Pico Technology Ltd. All rights reserved.
  • Page 27: Ps2000_Get_Timebase

    0: if one or more of the parameters are out of range, or if the times will overflow with the requested (use time_units ps2000_get_timebase() to acquire the most suitable time_units or if the oscilloscope is in streaming mode. Copyright © 2006-2011 Pico Technology Ltd. All rights reserved. ps2000pg.en...
  • Page 28 PC Oscilloscope that is attached to the computer. PS2000_BATCH_AND_SERIAL The batch and serial number of "CMY66/052" the oscilloscope. PS2000_CAL_DATE "14Jan08" The calibration date of the oscilloscope. PS2000_ERROR_CODE "4" One of the Error codes. ps2000pg.en Copyright © 2006-2011 Pico Technology Ltd. All rights reserved.
  • Page 29: Ps2000_Get_Times_And_Values

    The actual number of data values per channel returned, which may be less than if streaming. no_of_values 0: if one of the parameters is out of range or the oscilloscope is not in a suitable mode. Copyright © 2006-2011 Pico Technology Ltd. All rights reserved. ps2000pg.en...
  • Page 30: Ps2000_Last_Button_Press

    2104 or 2105 PC Oscilloscope and then resets the status to zero. Applicability PicoScope 2104 and 2105 only Arguments handle of the oscilloscope handle: Returns 0: no button press registered 1: short button press registered 2: long button press registered ps2000pg.en Copyright © 2006-2011 Pico Technology Ltd. All rights reserved.
  • Page 31: Ps2000_Open_Unit

    PicoScope 2000 Series Programmer's Guide 3.5.12 ps2000_open_unit short ps2000_open_unit ( void This function opens a PicoScope 2000 Series oscilloscope. The driver can support up to 64 oscilloscopes. Applicability All modes Arguments None Returns -1: if the oscilloscope fails to open.
  • Page 32: Ps2000_Open_Unit_Async

    3.5.13 ps2000_open_unit_async short ps2000_open_unit_async ( void This function opens a PicoScope 2000 Series oscilloscope without waiting for the operation to finish. You can find out when it has finished by periodically calling ps2000_open_unit_progress() until that function returns a non-zero value and a valid oscilloscope handle.
  • Page 33 0 to 100, where 100 implies that the operation is complete. Returns >0: if the driver successfully opens the oscilloscope 0: if opening still in progress -1: if the oscilloscope failed to open or was not found Copyright © 2006-2011 Pico Technology Ltd. All rights reserved. ps2000pg.en...
  • Page 34 The function will write a non-zero value to indicate a buffer overrun. Returns 0: if the function was successful. 1: if the function failed due to an invalid handle. ps2000pg.en Copyright © 2006-2011 Pico Technology Ltd. All rights reserved.
  • Page 35: Ps2000_Ready

    -1: if the oscilloscope is not attached. The USB transfer failed, indicating that the oscilloscope may well have been unplugged. Copyright © 2006-2011 Pico Technology Ltd. All rights reserved. ps2000pg.en...
  • Page 36: Ps2000_Run_Block

    The actual time may differ from computer to computer, depending on how quickly the computer can respond to I/O requests. Returns 0: if one of the parameters is out of range. non-zero: if successful. ps2000pg.en Copyright © 2006-2011 Pico Technology Ltd. All rights reserved.
  • Page 37 Returns non-zero if streaming has been enabled correctly. if a problem occurred or a value was out of range. Copyright © 2006-2011 Pico Technology Ltd. All rights reserved. ps2000pg.en...
  • Page 38 We recommend using an initial value of 15,000 samples. Returns non-zero: if streaming has been enabled correctly. 0: if a problem occurred or a value was out of range. ps2000pg.en Copyright © 2006-2011 Pico Technology Ltd. All rights reserved.
  • Page 39 1 if is non-null, nConditions: conditions otherwise 0. Returns 0: if unsuccessful, or if one or more of the arguments are out of range. non-zero: if successful. Copyright © 2006-2011 Pico Technology Ltd. All rights reserved. ps2000pg.en...
  • Page 40 Therefore you may define CONDITION_TRUE for only one of these channels at a time. You can, optionally, set CONDITION_FALSE up the pulse width qualifier in combination with one of the input channels. ps2000pg.en Copyright © 2006-2011 Pico Technology Ltd. All rights reserved.
  • Page 41 ENTER for window triggers: entering the window EXIT for window triggers: leaving the window ENTER_OR_EXIT for window triggers: either entering or leaving the window NONE no trigger Copyright © 2006-2011 Pico Technology Ltd. All rights reserved. ps2000pg.en...
  • Page 42 If this is set to zero, the oscilloscope will wait indefinitely for a trigger. Returns 0: if unsuccessful, or if one or more of the arguments are out of range. non-zero: if successful. ps2000pg.en Copyright © 2006-2011 Pico Technology Ltd. All rights reserved.
  • Page 43 It is scaled in 16-bit counts. the channel to which the properties apply. channel: either a level or window trigger. Use one of these thresholdMode: constants: LEVEL (0) WINDOW (1) Copyright © 2006-2011 Pico Technology Ltd. All rights reserved. ps2000pg.en...
  • Page 44 -50% means that it is in the middle of the block. Returns 0: if unsuccessful, or if one or more of the arguments are out of range. non-zero: if successful. ps2000pg.en Copyright © 2006-2011 Pico Technology Ltd. All rights reserved.
  • Page 45 PS2000_20MV ±20 mV PS2000_50MV ±50 mV PS2000_100MV ±100 mV PS2000_200MV ±200 mV PS2000_500MV ±500 mV PS2000_1V ±1 V PS2000_2V ±2 V PS2000_5V ±5 V PS2000_10V ±10 V PS2000_20V ±20 V Copyright © 2006-2011 Pico Technology Ltd. All rights reserved. ps2000pg.en...
  • Page 46 2 ns. Returns The effective sample time in picoseconds, if ETS is enabled. 0: if ETS is disabled or one of the parameters is out of range. ps2000pg.en Copyright © 2006-2011 Pico Technology Ltd. All rights reserved.
  • Page 47 : light off 1: light on Returns 0: the function failed, for example if a PicoScope 2000 Series oscilloscope was not found. non-zero: success. Copyright © 2006-2011 Pico Technology Ltd. All rights reserved. ps2000pg.en...
  • Page 48 3: off 1: red 2: green Returns 0: the function failed, for example if a PicoScope 2000 Series oscilloscope was not found. non-zero: success. ps2000pg.en Copyright © 2006-2011 Pico Technology Ltd. All rights reserved.
  • Page 49 PW_TYPE_OUT_OF_RANGE pulse width not between lower and upper Returns 0: if unsuccessful, or if one or more of the arguments are out of range. non-zero: if successful. Copyright © 2006-2011 Pico Technology Ltd. All rights reserved. ps2000pg.en...
  • Page 50 Choose from these constants: CONDITION_DONT_CARE (0) CONDITION_TRUE (1) CONDITION_FALSE (2) not used channelC, channelD: not used external: ps2000pg.en Copyright © 2006-2011 Pico Technology Ltd. All rights reserved.
  • Page 51 It is also possible to sweep the frequency by continually modifying the delta phase. This is done by setting up a "delta phase increment" which is added to the delta phase at specified intervals. Copyright © 2006-2011 Pico Technology Ltd. All rights reserved. ps2000pg.en...
  • Page 52 Returns 0: if one of the parameters is out of range. non-zero: if successful. ps2000pg.en Copyright © 2006-2011 Pico Technology Ltd. All rights reserved.
  • Page 53 Use one of these values of the enumerated type enPS2000SweepType: PS2000_UP PS2000_DOWN PS2000_UPDOWN PS2000_DOWNUP the number of times to sweep the frequency sweeps: Returns 0: if one of the parameters is out of range. non-zero: if successful. Copyright © 2006-2011 Pico Technology Ltd. All rights reserved. ps2000pg.en...
  • Page 54 Technical information values waveType PS2000_SINE sine wave PS2000_SQUARE square wave PS2000_TRIANGLE triangle wave PS2000_RAMP_UP rising sawtooth PS2000_RAMP_DOWN falling sawtooth PS2000_DC_VOLTAGE DC voltage ps2000pg.en Copyright © 2006-2011 Pico Technology Ltd. All rights reserved.
  • Page 55 If this is set to zero the oscilloscope will wait for a trigger indefinitely. Returns 0: if one of the parameters is out of range. non-zero: if successful. Copyright © 2006-2011 Pico Technology Ltd. All rights reserved. ps2000pg.en...
  • Page 56 If this is set to zero the oscilloscope will wait for a trigger indefinitely. Returns 0: if one of the parameters is out of range. non-zero: if successful. ps2000pg.en Copyright © 2006-2011 Pico Technology Ltd. All rights reserved.
  • Page 57 Applicability All modes. Arguments the handle of the required oscilloscope. handle, Returns 0: if an invalid handle is passed. non-zero: if successful. Copyright © 2006-2011 Pico Technology Ltd. All rights reserved. ps2000pg.en...
  • Page 58: Ps2000_Run_Streaming

    Any non-zero value signifies triggeredAt TRUE a Boolean indicating whether streaming data capture auto_stop, has automatically stopped. Any non-zero value signifies TRUE the number of values in each overview buffer. nValues, Returns nothing ps2000pg.en Copyright © 2006-2011 Pico Technology Ltd. All rights reserved.
  • Page 59 The oscilloscope is not responding to commands from the PC. PS2000_CONFIG_FAIL The configuration information in the oscilloscope has become corrupt or is missing. PS2000_OS_NOT_SUPPORTED The operating system is not supported by this driver. Copyright © 2006-2011 Pico Technology Ltd. All rights reserved. ps2000pg.en...
  • Page 60 Use DC mode for measuring absolute voltage levels. Set the coupling mode using ps2000_set_channel(). Driver. A piece of software that controls a hardware device. The driver for the PicoScope 2000 Series PC Oscilloscopes is supplied in the form of a 32-bit Windows DLL, which contains functions that you can call from your application.
  • Page 61 PicoScope 2000 Series Programmer's Guide PicoScope 2000 Series. A range of low-cost PC Oscilloscopes that includes the PicoScope 2202, 2203, 2204 and 2205 two-channel oscilloscopes and the PicoScope 2104 and 2105 handheld oscilloscopes. PicoScope software. This is an application that accompanies all our PC Oscilloscopes.
  • Page 63 Example code Agilent VEE Dephi Headlight Excel High-precision scopes LabView Visual Basic Excel macros Illuminated button External trigger 5, 51, 52 Input connector Installation Fast streaming mode Functions LabView driver my_get_overview_buffers Copyright © 2006-2011 Pico Technology Ltd. All rights reserved. ps2000pg.en...
  • Page 64 PS2000_PWQ_CONDITIONS structure PS2000_THRESHOLD_DIRECTION constants PS2000_TRIGGER_CHANNEL_PROPERTIES structure PS2000_TRIGGER_CONDITIONS structure Resolution, vertical Sampling modes Sampling rate Signal generator 5, 7 arbitrary waveforms built-in waveforms Spectrum analyser Stopping sampling Streaming mode compatible fast normal ps2000pg.en Copyright © 2006-2011 Pico Technology Ltd. All rights reserved.
  • Page 65 PicoScope 2000 Series Programmer's Guide Copyright © 2006-2011 Pico Technology Ltd. All rights reserved. ps2000pg.en...
  • Page 66 Pico Technology James House 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 ps2000pg.en-4 13.4.11 Copyright © 2006-2011 Pico Technology Ltd. All rights reserved.

Table of Contents