
PicoScope 3000A Series Prog rammer's Guide
117
Copyright © 2011-2013 Pico Technology Limited. All rights reserved.
ps3000abpg.en r9
2.14
Programming examples
Example code is provided in a number of programming languages. You may freely modify
this code for your own applications.
2.14.1 C
The
C
example program is a comprehensive console mode program that demonstrates
all of the facilities of the driver.
To compile the program, create a new project for an Application containing the
following files: -
ps3000acon.c
and:
ps3000abc.lib
(Borland 32-bit applications) or
ps3000a.lib
(Microsoft Visual C 32-bit applications)
The following files must be in the compilation directory:
ps3000aApi.h
picoStatus.h
and the following file must be in the same directory as the executable:
ps3000a.dll
2.14.2 C#
The following files are required:
AssemblyInfo.cs
PS3000ACSConsole.cs
PS3000AImports.cs
PS3000APinnedArray.cs
ps3000a.dll
PicoIpp.dll
To build the Windows Console application from the Microsoft Visual Studio IDE (2010
Express or later):
Load the
PS3000ACSConsole.sln
solution file into the IDE.
Press F6 to build the solution or click
Debug > Build Solution
.
Ensure that the
ps3000a.dll
and
PicoIpp
files are in the search path.
2.14.3 Excel
1. Load the spreadsheet
ps3000a.xls
2. Select
Tools | Macro
3. Select
GetData
4. 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
.