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 r11
Copyright © 2006–2016 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 r11 Copyright © 2006–2016 Pico Technology Ltd. All rights reserved.
  • Page 2: Table Of Contents

    10 ps2000_last_button_press ....................... 26 11 ps2000_open_unit .......................... 27 12 ps2000_open_unit_async ........................ 28 13 ps2000_open_unit_progress ......................29 14 ps2000_overview_buffer_status ....................... 30 15 ps2000PingUnit ..........................31 16 ps2000_ready ..........................32 17 ps2000_run_block .......................... 33 Copyright © 2006–2016 Pico Technology Ltd. All rights reserved. ps2000pg.en r11...
  • Page 3 32 ps2000_set_trigger2 ........................53 33 ps2000_stop ........................... 54 34 my_get_overview_buffers ........................ 55 6 Programming examples ......................57 7 Driver error codes ........................58 8 Glossary ............................ 59 Index ............................61 ps2000pg.en r11 Copyright © 2006–2016 Pico Technology Ltd. All rights reserved.
  • Page 4: Introduction

    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. The performance of the oscilloscope will be better with a more powerful PC, and will benefit from a multi- core processor.
  • Page 5: 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 6: 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...
  • Page 7: Programming The 2000 Series Oscilloscopes

    Programming the 2000 Series Oscilloscopes General procedure library in your PicoScope installation directory allows you to program ps2000.dll a PicoScope 2000 Series oscilloscope using standard C function calls. A typical program for capturing data consists of the following steps: Open the oscilloscope.
  • Page 8: 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 function or, for scopes that support advanced triggering, ps2000_set_trigger and related functions.
  • Page 9: Oversampling

    Increase in resolution (bits) = (log oversample) / (log 4) Applicability Available in block mode only. ps2000pg.en r11 Copyright © 2006–2016 Pico Technology Ltd. All rights reserved.
  • Page 10: 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 11: Streaming Mode

    Only recommended for use with PicoScope 2104 and 2105. Does not support triggering. function always returns ps2000_get_times_and_values FALSE (0) in streaming mode. Using compatible streaming mode for programming details. ps2000pg.en r11 Copyright © 2006–2016 Pico Technology Ltd. All rights reserved.
  • Page 12: 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 r11 Copyright © 2006–2016 Pico Technology Ltd. All rights reserved.
  • Page 13: 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 ps2000_stop driver will not return any samples. Copyright © 2006–2016 Pico Technology Ltd. All rights reserved. ps2000pg.en r11...
  • Page 14: 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 15: Api Functions

    PicoScope 2000 Series Programmer's Guide 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 ps2000PingUnit ps2000_ready...
  • Page 16: Ps2000_Close_Unit

    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 r11...
  • Page 17: Ps2000_Get_Streaming_Last_Values

    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 18: 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. Copyright © 2006–2016 Pico Technology Ltd. All rights reserved. ps2000pg.en r11...
  • Page 19 Returns The number of values written to each buffer, if successful 0: if a parameter was out of range ps2000pg.en r11 Copyright © 2006–2016 Pico Technology Ltd. All rights reserved.
  • Page 20 . 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 Voltage ranges for more details of data values.) Copyright © 2006–2016 Pico Technology Ltd. All rights reserved. ps2000pg.en r11...
  • Page 21 : 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 r11 Copyright © 2006–2016 Pico Technology Ltd. All rights reserved.
  • Page 22 If , the function will write nothing. max_samples NULL Returns non-zero: if all parameters are in range 0: on error Copyright © 2006–2016 Pico Technology Ltd. All rights reserved. ps2000pg.en r11...
  • Page 23 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 r11 Copyright © 2006–2016 Pico Technology Ltd. All rights reserved.
  • Page 24: Ps2000_Get_Timebase

    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 to acquire the most suitable time_units) or if the oscilloscope is in streaming mode Copyright © 2006–2016 Pico Technology Ltd. All rights reserved. ps2000pg.en r11...
  • Page 25 "14Jan08" PS2000_CAL_DATE (5), oscilloscope. one of the Error codes. "4" PS2000_ERROR_CODE (6), "1,1,2,4" the version PS2000_KERNEL_DRIVER_VERSION (7), number of the kernel driver. ps2000pg.en r11 Copyright © 2006–2016 Pico Technology Ltd. All rights reserved.
  • Page 26: 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–2016 Pico Technology Ltd. All rights reserved. ps2000pg.en r11...
  • Page 27: Ps2000_Last_Button_Press

    0: no button press registered 1: short button press registered 2: long button press registered 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...
  • Page 28 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 Copyright © 2006–2016 Pico Technology Ltd. All rights reserved. ps2000pg.en r11...
  • Page 29: Ps2000Pingunit

    -1: if the oscilloscope is not attached. The USB transfer failed, indicating that the oscilloscope may have been unplugged. Copyright © 2006–2016 Pico Technology Ltd. All rights reserved. ps2000pg.en r11...
  • Page 30: 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 Copyright © 2006–2016 Pico Technology Ltd. All rights reserved. ps2000pg.en r11...
  • Page 31 Returns non-zero: if streaming has been enabled correctly : if a problem occurred or a value was out of range ps2000pg.en r11 Copyright © 2006–2016 Pico Technology Ltd. All rights reserved.
  • Page 32 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 Copyright © 2006–2016 Pico Technology Ltd. All rights reserved. ps2000pg.en r11...
  • Page 33: Ps2000Setadvtriggerchannelconditions

    : should be set to 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 ps2000pg.en r11 Copyright © 2006–2016 Pico Technology Ltd. All rights reserved.
  • Page 34 The PicoScope 2204, 2204A, 2205 and 2205A models can all trigger from both channel A and channel B, and therefore all support logic triggering. Copyright © 2006–2016 Pico Technology Ltd. All rights reserved. ps2000pg.en r11...
  • Page 35: Ps2000Setadvtriggerchanneldirections

    PS2000_ENTER for window triggers: entering the window PS2000_EXIT for window triggers: leaving the window PS2000_ENTER_OR_EXIT for window triggers: either entering or leaving the window PS2000_ADV_NONE no trigger ps2000pg.en r11 Copyright © 2006–2016 Pico Technology Ltd. All rights reserved.
  • Page 36: Ps2000Setadvtriggerchannelproperties

    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 Copyright © 2006–2016 Pico Technology Ltd. All rights reserved. ps2000pg.en r11...
  • Page 37: 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 r11 Copyright © 2006–2016 Pico Technology Ltd. All rights reserved.
  • Page 38: 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 Copyright © 2006–2016 Pico Technology Ltd. All rights reserved. ps2000pg.en r11...
  • Page 39: Ps2000_Set_Channel

    ±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 ps2000pg.en r11 Copyright © 2006–2016 Pico Technology Ltd. All rights reserved.
  • Page 40: Ps2000_Set_Ets

    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 Copyright © 2006–2016 Pico Technology Ltd. All rights reserved. ps2000pg.en r11...
  • Page 41: Ps2000_Set_Light

    PicoScope 2104 and 2105 handheld oscilloscopes only Arguments : 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 5.27 ps2000_set_led int16_t ps2000_set_led int16_t handle,...
  • Page 42: Ps2000Setpulsewidthqualifier

    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 ps2000pg.en r11 Copyright © 2006–2016 Pico Technology Ltd. All rights reserved.
  • Page 43: 5.28.1 Ps2000_Pwq_Conditions Structure

    : the type of condition that should be applied channelA, channelB to each channel. Choose from these constants: CONDITION_DONT_CARE (0) CONDITION_TRUE (1) CONDITION_FALSE (2) : not used channelC, channelD, external Copyright © 2006–2016 Pico Technology Ltd. All rights reserved. ps2000pg.en r11...
  • Page 44: 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 deltaPhaseIncrement deltaPhase at intervals specified by dwellCount ps2000pg.en r11 Copyright © 2006–2016 Pico Technology Ltd. All rights reserved.
  • Page 45 : the number of times to sweep the frequency after a trigger event, according sweeps sweepType Returns 0: if one of the parameters is out of range non-zero: if successful Copyright © 2006–2016 Pico Technology Ltd. All rights reserved. ps2000pg.en r11...
  • Page 46: 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 r11 Copyright © 2006–2016 Pico Technology Ltd. All rights reserved.
  • Page 47: 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 Copyright © 2006–2016 Pico Technology Ltd. All rights reserved. ps2000pg.en r11...
  • Page 48: 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 Copyright © 2006–2016 Pico Technology Ltd. All rights reserved. ps2000pg.en r11...
  • Page 49: Ps2000_Stop

    For an example of a suitable callback function, see the programming examples included in the Pico Technology SDK. ps2000pg.en r11 Copyright © 2006–2016 Pico Technology Ltd. All rights reserved.
  • Page 50 : 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 r11 Copyright © 2006–2016 Pico Technology Ltd. All rights reserved.
  • Page 51: Programming Examples

    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–2016 Pico Technology Ltd. All rights reserved. ps2000pg.en r11...
  • Page 52: Glossary

    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 53 Glossary 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 54: Index

    15, 45 43, 59 License conditions mode Light mode, using Maximum sampling rate Fast streaming mode Memory in scope using Multi-unit operation Functions my_get_overview_buffers ps2000_close_unit Normal mode ps2000_flash_led ps2000_get_streaming_last_values Copyright © 2006–2016 Pico Technology Ltd. All rights reserved. ps2000pg.en r11...
  • Page 55 Real-time continuous mode Resolution, vertical Sampling modes Sampling rate Signal generator 5, 5, 7 arbitrary waveforms built-in waveforms Stopping sampling Streaming mode 7, 9, 60 compatible fast normal windowed ps2000pg.en r11 Copyright © 2006–2016 Pico Technology Ltd. All rights reserved.

Table of Contents