PicoScope

This page documents our attempt to demonstrate simple programming tools that can be used with PC Oscilloscopes by Pico Technology.  We are starting out with the PS5000 series PicoScope being used on the Windows operating system.

Before trying any of the programming examples below, you should:

1) Install the PicoScope Software (on Windows) and verify that it works properly with the oscilloscope (simply connect a x10 probe to input A and to the probe compensation output).  Make sure the software is *not* running before you try to run any of the example programs below.

2) Download the software development kit (r10_5_0_32 is the latest in June 2014) and extract the SDK.  You should find PDFs that discuss software development.


C

Our first example is documentation on how to use the Tiny C compiler ( www.TinyCC.org ) to compile the C console example program (PS5000Acon.c) provided by Pico Technology in the PS5000asdk zip file. Download the latest win32-bin.zip for TinyCC and extract (unzip) it.

Copy the PS5000Acon.c file from the SDK to the main folder where you extracted the TinyCC compiler.  Then edit the file and add the following code above the first #else statement (so the code is inside of the #ifdef _WIN32 block):
#if defined(__TINYC__)
#define scanf_s scanf
#define fscanf_s fscanf
#define memcpy_s(a,b,c,d) memcpy(a,c,d)
int32_t fopen_s(FILE ** a, const int8_t * b, const int8_t * c)
{
FILE * fp = fopen(b,c);
*a = fp;
return (fp>0)?0:-1;
}
#endif
Also copy the ps5000aApi.h and picoStatus.h files from the SDK to the main TinyCC folder.

Open a terminal (command prompt) in the main TinyCC folder and run the following command:
tiny_impdef ps5000a.dll
You should now find a new ps5000a.def file in the same folder.  Run the following command:
tcc PS5000Acon.c ps5000a.def
Run the PS5000Acon program and then you should see the version of the ps5000a.dll installed on your PC (if you don't have any power supply connected to your PicoScope you'll need to select "Y" to select the USB power).  Then when you see the menu select "B" and press the enter key when it asks for a key to start.  When the menu shows up again exit with "X".  You should now find a new block.txt file in the folder.


Python

Install Python 3 on 32-bit Windows (instructions here).

Download ps5000acon.zip and unzip it.  Open a command prompt and run:
python ps5000acon.py
Download ps5000astr072914.zip and unzip it (note that the initial streaming program on 29 July 2014 may not work correctly).  Open a command prompt and run:
python ps5000astr.py
We hope to convert more of the PS5000Acon.c program later.

Pascal

Win32 - PicoScope-i386-win32-072914.zip 2.2 MB
Unzip the files into a new folder
Open a Command Prompt in the new folder
Compile the programs:
  compile ps5000acon
  compile ps5000astr
Run the programs:
  bin\ps5000acon
  bin\ps5000astr

If you have Delphi 2007 (or earlier) you can compile and run the ps5000aDcon.dpr and ps5000aDstr.dpr files in the same folder.

Want more information? The "Hello World" page has a tutorial for Win32.  The "Simple Serial" page also has a tutorial.

Previous release: PicoScope-i386-win32-070114.zip 1.2 MB

Linux - maybe soon!

The Free Pascal and Delphi programs above are only the initial step.  We hope to convert more of the PS5000Acon.c program later.  If anyone wants to help there are nice links at the bottom of this page: Creating bindings for C libraries


Initial Linux notes (28 Aug. 2014) for C

Made Debian i386 virtual machine (less than 1 GB in VMware Workstation 9 in Ubuntu 12.04) per these notes:
Download i386 netinst CD image
Used the Additional information section for a regular install
New! 28 July 2015 Another way to make a small Debian console virtual machine is shown on this page.

When start up login as user then install sudo:
su (then root password)
apt-get install sudo
adduser <username> sudo
exit (exit su so back to user)
logout (then log back in as user)
halt (should fail)
sudo halt (should work)

Installed Debian Repository but with these changes:
sudo nano /etc/apt/sources.list
(for last step I did sudo apt-get install libps5000a)

sudo usermod -G pico <username>
newgrp -

cp /opt/picoscope/share/doc/libps5000a/usbtest .
sudo sh usbtest

sudo apt-get install tcc
cp /opt/picoscope/share/doc/libps5000a/PS5000Acon.c .
sudo tcc -I/opt/picoscope/include -lps5000a -L/opt/picoscope/lib  PS5000Acon.c -o picotest
sudo ./picotest

More to follow (hopefully something similar to this)...


Return to home page.

Please share your ideas, comments and suggestions. Thanks!