I have installed the new PicoScope software on my Ubuntu system, and have it all running fine (can see traces etc through my PS6000).
However, I can't seem to get my own software to compile anymore? I used to be able to write my own C++ programs that made use of the drivers, but this isn't working now... Am I missing something?
With a simple Main.cpp of:
#include
using namespace std;
#include
#include
#include
#include
int main()
{
PICO_STATUS ret;
short psHndl;
bool psOpen;
ret=ps6000OpenUnit(&psHndl,NULL);
if(ret==PICO_OK)
{
cout<<"Picoscope opened.\n";
psOpen=true;
}else
{
cout<<"Problem! "<
doing the command:
gcc -I/opt/picoscope/include/ -L/opt/picoscope/lib main.cpp -lps6000
Gives the error:
/usr/bin/ld: /tmp/cc9WXO3N.o: undefined reference to symbol '_ZSt4cout@@GLIBCXX_3.4'
/usr/lib/i386-linux-gnu/libstdc++.so.6: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
Can anyone give me advise on how to use the new PicoScope installation for developing software?
The solution is to use g++ instead of gcc... g++ compiles cpp, gcc just c. g++ will link stdc++ where missing symbols exists. Also option `-o main` will produce correct executable.
Many thanks for this thread. This seems the only information available regarding direct control of picoscope.
I see that SDK is for Windows only, so I thought that no direct communication is presumed in Linux, until I found this thread...
Please add some related documents onto the website!!
I'm having a PS5000a-compatible instrument (5443A)
Thanks for the quick reply, and yes, I decided to download the SDK, and find out that this kit is quite generic. Before I read your answer, I already found the console application, an built in successfully on my system. It works! - but not after having inspected the power connection from the adapter. It seems that electrical contact was not OK (or was the PS hanging?).
To be sure, I also executed the small test program of this thread - is okay now.
The console application is a good basic point for further work. I'd construct a simple approach (nonverbose) that acts like instruments out there that can be controlled via a set of commands over the communications line. In this case: via piping from whatever application as if it were a cabled command interface.
First (priority) thing for me is to transfer 32 Msamples of 100MSPS data captured data from the PS buffer into a simply binary data file (I hope the PS can send the buffer content in byte binary format (8-bit samples) to the host in order to minimize time associated with the transfer over USB.
If you are having trouble with the USB cable/power supply please e-mail support@picotech.com and we can assist you further.
Please feel free to submit a pull request on our GitHub repository if you wish to contribute some example code (create a new project under the ps5000a folder).