The PicoScope 3000 A and B Series Oscilloscopes and MSOs from Pico Technology are a range of high-specification, real-tim e m easuring instrum ents that connect to the USB port of your com puter. The series covers various options of portability, deep m em ory, fast sam pling rates and high bandwidth, m aking it a highly versatile range that suits a wide range of applications.
Pico products. You m ay copy and distribute the SDK without restriction, as long as you do not rem ove any Pico Technology copyright statem ents. The exam ple program s in the SDK m ay be m odified, copied and distributed for the purpose of developing program s to collect data using Pico products.
PicoScope 3000A Series Prog rammer's Guide Company details You can obtain technical assistance from Pico Technology at the following address: Address: Pico Technology Jam es House Colm worth Business Park St Neots Cam bridgeshire PE19 8YP United Kingdom Phone: + 44 (0) 1480 396 395...
Prog ramming the 3000A Series oscilloscopes Programming the 3000A Series oscilloscopes In this m anual we shall refer to the PicoScope 3000 A, B and MSO m odels collectively as the PicoScope 3000A Series. The API for controlling these scopes is called the PicoScope 3000A API.
PicoScope 3000A Series Prog rammer's Guide Minimum PC requirements To ensure that your PicoScope 3000A Series oscilloscope operates correctly, you m ust have a com puter with at least the m inim um system requirem ents to run one of the supported operating system s, as shown in the following table.
Prog ramming the 3000A Series oscilloscopes Triggering PicoScope 3000A Series oscilloscopes can either start collecting data im m ediately, or be program m ed to wait for a trigger event to occur. In both cases you need to use the trigger function which in turn calls ps3000aSetSimpleTrigger, ps3000aSetTriggerChannelConditions...
PicoScope 3000A Series Prog rammer's Guide Sampling modes PicoScope 3000A Series oscilloscopes can run in various sampling modes. Block mode. In this m ode, the scope stores data in internal RAM and then transfers it to the PC. When the data has been collected it is possible to exam ine the data, with an optional downsam pling factor.
Prog ramming the 3000A Series oscilloscopes 2.7.1 Block mode In block mode, the com puter prom pts a PicoScope 3000A Series oscilloscope to collect a block of data into its internal m em ory. When the oscilloscope has collected the whole block, it signals that it is ready and then transfers the whole block to the com puter's m em ory through the USB port.
Page 15
PicoScope 3000A Series Prog rammer's Guide 2.7.1.1 Using block mode This is the general procedure for reading and displaying data in block m ode using a single m em ory segm ent: Open the oscilloscope using ps3000aOpenUnit. Select channel ranges and AC/DC coupling using ps3000aSetChannel.
Prog ramming the 3000A Series oscilloscopes 2.7.2 Rapid block mode In norm al block m ode, the PicoScope 3000A Series scopes collect one waveform at a tim e. You start the the device running, wait until all sam ples are collected by the device, and then download the data to the PC or start another run.
Page 17
PicoScope 3000A Series Prog rammer's Guide 2.7.2.2 Rapid block mode example 1: no aggregation #define MAX_SAMPLES 1000 Set up the device up as usual. Open the device Channels Trigger Num ber of m em ory segm ents (this should be equal or m ore than the num ber of captures required) // set the number of waveforms to 100 ps3000aSetNoOfCaptures (handle, 100);...
Page 18
Prog ramming the 3000A Series oscilloscopes ps3000aGetValuesBulk handle, &noOfSamples, // set to MAX_SAMPLES on entering the function // fromSegmentIndex // toSegmentIndex // downsampling ratio PS3000A_RATIO_MODE_NONE, // downsampling ratio mode overflow // an array of size 10 shorts Com m ents: the num ber of sam ples could be up to noOfPreTriggerSamples + , the values set in .
Page 19
PicoScope 3000A Series Prog rammer's Guide 2.7.2.3 Rapid block mode example 2: using aggregation #define MAX_SAMPLES 1000 Set up the device up as usual. Open the device Channels Trigger Num ber of m em ory segm ents (this should be equal or m ore than the num ber of captures required) // set the number of waveforms to 100 ps3000aSetNoOfCaptures (handle, 100);...
Page 20
Prog ramming the 3000A Series oscilloscopes ps3000aGetValues handle, &noOfSamples, // set to MAX_SAMPLES on entering 1000, &downSampleRatioMode, //set to RATIO_MODE_AGGREGATE index, overflow ps3000aGetTriggerTimeOffset64 handle, &time, &timeUnits, index Com m ents: each waveform is retrieved one at a tim e from the driver with an aggregation of 1000.
PicoScope 3000A Series Prog rammer's Guide 2.7.3 ETS (Equivalent Time Sampling) ETS is a way of increasing the effective sam pling rate of the scope when capturing repetitive signals. It is a m odified form of block m ode, and is controlled by the trigger functions and the ps3000aSetEts function.
Page 22
Prog ramming the 3000A Series oscilloscopes 2.7.3.1 Using ETS mode This is the general procedure for reading and displaying data in ETS m ode using a single m em ory segm ent: When using ETS m ode the user m ust consider if a digital port has previously been active.
PicoScope 3000A Series Prog rammer's Guide 2.7.4 Streaming mode Streaming mode can capture data without the gaps that occur between blocks when using block m ode. Stream ing m ode supports downsam pling and triggering, while providing fast stream ing at up to 31.25 MS/s (32 ns per sam ple) when one channel is active, depending on the com puter's perform ance.
PicoScope 3000A Series Prog rammer's Guide Timebases The API allows you to select any of 2 different tim ebases. The tim ebases allow slow enough sam pling in block m ode to overlap the stream ing sam ple intervals, so that you can m ake a sm ooth transition between block m ode and stream ing m ode.
Prog ramming the 3000A Series oscilloscopes PicoScope 3000 MSOs digital connector diagram The PicoScope 3000 MSOs have a digital input connector. The layout of the 20 pin IDC header plug is detailed below. The diagram is drawn as you look at the front panel of the device.
PicoScope 3000A Series Prog rammer's Guide 2.11 Combining several oscilloscopes It is possible to collect data using up to 64 PicoScope 3000A Series oscilloscopes the sam e tim e, depending on the capabilities of the PC. Each oscilloscope m ust be connected to a separate USB port.
Prog ramming the 3000A Series oscilloscopes 2.12 API functions The PicoScope 3000A API exports the following functions for you to use in your own applications. All functions are C functions using the standard call nam ing convention ). They are all exported with both decorated and undecorated nam es. An __stdcall additional set of wrapper functions...
Prog ramming the 3000A Series oscilloscopes 2.12.1 ps3000aBlockReady (callback) typedef void (CALLBACK *ps3000aBlockReady) short handle, PICO_STATUS status, void * pParameter This callback function is part of your application. You register it with the PicoScope 3000A series driver using ps3000aRunBlock, and the driver calls it back when block- m ode data is ready.
PicoScope 3000A Series Prog rammer's Guide 2.12.2 ps3000aChangePowerSource PICO_STATUS ps3000aChangePowerSource short handle, PICO_STATUS powerstate This function selects the power supply m ode. You m ust call this function if any of the following conditions arises: USB power is required the AC power adapter is connected or disconnected during use a USB 3.0 scope is plugged into a USB 2.0 port (indicated if any function returns the status code) PICO_USB3_0_DEVICE_NON_USB3_0_PORT...
Prog ramming the 3000A Series oscilloscopes 2.12.3 ps3000aCurrentPowerSource PICO_STATUS ps3000aCurrentPowerSource short handle This function returns the current power state of the device. Applicability All m odes. 4-channel oscilloscopes only. Arguments the handle of the device. handle, Returns - if the device is powered by the PICO_POWER_SUPPLY_CONNECTED AC adapter.
PicoScope 3000A Series Prog rammer's Guide 2.12.4 ps3000aCloseUnit PICO_STATUS ps3000aCloseUnit short handle This function shuts down a PicoScope 3000A oscilloscope. Applicability All m odes Arguments the handle, returned by ps3000aOpenUnit, of the scope handle, device to be closed. Returns PICO_OK PICO_HANDLE_INVALID PICO_USER_CALLBACK PICO_DRIVER_FUNCTION...
Prog ramming the 3000A Series oscilloscopes 2.12.5 ps3000aDataReady (callback) typedef void (CALLBACK *ps3000aDataReady) short handle, PICO_STATUS status, unsigned long noOfSamples, short overflow, void * pParameter This is a callback function that you write to collect data from the driver. You supply a pointer to the function when you call ps3000aGetValuesAsync, and the driver calls your function back when the data is ready.
PicoScope 3000A Series Prog rammer's Guide 2.12.6 ps3000aEnumerateUnits PICO_STATUS ps3000aEnumerateUnits short * count, char * serials, short * serialLth This function counts the num ber of PicoScope 3000A units connected to the com puter, and returns a list of serial num bers as a string. Applicability All m odes Arguments...
Prog ramming the 3000A Series oscilloscopes 2.12.7 ps3000aFlashLed PICO_STATUS ps3000aFlashLed short handle, short start This function flashes the LED on the front of the scope without blocking the calling thread. Calls to ps3000aRunStream ing ps3000aRunBlock cancel any flashing started by this function. It is not possible to set the LED to be constantly illum inated, as this state is used to indicate that the scope has not been initialized.
PicoScope 3000A Series Prog rammer's Guide 2.12.8 ps3000aGetAnalogueOffset PICO_STATUS ps3000aGetAnalogueOffset short handle, PS3000A_RANGE range, PS3000A_COUPLING coupling, float * maximumVoltage, float * minimumVoltage This function is used to get the m axim um and m inim um allowable analogue offset for a specific voltage range.
Prog ramming the 3000A Series oscilloscopes 2.12.9 ps3000aGetChannelInformation PICO_STATUS ps3000aGetChannelInformation short handle, PS3000A_CHANNEL_INFO info, probe, * ranges, * length, channels This function queries which ranges are available on a scope device. Applicability All m odes Arguments the handle of the required device. handle, the type of inform ation required.
PicoScope 3000A Series Prog rammer's Guide 2.12.10 ps3000aGetMaxDownSampleRatio PICO_STATUS ps3000aGetMaxDownSampleRatio short handle, unsigned long noOfUnaggregatedSamples, unsigned long * maxDownSampleRatio, PS3000A_RATIO_MODE downSampleRatioMode, unsigned short segmentIndex This function returns the m axim um downsam pling ratio that can be used for a given num ber of sam ples in a given downsam pling m ode.
Prog ramming the 3000A Series oscilloscopes 2.12.11 ps3000aGetMaxSegments PICO_STATUS ps3000aGetMaxSegments short handle, unsigned short * maxsegments This function returns the m axim um num ber of segm ents allowed for the opened device. Refer to ps3000aMem orySegm ents for specific figures. Applicability All m odes Arguments...
PicoScope 3000A Series Prog rammer's Guide 2.12.12 ps3000aGetNoOfCaptures PICO_STATUS ps3000aGetNoOfCaptures short handle, unsigned long * nCaptures This function finds out how m any captures are available in rapid block m ode after has been called when either the collection com pleted or the ps3000aRunBlock collection of waveform s was interrupted by calling .
Prog ramming the 3000A Series oscilloscopes 2.12.13 ps3000aGetNoOfProcessedCaptures PICO_STATUS ps3000aGetNoOfProcessedCaptures short handle, unsigned long * nCaptures This function finds out how m any captures in rapid block m ode have been processed after has been called when either the collection com pleted or the ps3000aRunBlock collection of waveform s was interrupted by calling .
PicoScope 3000A Series Prog rammer's Guide 2.12.14 ps3000aGetStreamingLatestValues PICO_STATUS ps3000aGetStreamingLatestValues short handle, ps3000aStreamingReady lpPs3000AReady, void * pParameter This function instructs the driver to return the next block of values to your ps3000aStream ingReady callback function. You m ust have previously called ps3000aRunStream ing beforehand to set up stream...
Prog ramming the 3000A Series oscilloscopes 2.12.15 ps3000aGetTimebase PICO_STATUS ps3000aGetTimebase short handle, unsigned long timebase, long noSamples, long * timeIntervalNanoseconds, short oversample, long * maxSamples, unsigned short segmentIndex This function calculates the sam pling rate and m axim um num ber of sam ples for a given tim ebase under the specified conditions.
PicoScope 3000A Series Prog rammer's Guide 2.12.16 ps3000aGetTimebase2 PICO_STATUS ps3000aGetTimebase2 short handle, unsigned long timebase, long noSamples, float * timeIntervalNanoseconds, short oversample, long * maxSamples, unsigned short segmentIndex This function is an upgraded version of ps3000aGetTim ebase, and returns the tim e interval as a rather than a .
Prog ramming the 3000A Series oscilloscopes 2.12.17 ps3000aGetTriggerTimeOffset PICO_STATUS ps3000aGetTriggerTimeOffset short handle, unsigned long * timeUpper, unsigned long * timeLower, PS3000A_TIME_UNITS * timeUnits, unsigned short segmentIndex This function gets the tim e, as two 4-byte values, at which the trigger occurred. Call it after block-m ode data has been captured or when data has been retrieved from a...
PicoScope 3000A Series Prog rammer's Guide 2.12.18 ps3000aGetTriggerTimeOffset64 PICO_STATUS ps3000aGetTriggerTimeOffset64 short handle, __int64 * time, PS3000A_TIME_UNITS * timeUnits, unsigned short segmentIndex This function gets the tim e, as a single 64-bit value, at which the trigger occurred. Call it after block-m ode data has been captured or when data has been retrieved from a previous block-m ode capture.
Prog ramming the 3000A Series oscilloscopes 2.12.19 ps3000aGetUnitInfo PICO_STATUS ps3000aGetUnitInfo short handle, char * string, short stringLength, short * requiredSize, PICO_INFO info This function retrieves inform ation about the specified oscilloscope. If the device fails to open or no device is opened, only the driver version is available. Applicability All m odes Arguments...
Page 49
PicoScope 3000A Series Prog rammer's Guide Example info PICO_DRIVER_VERSION 1,0,0,1 Version num ber of PicoScope 3000A DLL PICO_USB_VERSION Type of USB connection to device: 1.1, 2.0 or 3.0 PICO_HARDWARE_VERSION Hardware version of device PICO_VARIANT_INFO 3206B Variant num ber of device PICO_BATCH_AND_SERIAL KJL87/6 Batch and serial num ber of device...
Prog ramming the 3000A Series oscilloscopes 2.12.20 ps3000aGetValues PICO_STATUS ps3000aGetValues short handle, unsigned long startIndex, unsigned long * noOfSamples, unsigned long downSampleRatio, PS3000A_RATIO_MODE downSampleRatioMode, unsigned short segmentIndex, short * overflow This function returns block-m ode data, with or without downsam pling, starting at the specified sam ple num ber.
Page 51
PicoScope 3000A Series Prog rammer's Guide Returns PICO_OK PICO_INVALID_HANDLE PICO_POWER_SUPPLY_CONNECTED PICO_POWER_SUPPLY_NOT_CONNECTED PICO_NO_SAMPLES_AVAILABLE PICO_DEVICE_SAMPLING PICO_NULL_PARAMETER PICO_SEGMENT_OUT_OF_RANGE PICO_STARTINDEX_INVALID PICO_ETS_NOT_RUNNING PICO_BUFFERS_NOT_SET PICO_INVALID_PARAMETER PICO_TOO_MANY_SAMPLES PICO_DATA_NOT_AVAILABLE PICO_STARTINDEX_INVALID PICO_INVALID_SAMPLERATIO PICO_INVALID_CALL PICO_NOT_RESPONDING PICO_MEMORY PICO_RATIO_MODE_NOT_SUPPORTED PICO_DRIVER_FUNCTION 2.12.20.1 Downsampling modes Various m ethods of data reduction, or downsampling, are possible with the PicoScope 3000A Series oscilloscopes.
Prog ramming the 3000A Series oscilloscopes 2.12.21 ps3000aGetValuesAsync PICO_STATUS ps3000aGetValuesAsync short handle, unsigned long startIndex, unsigned long noOfSamples, unsigned long downSampleRatio, PS3000A_RATIO_MODE downSampleRatioMode, unsigned short segmentIndex, void * lpDataReady, void * pParameter This function returns data either with or without downsam pling, starting at the specified sam ple num ber.
PicoScope 3000A Series Prog rammer's Guide 2.12.22 ps3000aGetValuesBulk PICO_STATUS ps3000aGetValuesBulk short handle, unsigned long * noOfSamples, unsigned short fromSegmentIndex, unsigned short toSegmentIndex, unsigned long downSampleRatio, PS3000A_RATIO_MODE downSampleRatioMode, short * overflow This function retrieves waveform s captured using rapid block m ode. The waveform s m ust have been collected sequentially and in the sam e run.
Prog ramming the 3000A Series oscilloscopes 2.12.23 ps3000aGetValuesOverlapped PICO_STATUS ps3000aGetValuesOverlapped short handle, unsigned long startIndex, unsigned long * noOfSamples, unsigned long downSampleRatio, PS3000A_RATIO_MODE downSampleRatioMode, unsigned short segmentIndex, short * overflow This function allows you to m ake a deferred data-collection request, which will later be executed, and the argum ents validated, when you call ps3000aRunBlock in block m ode.
PicoScope 3000A Series Prog rammer's Guide 2.12.24 ps3000aGetValuesOverlappedBulk PICO_STATUS ps3000aGetValuesOverlappedBulk short handle, unsigned long startIndex, unsigned long * noOfSamples, unsigned long downSampleRatio, PS3000A_RATIO_MODE downSampleRatioMode, unsigned short fromSegmentIndex, unsigned short toSegmentIndex, short * overflow This function allows you to m ake a deferred data-collection request, which will later be executed, and the argum ents validated, when you call ps3000aRunBlock in rapid block...
Prog ramming the 3000A Series oscilloscopes 2.12.25 ps3000aGetValuesTriggerTimeOffsetBulk PICO_STATUS ps3000aGetValuesTriggerTimeOffsetBulk short handle, unsigned long * timesUpper, unsigned long * timesLower, PS3000A_TIME_UNITS * timeUnits, unsigned short fromSegmentIndex, unsigned short toSegmentIndex This function retrieves the tim e offsets, as lower and upper 32-bit values, for waveform s obtained in rapid block m ode.
Page 57
PicoScope 3000A Series Prog rammer's Guide Applicability Rapid block m ode Arguments the handle of the device handle, an array of integers. On exit, the m ost significant * timesUpper, 32 bits of the tim e offset for each requested segm ent index. times will hold the tim e offset and the last...
Prog ramming the 3000A Series oscilloscopes 2.12.26 ps3000aGetValuesTriggerTimeOffsetBulk64 PICO_STATUS ps3000aGetValuesTriggerTimeOffsetBulk64 short handle, __int64 * times, PS3000A_TIME_UNITS * timeUnits, unsigned short fromSegmentIndex, unsigned short toSegmentIndex This function retrieves the 64-bit tim e offsets for waveform s captured in rapid block ode. A 32-bit version of this function, ps3000aGetValuesTriggerTim eOffsetBulk, is available...
PicoScope 3000A Series Prog rammer's Guide 2.12.27 ps3000aIsReady PICO_STATUS ps3000aIsReady short handle, short * ready This function m ay be used instead of a callback function to receive data from . To use this m ethod, pass a NULL pointer as the ps3000aRunBlock lpReady argum ent to...
Prog ramming the 3000A Series oscilloscopes 2.12.28 ps3000aIsTriggerOrPulseWidthQualifierEnabled PICO_STATUS ps3000aIsTriggerOrPulseWidthQualifierEnabled short handle, short * triggerEnabled, short * pulseWidthQualifierEnabled This function discovers whether a trigger, or pulse width triggering, is enabled. Applicability Call after setting up the trigger, and just before calling either ps3000aRunBlock ps3000aRunStream ing.
PicoScope 3000A Series Prog rammer's Guide 2.12.29 ps3000aMaximumValue PICO_STATUS ps3000aMaximumValue short handle, short * value This function returns the m axim um ADC count returned by calls to get values. Applicability All m odes Arguments the handle of the required device handle, pointer to a short, (output) set to the m axim um ADC * value,...
Applicability All m odes Arguments the handle of the required device handle, the num ber of segm ents required, from 1 to: nSegments, 16,384 PicoScope 3204A PicoScope 3404A 32,768 PicoScope 3204B PicoScope 3204 MSO PicoScope 3404B 65,535 PicoScope 3205A PicoScope 3205B...
PicoScope 3000A Series Prog rammer's Guide 2.12.31 ps3000aMinimumValue PICO_STATUS ps3000aMinimumValue short handle, short * value This function returns the m inim um ADC count returned by calls to get values. Applicability All m odes Arguments the handle of the required device handle, pointer to a short, (output) set to the m inim um ADC * value,...
Prog ramming the 3000A Series oscilloscopes 2.12.32 ps3000aNoOfStreamingValues PICO_STATUS ps3000aNoOfStreamingValues short handle, unsigned long * noOfValues This function returns the num ber of sam ples available after data collection in stream ing ode. Call it after calling ps3000aStop. Applicability Stream ing m ode Arguments the handle of the required device handle,...
PicoScope 3000A Series Prog rammer's Guide 2.12.33 ps3000aOpenUnit PICO_STATUS ps3000aOpenUnit short * handle, char * serial This function opens a PicoScope 3000A scope attached to the com puter. The m axim um num ber of units that can be opened depends on the operating system , the kernel driver and the com puter.
Prog ramming the 3000A Series oscilloscopes 2.12.34 ps3000aOpenUnitAsync PICO_STATUS ps3000aOpenUnitAsync short * status, char * serial This function opens a scope without blocking the calling thread. You can find out when it has finished by periodically calling ps3000aOpenUnitProgress until that function returns a non-zero value.
PicoScope 3000A Series Prog rammer's Guide 2.12.35 ps3000aOpenUnitProgress PICO_STATUS ps3000aOpenUnitProgress short * handle, short * progressPercent, short * complete This function checks on the progress of a request m ade to ps3000aOpenUnitAsync open a scope. Applicability Use after ps3000aOpenUnitAsync Arguments see ps3000aOpenUnit.
Prog ramming the 3000A Series oscilloscopes 2.12.36 ps3000aPingUnit PICO_STATUS ps3000aPingUnit short handle This function can be used to check that the already opened device is still connected to the USB port and com m unication is successful. Applicability All m odes Arguments , the handle of the required device handle...
PicoScope 3000A Series Prog rammer's Guide 2.12.37 ps3000aRunBlock PICO_STATUS ps3000aRunBlock short handle, long noOfPreTriggerSamples, long noOfPostTriggerSamples, unsigned long timebase, short oversample, long * timeIndisposedMs, unsigned short segmentIndex, ps3000aBlockReady lpReady, void * pParameter This function starts collecting data in block m ode.
Page 70
Prog ramming the 3000A Series oscilloscopes a void pointer that is passed to the * pParameter, callback function. The callback can use this ps3000aBlockReady pointer to return arbitrary data to the application. Returns PICO_OK PICO_POWER_SUPPLY_CONNECTED PICO_POWER_SUPPLY_NOT_CONNECTED (in overlapped m ode) PICO_BUFFERS_NOT_SET PICO_INVALID_HANDLE PICO_USER_CALLBACK...
PicoScope 3000A Series Prog rammer's Guide 2.12.38 ps3000aRunStreaming PICO_STATUS ps3000aRunStreaming short handle, unsigned long * sampleInterval, PS3000A_TIME_UNITS sampleIntervalTimeUnits, unsigned long maxPreTriggerSamples, unsigned long maxPostTriggerSamples, short autoStop, unsigned long downSampleRatio, PS3000A_RATIO_MODE downSampleRatioMode, unsigned long overviewBufferSize This function tells the oscilloscope to start collecting data in stream ing m ode.
Page 72
Prog ramming the 3000A Series oscilloscopes the size of the overview buffers. These overviewBufferSize, are tem porary buffers used for storing the data before returning it to the application. The size is the sam e as the value bufferLth passed to ps3000aSetDataBuffer. Returns PICO_OK PICO_INVALID_HANDLE...
PicoScope 3000A Series Prog rammer's Guide 2.12.39 ps3000aSetBandwidthFilter PICO_STATUS ps3000aSetBandwidthFilter short handle, PS3000A_CHANNEL channel, PS3000A_BANDWIDTH_LIMITER bandwidth This function specifies the bandwidth lim it. Applicability All m odes. 4-channel oscilloscopes only. Arguments the handle of the required device handle, , the channel to be configured. The values are: channel Channel A input PS3000A_CHANNEL_A:...
Prog ramming the 3000A Series oscilloscopes 2.12.40 ps3000aSetChannel PICO_STATUS ps3000aSetChannel short handle, PS3000A_CHANNEL channel, short enabled, PS3000A_COUPLING type, PS3000A_RANGE range, float analogueOffset This function specifies whether an input channel is to be enabled, its input coupling type, voltage range, analog offset and bandwidth lim it. Applicability All m odes Arguments...
PicoScope 3000A Series Prog rammer's Guide 2.12.41 ps3000aSetDataBuffer PICO_STATUS ps3000aSetDataBuffer short handle, PS3000A_CHANNEL channel, short * buffer, long bufferLth, unsigned short segmentIndex, PS3000A_RATIO_MODE mode This function tells the driver where to store the data, either unprocessed or downsam pled, that will be returned after the next call to one of the GetValues functions.
Prog ramming the 3000A Series oscilloscopes 2.12.42 ps3000aSetDataBuffers PICO_STATUS ps3000aSetDataBuffers short handle, PS3000A_CHANNEL channel, short * bufferMax, short * bufferMin, long bufferLth, unsigned short segmentIndex, PS3000A_RATIO_MODE mode This function tells the driver the location of one or two buffers for receiving data. You need to allocate m em ory for the buffers before calling this function.
PicoScope 3000A Series Prog rammer's Guide 2.12.43 ps3000aSetDigitalPort PICO_STATUS ps3000aSetDigitalPort short handle, PS3000A_DIGITAL_PORT port, short enabled, short logiclevel This function is used to enable the digital port and set the logic level (the voltage at which the state transitions from 0 to 1). Applicability Block stream ing...
Prog ramming the 3000A Series oscilloscopes 2.12.44 ps3000aSetEts PICO_STATUS ps3000aSetEts short handle, PS3000A_ETS_MODE mode, short etsCycles, short etsInterleave, long * sampleTimePicoseconds This function is used to enable or disable (equivalent-tim e sam pling) and to set the ETS param eters. See ETS overview for an explanation of ETS m ode.
Prog ramming the 3000A Series oscilloscopes 2.12.45 ps3000aSetEtsTimeBuffer PICO_STATUS ps3000aSetEtsTimeBuffer short handle, __int64 * buffer, long bufferLth This function tells the driver where to find your application's ETS tim e buffers. These buffers contain the 64-bit tim ing inform ation for each ETS sam ple after you run a block-m ode ETS capture.
PicoScope 3000A Series Prog rammer's Guide 2.12.46 ps3000aSetEtsTimeBuffers PICO_STATUS ps3000aSetEtsTimeBuffers short handle, unsigned long * timeUpper, unsigned long * timeLower, long bufferLth This function tells the driver where to find your application's ETS tim e buffers. These buffers contain the tim ing inform ation for each ETS sam ple after you run a block-m ode ETS capture.
Prog ramming the 3000A Series oscilloscopes 2.12.47 ps3000aSetNoOfCaptures PICO_STATUS ps3000aSetNoOfCaptures short handle, unsigned short nCaptures This function sets the num ber of captures to be collected in one run of rapid block ode. If you do not call this function before a run, the driver will capture only one waveform .
PicoScope 3000A Series Prog rammer's Guide 2.12.48 ps3000aSetPulseWidthQualifier PICO_STATUS ps3000aSetPulseWidthQualifier short handle, PS3000A_PWQ_CONDITIONS * conditions, short nConditions, PS3000A_THRESHOLD_DIRECTION direction, unsigned long lower, unsigned long upper, PS3000A_PULSE_WIDTH_TYPE type This function sets up pulse-width qualification, which can be used on its own for pulse- width triggering or com bined with level triggering or window triggering to produce m ore com plex triggers.
Page 84
Prog ramming the 3000A Series oscilloscopes Arguments the pulse-width type, one of these constants: type, do not use the pulse width qualifier PS3000A_PW_TYPE_NONE: pulse width less than PS3000A_PW_TYPE_LESS_THAN: lower pulse width greater than PS3000A_PW_TYPE_GREATER_THAN: lower pulse width between PS3000A_PW_TYPE_IN_RANGE: lower upper pulse width not between PS3000A_PW_TYPE_OUT_OF_RANGE:...
Page 85
PicoScope 3000A Series Prog rammer's Guide 2.12.48.1 PS3000A_PWQ_CONDITIONS structure A structure of this type is passed to ps3000aSetPulseWidthQualifier in the argum ent to specify the trigger conditions. It is defined as follows: conditions typedef struct tPS3000APwqConditions PS3000A_TRIGGER_STATE channelA; PS3000A_TRIGGER_STATE channelB; PS3000A_TRIGGER_STATE channelC;...
Prog ramming the 3000A Series oscilloscopes 2.12.49 ps3000aSetPulseWidthQualifierV2 PICO_STATUS ps3000aSetPulseWidthQualifierV2 short handle, PS3000A_PWQ_CONDITIONS_V2 * conditions, short nConditions, PS3000A_THRESHOLD_DIRECTION direction, unsigned long lower, unsigned long upper, PS3000A_PULSE_WIDTH_TYPE type This function sets up pulse-width qualification, which can be used on its own for pulse- width triggering or com bined with level triggering or window triggering to produce m ore com plex triggers.
Page 87
PicoScope 3000A Series Prog rammer's Guide Arguments the pulse-width type, one of these constants: type, do not use the pulse width qualifier PS3000A_PW_TYPE_NONE: pulse width less than PS3000A_PW_TYPE_LESS_THAN: lower pulse width greater than PS3000A_PW_TYPE_GREATER_THAN: lower pulse width between PS3000A_PW_TYPE_IN_RANGE: lower upper pulse width not between PS3000A_PW_TYPE_OUT_OF_RANGE:...
Page 88
Prog ramming the 3000A Series oscilloscopes 2.12.49.1 PS3000A_PWQ_CONDITIONS_V2 structure A structure of this type is passed to ps3000aSetPulseWidthQualifierV2 in the argum ent to specify the trigger conditions. It is defined as follows: conditions typedef struct tPS3000APwqConditionsV2 PS3000A_TRIGGER_STATE channelA; PS3000A_TRIGGER_STATE channelB; PS3000A_TRIGGER_STATE channelC;...
PicoScope 3000A Series Prog rammer's Guide 2.12.50 ps3000aSetSigGenArbitrary PICO_STATUS ps3000aSetSigGenArbitrary short handle, long offsetVoltage, unsigned long pkToPk, unsigned long startDeltaPhase, unsigned long stopDeltaPhase, unsigned long deltaPhaseIncrement, unsigned long dwellCount, short * arbitraryWaveform, long arbitraryWaveformSize, PS3000A_SWEEP_TYPE sweepType, PS3000A_EXTRA_OPERATIONS operation, PS3000A_INDEX_MODE indexMode, unsigned long shots, unsigned long...
Page 91
PicoScope 3000A Series Prog rammer's Guide (3207B m odel) PS3207B_MAX_SIG_GEN_BUFFER_SIZE determ ines whether the is swept sweepType, startDeltaPhase up to the or down to it, or repeatedly swept up stopDeltaPhase, and down. Use one of these values: - PS3000A_UP PS3000A_DOWN PS3000A_UPDOWN PS3000A_DOWNUP the type of waveform to be produced, specified by...
Page 92
Prog ramming the 3000A Series oscilloscopes 2.12.50.1 AWG index modes arbitrary waveform generator supports single and dual index m odes to help you m ake the best use of the waveform buffer. Single mode. The generator outputs the raw contents of the buffer repeatedly. This m ode is the only one that can generate asym m etrical waveform s.
PicoScope 3000A Series Prog rammer's Guide 2.12.51 ps3000aSetSigGenBuiltIn PICO_STATUS ps3000aSetSigGenBuiltIn short handle, long offsetVoltage, unsigned long pkToPk, PS3000A_WAVE_TYPE waveType, float startFrequency, float stopFrequency, float increment, float dwellTime, PS3000A_SWEEP_TYPE sweepType, PS3000A_EXTRA_OPERATIONS operation, unsigned long shots, unsigned long sweeps, PS3000A_SIGGEN_TRIG_TYPE triggerType, PS3000A_SIGGEN_TRIG_SOURCE triggerSource, short extInThreshold This function sets up the signal generator to produce a signal from a list of built-in...
Page 94
Prog ramming the 3000A Series oscilloscopes Arguments the am ount of frequency increase or decrease in sweep increment, m ode the tim e for which the sweep stays at each frequency, dwellTime, in seconds whether the frequency will sweep from sweepType, or in the opposite direction, startFrequency...
Page 95
PicoScope 3000A Series Prog rammer's Guide the source that will trigger the signal generator: triggerSource, run without waiting for trigger PS3000A_SIGGEN_NONE use scope trigger PS3000A_SIGGEN_SCOPE_TRIG use EXT input PS3000A_SIGGEN_EXT_IN wait for software trigger PS3000A_SIGGEN_SOFT_TRIG provided by ps3000aSigGenSoftware Control reserved PS3000A_SIGGEN_TRIGGER_RAW Arguments If a trigger source other than is specified,...
Prog ramming the 3000A Series oscilloscopes 2.12.52 ps3000aSetSimpleTrigger PICO_STATUS ps3000aSetSimpleTrigger short handle, short enable, PS3000A_CHANNEL source, short threshold, PS3000A_THRESHOLD_DIRECTION direction, unsigned long delay, short autoTrigger_ms This function sim plifies arm ing the trigger. It supports only the LEVEL trigger types and does not allow m ore than one channel to have a trigger applied to it.
PicoScope 3000A Series Prog rammer's Guide 2.12.53 ps3000aSetTriggerChannelConditions PICO_STATUS ps3000aSetTriggerChannelConditions short handle, PS3000A_TRIGGER_CONDITIONS * conditions, short nConditions This function sets up trigger conditions on the scope's inputs. The trigger is defined by one or m ore structures that are then ORed PS3000A_TRIGGER_CONDITIONS together.
Page 98
Prog ramming the 3000A Series oscilloscopes 2.12.53.1 PS3000A_TRIGGER_CONDITIONS structure A structure of this type is passed to ps3000aSetTriggerChannelConditions in the argum ent to specify the trigger conditions, and is defined as follows: - conditions typedef struct tPS3000ATriggerConditions PS3000A_TRIGGER_STATE channelA; PS3000A_TRIGGER_STATE channelB; PS3000A_TRIGGER_STATE channelC;...
PicoScope 3000A Series Prog rammer's Guide 2.12.54 ps3000aSetTriggerChannelConditionsV2 PICO_STATUS ps3000aSetTriggerChannelConditionsV2 short handle, PS3000A_TRIGGER_CONDITIONS_V2 * conditions, short nConditions This function sets up trigger conditions on the scope's inputs. The trigger is defined by one or m ore structures that are then ORed PS3000A_TRIGGER_CONDITIONS_V2 together.
Page 100
Prog ramming the 3000A Series oscilloscopes 2.12.54.1 PS3000A_TRIGGER_CONDITIONS_V2 structure A structure of this type is passed to ps3000aSetTriggerChannelConditionsV2 in the argum ent to specify the trigger conditions, and is defined as follows: - conditions typedef struct tPS3000ATriggerConditionsV2 PS3000A_TRIGGER_STATE channelA; PS3000A_TRIGGER_STATE channelB; PS3000A_TRIGGER_STATE channelC;...
PicoScope 3000A Series Prog rammer's Guide 2.12.55 ps3000aSetTriggerChannelDirections PICO_STATUS ps3000aSetTriggerChannelDirections short handle, PS3000A_THRESHOLD_DIRECTION channelA, PS3000A_THRESHOLD_DIRECTION channelB, PS3000A_THRESHOLD_DIRECTION channelC; PS3000A_THRESHOLD_DIRECTION channelD; PS3000A_THRESHOLD_DIRECTION ext, PS3000A_THRESHOLD_DIRECTION aux This function sets the direction of the trigger for each channel. Applicability All m odes Arguments the handle of the required device handle, channelA, channelB,channelC, channelD, ext,...
Prog ramming the 3000A Series oscilloscopes 2.12.56 ps3000aSetTriggerChannelProperties PICO_STATUS ps3000aSetTriggerChannelProperties short handle, PS3000A_TRIGGER_CHANNEL_PROPERTIES * channelProperties, short nChannelProperties, short auxOutputEnable, long autoTriggerMilliseconds This function is used to enable or disable triggering and set its param eters. Applicability All m odes Arguments the handle of the required device.
Page 103
PicoScope 3000A Series Prog rammer's Guide 2.12.56.1 PS3000A_TRIGGER_CHANNEL_PROPERTIES structure A structure of this type is passed to ps3000aSetTriggerChannelProperties in the argum ent to specify the trigger m echanism , and is defined as channelProperties follows: - typedef struct tPS3000ATriggerChannelProperties short thresholdUpper;...
Prog ramming the 3000A Series oscilloscopes 2.12.57 ps3000aSetTriggerDelay PICO_STATUS ps3000aSetTriggerDelay short handle, unsigned long delay This function sets the post-trigger delay, which causes capture to start a defined tim e after the trigger event. Applicability All m odes Arguments the handle of the required device handle, the tim e between the trigger occurring and the first sam ple.
PicoScope 3000A Series Prog rammer's Guide 2.12.58 ps3000aSetTriggerDigitalPortProperties PICO_STATUS ps3000aSetTriggerDigitalPortProperties short handle, PS3000A_DIGITAL_CHANNEL_DIRECTIONS * directions short nDirections This function will set the individual digital channels' trigger directions. Each trigger direction consists of a channel nam e and a direction. If the channel is not included in the array of the driver assum es the PS3000A_DIGITAL_CHANNEL_DIRECTIONS...
Page 106
Prog ramming the 3000A Series oscilloscopes 2.12.58.1 PS3000A_DIGITAL_CHANNEL_DIRECTIONS structure A structure of this type is passed to ps3000aSetTriggerDigitalPortProperties in the argum ent to specify the trigger m echanism , and is defined as follows: - directions pragma pack(1) typedef struct tPS3000ADigitalChannelDirections PS3000A_DIGITAL_CHANNEL channel;...
Prog ramming the 3000A Series oscilloscopes 2.12.59 ps3000aSigGenSoftwareControl PICO_STATUS ps3000aSigGenSoftwareControl short handle, short state This function causes a trigger event, or starts and stops gating. It is used when the signal generator is set to SIGGEN_SOFT_TRIG. Applicability Use with ps3000aSetSigGenBuiltIn or ps3000aSetSigGenArbitrary.
PicoScope 3000A Series Prog rammer's Guide 2.12.60 ps3000aStop PICO_STATUS ps3000aStop short handle This function stops the scope device from sam pling data. If this function is called before a trigger event occurs, the oscilloscope m ay not contain valid data. Always call this function after the end of a capture to ensure that the scope is ready for the next capture.
Prog ramming the 3000A Series oscilloscopes 2.12.61 ps3000aStreamingReady (callback) typedef void (CALLBACK *ps3000aStreamingReady) short handle, long noOfSamples, unsigned long startIndex, short overflow, unsigned long triggerAt, short triggered, short autoStop, void * pParameter This callback function is part of your application. You register it with the driver using ps3000aGetStream ingLatestValues, and the driver calls it back when stream ing-m ode data is ready.
PicoScope 3000A Series Prog rammer's Guide 2.13 Wrapper functions The wrapper functions are for use with program m ing languages that do not support features of C such as callback functions. To use the wrapper functions you m ust include the library, which is supplied in the SDK, in your project.
Prog ramming the 3000A Series oscilloscopes 2.13.1 AutoStopped short AutoStopped short handle This function indicates if the device has stopped after collecting of the num ber of sam ples specified in the call to ps3000aRunStream ing. This occurs only if the ps3000aRunStream ing function’s flag is set.
PicoScope 3000A Series Prog rammer's Guide 2.13.2 AvailableData unsigned long AvailableData short handle, unsigned long * startIndex This function indicates the num ber of sam ples returned from the driver and shows the start index of the data in the buffer when collecting data in stream ing m ode. Applicability Stream ing m ode Arguments...
PicoScope 3000A Series Prog rammer's Guide 2.13.4 GetStreamingLatestValues PICO_STATUS GetStreamingLatestValues short handle This function returns the next block of values to your application when capturing data in stream ing m ode. Use with program m ing languages that do not support callback functions.
Prog ramming the 3000A Series oscilloscopes 2.13.5 IsReady short IsReady short handle This function polls the driver to verify that stream ing data is ready to be received. Applicability Stream ing m ode. (In block m ode, we recom m end using ps3000aIsReady instead.) Arguments...
PicoScope 3000A Series Prog rammer's Guide 2.13.6 IsTriggerReady short IsTriggerReady short handle, unsigned long * triggeredAt This function indicates whether a trigger has occurred when collecting data in stream ing m ode, and the location of the trigger point in the buffer. Applicability Stream ing m ode Arguments...
Prog ramming the 3000A Series oscilloscopes 2.13.7 RunBlock PICO_STATUS RunBlock short handle, long preTriggerSamples, long postTriggerSamples, unsigned long timebase, short oversample, short segmentIndex This function starts collecting data in block m ode without the requirem ent for specifying callback functions. Use the IsReady function to poll the driver once this function has been called.
PicoScope 3000A Series Prog rammer's Guide 2.13.8 SetTriggerConditions PICO_STATUS SetTriggerConditions short handle, * conditionsArray, short nConditions This function sets up trigger conditions on the scope's inputs. The trigger is defined by one or m ore sets of integers corresponding to PS3000A_TRIGGER_CONDITIONS structures which are then converted and passed to the ps3000aSetTriggerChannelConditions...
PicoScope 3000A Series Prog rammer's Guide 2.13.9 SetTriggerProperties PICO_STATUS SetTriggerProperties short handle, * propertiesArray, short nProperties, short auxEnable, long autoTrig This function is used to enable or disable triggering and set its param eters. This is done by assigning the values from the to an array of propertiesArray structures which are then passed to the...
PicoScope 3000A Series Prog rammer's Guide 2.14 Programming examples Exam ple code is provided in a num ber of program m ing languages. You m ay freely m odify this code for your own applications. 2.14.1 C The C exam ple program is a com prehensive console m ode program that dem onstrates all of the facilities of the driver.
Prog ramming the 3000A Series oscilloscopes 2.14.4 LabVIEW The SDK contains a library of VIs that can be used to control the PicoScope 3000A and som e sim ple exam ples of using these VIs in stream ing m ode, block m ode rapid block ode.
PicoScope 3000A Series Prog rammer's Guide – collects a set of data blocks or captures PicoScope3000AGetRapidBlock.vi from the oscilloscope in rapid block m ode This VI is sim ilar to . It outputs two-dim ensional PicoScope3000AGetBlock.vi arrays for each channel that contain data from all the requested num ber of captures.
Prog ramming the 3000A Series oscilloscopes 2.15 Driver status codes Every function in the ps3000a driver returns a driver status code from the following list of values. These definitions can also be found in the file PICO_STATUS which is included in the PicoScope 3000A SDK. Not all codes apply to picoStatus.h, the PicoScope 3000A SDK.
Page 127
PicoScope 3000A Series Prog rammer's Guide PICO_DATA_NOT_AVAILABLE No data is available from a run block call PICO_STRING_BUFFER_TOO_SMALL The buffer passed for the inform ation was too sm all PICO_ETS_NOT_SUPPORTED ETS is not supported on this device PICO_AUTO_TRIGGER_TIME_TOO_SHORT The auto trigger tim e is less than the tim e it will take to collect the pre-trigger data PICO_BUFFER_STALL The collection of data has stalled as unread data would be overwritten...
Page 128
Prog ramming the 3000A Series oscilloscopes PICO_WARNING_EXT_THRESHOLD_CONFLICT Attem pt to set different EXT input thresholds set for signal generator and oscilloscope trigger PICO_SIGGEN_OUTPUT_OVER_VOLTAGE The com bined peak to peak voltage and the analog offset voltage exceed the allowable voltage the signal generator can produce PICO_DELAY_NULL pointer passed as delay param eter NULL...
Page 129
PicoScope 3000A Series Prog rammer's Guide PICO_CONFIG_FAIL_AWG Unable to configure the signal generator PICO_INITIALISE_FPGA The FPGA cannot be initialized, so unit cannot be opened PICO_EXTERNAL_FREQUENCY_INVALID The frequency for the external clock is not within ± 5% of the stated value PICO_CLOCK_CHANGE_ERROR The FPGA could not lock the clock signal PICO_TRIGGER_AND_EXTERNAL_CLOCK_CLASH...
Page 130
Prog ramming the 3000A Series oscilloscopes Data has been requested with ETS m ode set but run block has not been called, or stop has been called. PICO_SIG_GEN_WHITENOISE_NOT_SUPPORTED White noise is not supported on the opened device. PICO_SIG_GEN_WAVETYPE_NOT_SUPPORTED The wave type requested is not supported by the opened device. PICO_INVALID_DIGITAL_PORT A port num ber that does not evaluate to either PS3000A_DIGITAL_PORT0...
PicoScope 3000A Series Prog rammer's Guide 2.16 Enumerated types and constants Here are the enum erated types used in the PicoScope 3000A Series SDK, as defined in the file . We recom m end that you refer to these constants by nam e ps3000aApi.h unless your program m ing language allows only num erical values.
PicoScope 3000A Series Prog rammer's Guide PS3000A_CONDITION_DONT_CARE, PS3000A_CONDITION_TRUE, PS3000A_CONDITION_FALSE, PS3000A_CONDITION_MAX } PS3000A_TRIGGER_STATE; typedef enum enPS3000ARatioMode PS3000A_RATIO_MODE_NONE, PS3000A_RATIO_MODE_AGGREGATE = 1, PS3000A_RATIO_MODE_DECIMATE = 2, PS3000A_RATIO_MODE_AVERAGE } PS3000A_RATIO_MODE; typedef enum enPS3000APulseWidthType PS3000A_PW_TYPE_NONE, PS3000A_PW_TYPE_LESS_THAN, PS3000A_PW_TYPE_GREATER_THAN, PS3000A_PW_TYPE_IN_RANGE, PS3000A_PW_TYPE_OUT_OF_RANGE } PS3000A_PULSE_WIDTH_TYPE; 2.17 Numeric data types Here is a list of the sizes and ranges of the num eric data types used in the PicoScope 3000A Series API.
Glossary Glossary AC/DC control. Each channel can be set to either AC coupling or DC coupling. With DC coupling, the voltage displayed on the screen is equal to the true voltage of the signal. With AC coupling, any DC com ponent of the signal is filtered out, leaving only the variations in the signal (the AC com ponent).
Page 137
PicoScope 3000A Series Prog rammer's Guide PC Oscilloscope. A m easuring instrum ent consisting of a Pico Technology scope device and the PicoScope software. It provides all the functions of a bench-top oscilloscope without the cost of a display, hard disk, network adapter and other com ponents that your PC already has.
PicoScope 3000A Series Prog rammer's Guide Index Data acquisition Data buffers declaring AC coupling declaring, aggregation mode AC/DC control Data retention Access DC coupling ADC count 55, 57 Digital connector Address Digital data Aggregation Digital port Aliasing Downsampling 8, 44 Analog offset maximum ratio Analogue bandwidth...
Page 140
Index Functions ps3000aGetTriggerTimeOffset ps3000aGetTriggerTimeOffset64 Hysteresis 97, 100 ps3000aGetUnitInfo ps3000aGetValues 9, 44 ps3000aGetValuesAsync 9, 46 ps3000aGetValuesBulk Index modes ps3000aGetValuesOverlapped dual ps3000aGetValuesOverlappedBulk single ps3000aGetValuesTriggerTimeOffsetBulk Information, reading from units ps3000aGetValuesTriggerTimeOffsetBulk64 Input range, selecting Intended use ps3000aIsReady IsReady function ps3000aIsTriggerOrPulseWidthQualifierEnabl IsTriggerReady function ps3000aMaximumValue 5, 55 ps3000aMemorySegments ps3000aMinimumValue 5, 57...
Page 141
PicoScope 3000A Series Prog rammer's Guide streaming mode PORT0, PORT1 Ports Retrieving times enabling rapid block mode 50, 52 settings RunBlock function Power options FlexiPower Power Source 25, 26 Sampling rate Programming maximum Scaling Serial numbers Excel SetTriggerConditions function LabView SetTriggerProperties function MATLAB Setup time...
Need help?
Do you have a question about the PicoScope 3204A and is the answer not in the manual?
Questions and answers