Installation guide
PicoScope 4000 Series (A API) Programmer's Guide 89
Copyright © 2008-2014 Pico Technology Ltd. All rights reserved. ps4000apg.en r1
7 Programming examples
The SDK includes programming examples for a number of languages and development
environments.
7.1
C
The SDK includes a console-mode program (ps4000acon.c) that demonstrates how
to use the PicoScope 4000 driver in Windows. The program demonstrates the following
procedures:
Open a PicoScope 4000 Series oscilloscope
Collect a block of samples immediately
Collect a block of samples when a trigger event occurs
Collect a stream of data immediately
Collect a stream of data when a trigger event occurs
To build this application:
Set up a project for a 32-bit or 64-bit console mode application
Add ps4000acon.c to the project
Add ps4000a.lib to the project (Microsoft C only)
Add ps4000aApi.h and picoStatus.h to the project
Build the project
7.2
Excel
The Excel example demonstrates how to capture data in Excel from a PicoScope 4000
Series scope.
1. Copy the following files (for a 32-bit Windows system) from the SDK to a location
that is on your Windows execution path (for example, C:\windows\system32):
ps4000aWrap.dll
ps4000a.dll
PicoIpp.dll
2. Load the spreadsheet ps4000a.xls
3. Select Tools | Macro
4. Select GetData
5. Select Run
Note: The Excel macro language is similar to Visual Basic. The functions which return
a TRUE/FALSE value, return 0 for FALSE and 1 for TRUE, whereas Visual Basic
expects 65 535 for TRUE. Check for > 0 rather than = TRUE.
7.3
LabVIEW
The SDK contains a library of VIs that can be used to control the PicoScope 4000 and
some simple examples of using these VIs in streaming mode, block mode and rapid
block mode.
The LabVIEW library (PicoScope4000a.llb) can be placed in the user.lib
subdirectory to make the VIs available on the ‘User Libraries’ palette. You must also
copy ps4000a.dll and ps4000aWrap.dll to the folder containing your LabVIEW
project.
The library contains the following VIs: