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 »

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: 702
Joined: Mon Aug 11, 2014 11:14 am

Re: Interface to Control Picoscope

Post by Gerry »

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 »

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: 203
Joined: Tue Jul 18, 2017 8:28 am

Re: Interface to Control Picoscope

Post by NeilH »

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 »

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: 702
Joined: Mon Aug 11, 2014 11:14 am

Re: Interface to Control Picoscope

Post by Gerry »

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 »

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

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

Re: Interface to Control Picoscope

Post by porizm »

Hello Gerry and the others,

I would like to return to my topic of control the Pico from an application running on PC.
Since the time of my previous reply we have made certain progress. We took the examples from SDK and from GitHub and tried to create some application. The aim of our effort was to set our Picoscope 5444D to uninterrupted streaming data at a sample speed of 50kS/s in two channels with resolution of 15 bits. Each time 10 000 samples would be collected (ie. waveform of 200 ms long) and sent to a PC. Consequently, certain analysis would be done on this data and the data would be or not stored to a disk according to the result of analysis. In the meantime next 200 ms waveform would be ready for reading and so forth.
This algorithm we tried on National Instrument USB-6002 device at a sample rate of 25 kS/s (USB-6002 is unable to work faster when using two channels). We did not meet any problem and sampling and analysis went smoothly and in time.
Not so with Pico 5444D. We took the examples for VBA (Excel), VB (console application) and Python that worked well in their original forms for one single pass. But when we made a loop we found that any of the three applications are not able to provide more than 3 waveforms in one second. Of course, when a waveform is 200 ms long, you need to get 5 waveforms in a second. We spent a plenty of time to find out WHY not more. But without any success. Just three waveforms and enough!
It's good to remark that the applications I am speaking about were developed independently by two people. One of us made VBA and VB application, the other one made the Python version. So probably not the same possible mistake was done. But still the 3 waveforms per second is like an insurmountable barrier.

Would anyone have any idea or experience?

Regards

mporiz

Martyn
Site Admin
Site Admin
Posts: 3865
Joined: Fri Jun 10, 2011 8:15 am
Location: St. Neots

Re: Interface to Control Picoscope

Post by Martyn »

answered here https://www.picotech.com/support/topic40582.html and via your Helpdesk email
Martyn
Technical Support Manager

Post Reply