Test and Measurement Forum

Pico Technology SDK Hints and Tips

Post general discussions on using our drivers to write your own software here

Pico Technology SDK Hints and Tips

Postby Hitesh » Thu Aug 25, 2016 4:03 pm


Below are some hints and tips which might be useful when developing your own applications using the Pico Technology SDK:

Drivers and Data Types

  • Ensure that you are using the correct driver for your device as per the table in this post - for example, the PicoScope 2204A and 2205A use the ps2000 driver.
  • Use the correct data type for the API function that your application is calling - use the closest match if this is not possible e.g. Integer for uint32_t in Excel Visual Basic for Applications (VBA)

Enumeration Values

For languages such as VBA refer to the corresponding C header file for the driver for the enumeration values. Rather than passing the name of the enumeration, pass the integer value for the enumeration. The first item in the enumeration list will normally have a numerical value of 0.

For example, when calling the ps3000aSetChannel() function for PicoScope 3000 Series PC Oscilloscopes using the ps3000a driver API functions, a PS3000A_CHANNEL enumeration value is required for the channel argument. Referring to the ps3000aApi.h file (which can be found in the inc folder of the SDK installer), the enumeration list is defined as:

Code: Select all
typedef enum enPS3000AChannel

To specify channel A, use the value 0, use 1 for channel B and so on to select the correct value from the list.

Status Codes

Refer to the PicoStatus.h C header file in the SDK installation directory – integers need to be converted to a Hexadecimal number for comparison for C#, Excel VBA, MATLAB, NI LabVIEW, and VB .NET, unless they have been defined as integer values in the relevant files.

For example, if a status code of 282 is returned when calling ps5000aOpenUnit() for a PicoScope 5000A/B Series Oscilloscope, this corresponds to a Hex value of 0x11A which is PICO_POWER_SUPPLY_NOT_CONNECTED.

Not all status codes indicate an error, for example PICO_BUSY indicates that the device is busy collecting data, so these should be handled accordingly.

PicoScope Specific

  • Use the psXXXXGetTimebase() function to verify that the timebase index selected for block mode captures and the maximum number of samples per channel.
  • To use the fastest sampling interval, enable a single channel (Channel A only for 2000 Series) – by default all channels will be enabled on a device when it is opened.
  • For the PicoScope 5000A/B Series oscilloscopes, the selected resolution will also determine the fastest sampling interval.
  • Rapid Block captures: psXXXXGetValuesBulk function – pass an array for the overflow argument or NULL.
  • For block, rapid block and ETS mode captures, wait until the device is ready (either via the callback or by polling the relevant ‘IsReady()’ function before attempting to retrieve data.
  • For PicoScope drivers, some signal generator parameters can be changed while waiting for a trigger using the appropriate psXXXXSetSigGenPropertiesBuiltIn() or psXXXXSetSigGenPropertiesArbitrary() function.

Wrapper Libraries

  • Ensure Microsoft Visual C++ 2010 Redistributable (x68 for 32-bit and x64 for 64-bit) is installed – the SDK installer will do this.
  • Place the wrapper library files somewhere in a location on the Windows PATH Environment variable if moving them from the default SDK installation lib direction.

Hope this helps :D

Technical Specialist
Pico Technology
Site Admin
Site Admin
Posts: 2023
Joined: Tue May 31, 2011 3:43 pm
Location: St. Neots, Cambridgeshire

Return to General Software Discussions

Who is online

Users browsing this forum: No registered users and 0 guests