SDK for Linux

Post your Linux discussions here
Post Reply
DaveHughes
Newbie
Posts: 0
Joined: Mon Jul 01, 2013 1:43 pm

SDK for Linux

Post by DaveHughes »

Hello,

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:

Code: Select all

#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?

Hitesh

Re: SDK for Linux

Post by Hitesh »

Hi Dave,

Are you able to build the example provided as part of the libps6000 package successfully?

Regards,

mario_
Site Admin
Site Admin
Posts: 112
Joined: Fri Sep 13, 2013 12:57 pm

Re: SDK for Linux

Post by mario_ »

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.

DaveHughes
Newbie
Posts: 0
Joined: Mon Jul 01, 2013 1:43 pm

Re: SDK for Linux

Post by DaveHughes »

Sorry for the belated replies (I switched to g++ before checking back here!), thanks for you help!

rjm
Newbie
Posts: 0
Joined: Sun Mar 01, 2009 10:11 pm

Re: SDK for Linux

Post by rjm »

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)

My code example in C, adapted from the thread:

Code: Select all

// compile command:
// gcc -I/opt/picoscope/include/ -L/opt/picoscope/lib picotest.c -lps5000a -o picotest

#include 
#include 

#include 
#include 

#include 
#include 

int main(void)
{
   PICO_STATUS ret;   
   short psHndl;   
   char psOpen;
   ret=ps5000aOpenUnit(&psHndl,NULL,PS5000A_DR_12BIT);
   if(ret==PICO_OK)
   {
      printf("Picoscope opened.\n");
      psOpen=1;
   }else
   {
      printf("Problem! %d\n", ret);
      return 1;
   };
   return 0;
};
However, a problem with return value 3 is reported.

Hitesh

Re: SDK for Linux

Post by Hitesh »

Hi rjm,

Is the PicoScope application running at the same time as your application? If so, please close it down and then try again.

We are looking to change the content of our Linux Software and Drivers for Oscillos ... ta Loggers page so there will be further information.We do provide instructions on how to install the driver packages.

You may wish to try the C console application from our GitHub repository.

Regards,

rjm
Newbie
Posts: 0
Joined: Sun Mar 01, 2009 10:11 pm

Re: SDK for Linux

Post by rjm »

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.

Hitesh

Re: SDK for Linux

Post by Hitesh »

Hi rjm,

Thank you for your reply.

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).

Are you using 8-bit resolution or higher?

Regards,

Post Reply