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-12

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-12...
  • Page 3: Table Of Contents

    8 ps2000_get_unit_info ........................28 9 ps2000_get_values ........................... 29 10 ps2000_last_button_press ......................30 11 ps2000_open_unit .......................... 31 12 ps2000_open_unit_async ....................... 32 13 ps2000_open_unit_progress ......................33 14 ps2000_overview_buffer_status ....................34 15 ps2000PingUnit ..........................35 ps2000pg.en-12 Copyright © 2006–2022 Pico Technology Ltd. All rights reserved.
  • Page 4 32 ps2000_set_trigger2 ........................57 33 ps2000_stop ........................... 58 34 my_get_overview_buffers ......................59 6 Programming examples ..................61 7 Driver error codes ....................62 8 Glossary ........................63 Index .......................... 65 ps2000pg.en-12 Copyright © 2006–2022 Pico Technology Ltd. All rights reserved.
  • Page 5: Introduction

    Software and Reference CD-ROM and for free download from www.picotech.com/downloads. Minimum system requirements To ensure that your PicoScope 2000 Series PC Oscilloscope operates correctly, you must have a computer with at least the minimum system requirements to run one of the supported operating systems, as shown in the following table.
  • Page 6: Legal Information

    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 Technology products or with data collected using Pico Technology products.
  • Page 7: Trademarks

    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, willful damage, negligence, abnormal working conditions or failure to follow Pico Technology's spoken or written advice on the storage, installation, commissioning, use or maintenance of the Goods or (if no advice has been given) good trade practice;...
  • Page 8: Programming The 2000 Series Oscilloscopes

    -32 768 8000 Indicates a buffer overrun in fast streaming PS2000_LOST_DATA mode. -32 767 8001 Negative full scale PS2000_MIN_VALUE 0000 Zero volts 32 767 7FFF Positive full scale PS2000_MAX_VALUE ps2000pg.en-12 Copyright © 2006–2022 Pico Technology Ltd. All rights reserved.
  • Page 9: Triggering

    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 the function or, for scopes that support advanced triggering, the ps2000_set_trigger and related functions.
  • Page 10: Oversampling

    Increase in resolution (bits) = (log oversample) / (log 4) Applicability Available in block mode only. ps2000pg.en-12 Copyright © 2006–2022 Pico Technology Ltd. All rights reserved.
  • Page 11: Sampling Modes

    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 11. Close the device using ps2000_close_unit Note that if you call ps2000_get_values ps2000_get_times_and_values before the oscilloscope is ready, no capture will be available and the driver will ps2000_stop not return any samples. ps2000pg.en-12 Copyright © 2006–2022 Pico Technology Ltd. All rights reserved.
  • Page 13: Streaming Mode

    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 ps2000pg.en-12 Copyright © 2006–2022 Pico Technology Ltd. All rights reserved.
  • Page 14: Fast Streaming Mode

    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-12 Copyright © 2006–2022 Pico Technology Ltd. All rights reserved.
  • Page 15: Ets (Equivalent Time Sampling) Mode

    Close the device using ps2000_close_unit Note that if you call ps2000_get_values ps2000_get_times_and_values before the oscilloscope is ready, no capture will be available and the driver will ps2000_stop not return any samples. ps2000pg.en-12 Copyright © 2006–2022 Pico Technology Ltd. All rights reserved.
  • Page 16: Combining Several Oscilloscopes

    Combining several oscilloscopes Combining several oscilloscopes The 2000 Series driver can collect data from up to 64 PicoScope 2000 Series PC oscilloscopes at the same time. Each oscilloscope must be connected to a separate USB port. If you use a USB hub, make sure it is a powered hub.
  • Page 17: Api Functions

    PicoScope 2000 Series Programmer's Guide API Functions API Functions 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...
  • Page 18: Ps2000_Close_Unit

    All modes Arguments : the handle, returned by , of the oscilloscope handle ps2000_open_unit being closed Returns non-zero: if a valid handle is passed 0: if handle is not valid ps2000pg.en-12 Copyright © 2006–2022 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 ps2000pg.en-12...
  • 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-12 Copyright © 2006–2022 Pico Technology Ltd. All rights reserved.
  • Page 21: Ps2000_Get_Streaming_Values

    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. ps2000pg.en-12 Copyright © 2006–2022 Pico Technology Ltd. All rights reserved.
  • Page 22 Returns The number of values written to each buffer, if successful 0: if a parameter was out of range ps2000pg.en-12 Copyright © 2006–2022 Pico Technology Ltd. All rights reserved.
  • Page 23: Ps2000_Get_Streaming_Values_No_Aggregation

    . The special value is stored in the buffer when data PS2000_MAX_VALUE PS2000_LOST_DATA could not be collected because of a buffer overrun. (See Voltage ranges for more details of data values.) ps2000pg.en-12 Copyright © 2006–2022 Pico Technology Ltd. All rights reserved.
  • Page 24 : the number of values required no_of_values Returns The number of values written to each buffer, if successful 0: if a parameter was out of range ps2000pg.en-12 Copyright © 2006–2022 Pico Technology Ltd. All rights reserved.
  • Page 25: Ps2000_Get_Timebase

    If max_samples NULL the function will write nothing. Returns non-zero: if all parameters are in range 0: on error ps2000pg.en-12 Copyright © 2006–2022 Pico Technology Ltd. All rights reserved.
  • Page 26: Ps2000_Get_Times_And_Values

    Note that if you are using block mode or ETS mode and call this function before the oscilloscope is ready, no capture will be available and the driver will not return any samples. ps2000pg.en-12 Copyright © 2006–2022 Pico Technology Ltd. All rights reserved.
  • Page 27 0: if one or more of the parameters are out of range, if the times will overflow with the time_units requested (use ps2000_get_timebase acquire the most suitable time_units) or if the oscilloscope is in streaming mode ps2000pg.en-12 Copyright © 2006–2022 Pico Technology Ltd. All rights reserved.
  • Page 28: Ps2000_Get_Unit_Info

    PS2000_BATCH_AND_SERIAL (4), the oscilloscope. the calibration date of the oscilloscope. "14Jan08" PS2000_CAL_DATE (5), one of the Error codes. "4" PS2000_ERROR_CODE (6), the version number of the "1,1,2,4" PS2000_KERNEL_DRIVER_VERSION (7), kernel driver. ps2000pg.en-12 Copyright © 2006–2022 Pico Technology Ltd. All rights reserved.
  • Page 29: Ps2000_Get_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 ps2000pg.en-12 Copyright © 2006–2022 Pico Technology Ltd. All rights reserved.
  • Page 30: Ps2000_Last_Button_Press

    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-12 Copyright © 2006–2022 Pico Technology Ltd. All rights reserved.
  • Page 31: Ps2000_Open_Unit

    PicoScope 2000 Series Programmer's Guide API Functions 5.11 ps2000_open_unit int16_t 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 0: if no oscilloscope is found >0 (oscilloscope handle): if the oscilloscope opened.
  • Page 32: Ps2000_Open_Unit_Async

    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 until that function returns a non-zero value and a valid ps2000_open_unit_progress oscilloscope handle.
  • Page 33: Ps2000_Open_Unit_Progress

    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 ps2000pg.en-12 Copyright © 2006–2022 Pico Technology Ltd. All rights reserved.
  • Page 34: Ps2000_Overview_Buffer_Status

    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-12 Copyright © 2006–2022 Pico Technology Ltd. All rights reserved.
  • Page 35: Ps2000Pingunit

    Applicability All modes Arguments : the handle of the required device handle Returns 0 if function fails: call ps2000_get_unit_info for further information Any non-zero value: communication successful ps2000pg.en-12 Copyright © 2006–2022 Pico Technology Ltd. All rights reserved.
  • Page 36: Ps2000_Ready

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

    I/O requests. Returns 0: if one of the parameters is out of range non-zero: if successful ps2000pg.en-12 Copyright © 2006–2022 Pico Technology Ltd. All rights reserved.
  • Page 38: Ps2000_Run_Streaming

    Returns non-zero: if streaming has been enabled correctly : if a problem occurred or a value was out of range ps2000pg.en-12 Copyright © 2006–2022 Pico Technology Ltd. All rights reserved.
  • Page 39: Ps2000_Run_Streaming_Ns

    The maximum allowable value is 1,000,000. 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-12 Copyright © 2006–2022 Pico Technology Ltd. All rights reserved.
  • Page 40: Ps2000Setadvtriggerchannelconditions

    : should be set to 1 if is non-null, otherwise 0 nConditions conditions Returns 0: if unsuccessful, or if one or more of the arguments are out of range non-zero: if successful ps2000pg.en-12 Copyright © 2006–2022 Pico Technology Ltd. All rights reserved.
  • Page 41: 5.20.1 Ps2000_Trigger_Conditions Structure

    The PicoScope 2204, 2204A, 2205 and 2205A models can all trigger from both channel A and channel B, and therefore all support logic triggering. ps2000pg.en-12 Copyright © 2006–2022 Pico Technology Ltd. All rights reserved.
  • Page 42: Ps2000Setadvtriggerchanneldirections

    PS2000_OUTSIDE for window triggers: entering the window PS2000_ENTER PS2000_EXIT for window triggers: leaving the window PS2000_ENTER_OR_EXIT for window triggers: either entering or leaving the window no trigger PS2000_ADV_NONE ps2000pg.en-12 Copyright © 2006–2022 Pico Technology Ltd. All rights reserved.
  • Page 43: Ps2000Setadvtriggerchannelproperties

    Returns 0: if unsuccessful, or if one or more of the arguments are out of range non-zero: if successful ps2000pg.en-12 Copyright © 2006–2022 Pico Technology Ltd. All rights reserved.
  • Page 44: 5.22.1 Ps2000_Trigger_Channel_Properties Structure

    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) ps2000pg.en-12 Copyright © 2006–2022 Pico Technology Ltd. All rights reserved.
  • Page 45: Ps2000Setadvtriggerdelay

    0: if unsuccessful, or if one or more of the arguments are out of range non-zero: if successful Example 1: Example 2: = 0, = 1 ms, delay delay = –50% = –50% preTriggerDelay preTriggerDelay ps2000pg.en-12 Copyright © 2006–2022 Pico Technology Ltd. All rights reserved.
  • Page 46: Ps2000_Set_Channel

    ±20 mV PS2000_20MV ±50 mV PS2000_50MV ±100 mV PS2000_100MV ±200 mV PS2000_200MV ±500 mV PS2000_500MV ±1 V PS2000_1V ±2 V PS2000_2V ±5 V PS2000_5V ±10 V PS2000_10V ±20 V PS2000_20V ps2000pg.en-12 Copyright © 2006–2022 Pico Technology Ltd. All rights reserved.
  • Page 47: Ps2000_Set_Ets

    20 ns and the interleave 10, the approximate time per sample will be 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-12 Copyright © 2006–2022 Pico Technology Ltd. All rights reserved.
  • Page 48: Ps2000_Set_Light

    : handle of the oscilloscope handle state : light off 1: light on Returns 0: the function failed, for example if a PicoScope 2000 Series oscilloscope was not found non-zero: success ps2000pg.en-12 Copyright © 2006–2022 Pico Technology Ltd. All rights reserved.
  • Page 49: Ps2000_Set_Led

    : handle of the oscilloscope handle state 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-12 Copyright © 2006–2022 Pico Technology Ltd. All rights reserved.
  • Page 50: Ps2000Setpulsewidthqualifier

    PW_TYPE_OUT_OF_RANGE Returns 0: if unsuccessful, or if one or more of the arguments are out of range non-zero: if successful ps2000pg.en-12 Copyright © 2006–2022 Pico Technology Ltd. All rights reserved.
  • Page 51: 5.28.1 Ps2000_Pwq_Conditions Structure

    : the type of condition that should be applied to channelA, channelB each channel. Choose from these constants: CONDITION_DONT_CARE (0) CONDITION_TRUE (1) CONDITION_FALSE (2) : not used channelC, channelD, external ps2000pg.en-12 Copyright © 2006–2022 Pico Technology Ltd. All rights reserved.
  • Page 52: Ps2000_Set_Sig_Gen_Arbitrary

    It is also possible to sweep the frequency by continually modifying the deltaPhase. This is done by setting up a that the oscilloscope adds to the deltaPhase at deltaPhaseIncrement intervals specified by dwellCount ps2000pg.en-12 Copyright © 2006–2022 Pico Technology Ltd. All rights reserved.
  • Page 53 : the number of times to sweep the frequency after a trigger event, according to sweeps sweepType Returns 0: if one of the parameters is out of range non-zero: if successful ps2000pg.en-12 Copyright © 2006–2022 Pico Technology Ltd. All rights reserved.
  • Page 54: Ps2000_Set_Sig_Gen_Built_In

    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 ps2000pg.en-12 Copyright © 2006–2022 Pico Technology Ltd. All rights reserved.
  • Page 55 API Functions values waveType PS2000_SINE sine wave square wave PS2000_SQUARE triangle wave PS2000_TRIANGLE rising sawtooth PS2000_RAMPUP PS2000_RAMPDOWN falling sawtooth PS2000_DC_VOLTAGE DC voltage PS2000_GAUSSIAN Gaussian sin(x)/x PS2000_SINC half (full-wave rectified) sine PS2000_HALF_SINE ps2000pg.en-12 Copyright © 2006–2022 Pico Technology Ltd. All rights reserved.
  • Page 56: Ps2000_Set_Trigger

    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-12 Copyright © 2006–2022 Pico Technology Ltd. All rights reserved.
  • Page 57: Ps2000_Set_Trigger2

    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-12 Copyright © 2006–2022 Pico Technology Ltd. All rights reserved.
  • Page 58: Ps2000_Stop

    Applicability All modes Arguments : the handle of the required oscilloscope handle Returns 0: if an invalid handle is passed non-zero: if successful ps2000pg.en-12 Copyright © 2006–2022 Pico Technology Ltd. All rights reserved.
  • Page 59: My_Get_Overview_Buffers

    For an example of a suitable callback function, see the programming examples included in the Pico Technology SDK. ps2000pg.en-12 Copyright © 2006–2022 Pico Technology Ltd. All rights reserved.
  • Page 60 TRUE : a Boolean indicating whether streaming data capture has auto_stop automatically stopped. Any non-zero value signifies TRUE : the number of values in each overview buffer nValues Returns nothing ps2000pg.en-12 Copyright © 2006–2022 Pico Technology Ltd. All rights reserved.
  • Page 61: Programming Examples

    PicoScope 2000 Series Programmer's Guide Programming examples Programming examples Your SDK installation includes programming examples in several languages and development environments. Please refer to the SDK for details. ps2000pg.en-12 Copyright © 2006–2022 Pico Technology Ltd. All rights reserved.
  • Page 62: Driver Error Codes

    The oscilloscope is not responding to commands PS2000_NOT_RESPONDING from the PC. PS2000_CONFIG_FAIL The configuration information in the oscilloscope has become corrupt or is missing. The operating system is not supported by this PS2000_OS_NOT_SUPPORTED driver. ps2000pg.en-12 Copyright © 2006–2022 Pico Technology Ltd. All rights reserved.
  • Page 63: Glossary

    Overview buffer. A buffer in the PC's memory in which the PicoScope 2000 Series driver temporarily stores data on its way from the oscilloscope to the application's buffer.
  • Page 64 Vertical resolution. A value, in bits, that indicates the number of input voltage levels that the oscilloscope can distinguish. Calculation techniques can improve the effective resolution. Voltage range. The range of input voltages that the oscilloscope will measure in a given mode. ps2000pg.en-12 Copyright © 2006–2022 Pico Technology Ltd. All rights reserved.
  • Page 65: Index

    Maximum sampling rate 63 Memory in scope 11 Fast streaming mode 14 Multi-unit operation 16 using 14 Functions 17 my_get_overview_buffers 59 ps2000_close_unit 18 Normal mode 13 ps2000_flash_led 19 ps2000_get_streaming_last_values 20 ps2000pg.en-12 Copyright © 2006–2022 Pico Technology Ltd. All rights reserved.
  • Page 66 13 fast 14 normal 13 windowed 13 Sweep 9 System requirements, minimum 5 Threshold voltage 9 Time interval 10, 15 Timebase 25, 37, 64 Trademarks 7 Trigger delay 45 ps2000pg.en-12 Copyright © 2006–2022 Pico Technology Ltd. All rights reserved.
  • Page 68 United States of America 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 pico.asia-pacific@picotech.com support@picotech.com support@picotech.com www.picotech.com ps2000pg.en-12 Copyright © 2006–2022 Pico Technology Ltd. All rights reserved.

Table of Contents