User Manual

PicoScope 4000 Series Programmer's Guide 97
Copyright © 2008-2011 Pico Technology Ltd. All rights reserved. ps4000pg.en
4.13
Programming examples
Your PicoScope installation includes programming examples in the following languages
and development environments:
C
Excel
LabView
4.13.1
C
The SDK includes a console-mode program (ps4000con.c) that demonstrates how to
use the PicoScope 4000 driver in Windows. The program demonstrates the following
procedures:
Open a PicoScope 4000 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 console mode application
Add ps4000con.c to the project
Add ps4000.lib to the project (Microsoft C only)
Add ps4000Api.h and picoStatus.h to the project
Build the project
4.13.2
Excel
The Excel example demonstrates how to capture data in Excel from a PicoScope 4000
Series scope.
1. Copy the following files from the SDK to a location that is on your Windows
execution path (for example, C:\windows\system32):
ps4000wrap.dll
ps4000.dll
PicoIpp.dll
2. Load the spreadsheet ps4000.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.