Interface to Control Picoscope

Post any questions you may have about our current range of oscilloscopes
Post Reply
mula
Newbie
Posts: 0
Joined: Thu Dec 19, 2019 7:11 pm

Interface to Control Picoscope

Post by mula » Thu Dec 19, 2019 7:20 pm

I have a 3406D picoscope. I need to control it from a PC, i.e. simply just start, stop and save waveforms. Is there a library, preferably C#, to do that?

Btw, I tried what is explained here https://www.picotech.com/support/topic14371.html#p42147
However, even picoscope run doesn't do anything. And picoscope run ? returns the errors

Please specify a valid file path or file type.

Possible errors:
Not a valid folder or file path
Not a PicoScope 6 supported file type.

Gerry
PICO STAFF
PICO STAFF
Posts: 594
Joined: Mon Aug 11, 2014 11:14 am

Re: Interface to Control Picoscope

Post by Gerry » Fri Dec 20, 2019 11:00 am

Hi Mula,

The easiest way to use simple automation, e.g. to start, stop and save waveforms, is to use the Macro Recorder in PicoScope 6 (under the 'Tools->Macro Recorder' menu option). You just set it to record your actions and it will then create an execution run that you can save as a file to load and re-use.

The commands that it saves are also the commands used by the Command Line Interface (when preceded by 'picoscope.com /a') that is referred to in the link that you gave. So, you can use it to get the correct automation commands to run in a batch file aswell.

However, if you would prefer to use a C# environment, then you can:
1/ Download and install our Software Development Kit (from here: https://www.picotech.com/download/software/sr/PicoSDK_32_10.6.13.97.exe, for 32-bit applications running on Windows, and here: https://www.picotech.com/download/software/sr/PicoSDK_64_10.6.13.97.exe, for 64-bit applications).
2/ Download example code that performs simple captures and that you can modify to create your own application from here: https://github.com/picotech/picosdk-c-sharp-examples).

Regards,

Gerry
Gerry
Technical Specialist

porizm
Newbie
Posts: 0
Joined: Thu Feb 20, 2020 7:06 pm

Re: Interface to Control Picoscope

Post by porizm » Sat Feb 22, 2020 12:34 pm

Hello to all who are reading this post.
As I already wrote in this post, we would like to connect the PS 5444D to a PC. But there is a problem. We would like to use Keysight VEE Pro 9.32 for this purpose. It is the easiest way for us because either we are not skilled enough with the other environments and programming languages or the language is not appropriate (eg. VBA). I was surprised that Pico no longer actively support Agilent/Keysight VEE Pro for the Picoscopes.
Could anyone be so kind to give us some advice how we can solve our problem? The basic task we need to do is to set the scope (input and timebase) and then switch it to the streaming mode. Preferably, of course, in VEE Pro, but also any other reasonable solution would be welcome.
With kind regards
porizm

NeilH
PICO STAFF
PICO STAFF
Posts: 180
Joined: Tue Jul 18, 2017 8:28 am

Re: Interface to Control Picoscope

Post by NeilH » Mon Feb 24, 2020 10:26 am

Hi

We do not support VEE as there is not the demand for it to warrant the development time.
We do have a range of examples for variety of programming languages hosted on our github page www.github.com/picotech that are designed to show how to control the devices using the PicoSDK in these languages.

Neil
Neil
Technical Support Engineer

porizm
Newbie
Posts: 0
Joined: Thu Feb 20, 2020 7:06 pm

Re: Interface to Control Picoscope

Post by porizm » Mon Feb 24, 2020 5:00 pm

Hello Neil,

Thank you very much for your answer.

I do believe that experienced programmer is able to effectively use the examples for creation of many useful applications. We are not so experienced. We tried to use the sources from SDK. VEE is able to import procedures and functions in different forms. The most simple is using *.dll file together with appropriate *.h file. This was what we did. We took ps5000a.dll and ps5000aApi.h. As far as I remember, in some previous cases of other instruments this was the correct way how to get access to the objects in the dll file. Not so in case of Pico. The only effect was message that a syntax error is in .h file. I really do not believe that some syntax error could be in .h file. More probably the .h file is not friendly enough to VEE. And it is a little mysterious for me why it must be so.

Recently we found that the PicoScope can accept commands from command line. Nice thing, really. But we are affraid we are not able to get any bit of data from the scope this way. Please, correct me if I am wrong.

I would like also to mention that in our lab we use device USB-6002 from National Instruments. If I remember well, it was not too complicated problem to make it accesible from VEE.

With kind regards

porizm

Gerry
PICO STAFF
PICO STAFF
Posts: 594
Joined: Mon Aug 11, 2014 11:14 am

Re: Interface to Control Picoscope

Post by Gerry » Tue Feb 25, 2020 10:57 am

Hi porizm,

The Macro recorder does work (enables you to automatically select Picoscope 6 software options to perform lots of different functions, including capturing data) but it has some limitations as not all PicoScope 6 options are available for selection. I have listed a few posts below, where automation has been discussed and examples have been given that you can try out for yourself:

Basic data collection:
https://www.picotech.com/support/topic14371.html

Opening PicoScope 6 and copying measurements to a file:
https://www.picotech.com/support/topic20001.html

Starting PicoScope 6 with different settings, e.g. probe scaling, automatically:
https://www.picotech.com/support/topic35951.html

Using Macro commands in a batch file, repeatedly:
https://www.picotech.com/support/topic38401.html

Running Automation commands at specific times:
https://www.picotech.com/support/topic40274.html

Regards,

Gerry
Gerry
Technical Specialist

porizm
Newbie
Posts: 0
Joined: Thu Feb 20, 2020 7:06 pm

Re: Interface to Control Picoscope

Post by porizm » Sat Apr 04, 2020 12:57 pm

Hello Gerry,
Great thanks for your reply. I appreciate it much more than answer of your colleague NeilH.
I went through all the posts you mentioned in your reply. I think there are many good ideas for work with
PicoScope. Unfortunately I did not find what we were looking for, ie. starting the uninterrupted streaming of data and sending it to some other process for analysis.
We also tried to run all examples for streaming in all environments either from SDK or from Github. Of course, all worked reliably. Then we tried to translate VBA Excel example into VEE Pro 9.33. It seemed to be quite an easy task for us. We found that almost everything worked well except passing parameters (ie. data buffers) by reference. The software acquired the requested samples, announced the number of samples read and index of the buffer where the data were stored. But the buffer was empty every time. Perhaps some misunderstanding in passing parameters, maybe (???) in wrap functions.
Now we are deadlocked. We developped the analysis part of our software, but we are not able to get the data. It needs to be mentioned that analysis of stored data is not acceptable as the acquiring of data and its analysis must run online for several tens of hours.
Thank you very much for your effort anyway.
With kind regards
porizm

Post Reply