Test and Measurement Forum

Control PicoScope over TCP

Forum for discussing PicoScope version 6 (non-automotive version)

Control PicoScope over TCP

Postby bennog » Mon Apr 29, 2013 3:37 pm

For a project I do it would be nice to have control over the PicoScope program. Preferred a TCP/IP connection.

options
- Set (horizontal) zoom factor
- Set (horizontal) scroll position
- Start capturing.
- Stop capturing.
- Set timebase
- Set number of samples
- Set trigger options.
......

Regards,
Benno
bennog
Guru
Guru
 
Posts: 79
Joined: Mon Nov 26, 2012 9:16 am

Re: Control PicoScope over TCP

Postby Hitesh » Tue Apr 30, 2013 8:45 am

Hi Benno,

PicoScope 6 does support automation commands.

Once you have started an instance of PicoScope 6, open a command line window and type the following:

Code: Select all
picoscope /a ?


This will display the commands available.

Below are some examples of calling the commands:

  • Querying and Setting timebase

    Code: Select all
    picoscope /a CollectionTime.Items?

    Code: Select all
    picoscope /a CollectionTime.SelectedIndex=0

  • Setting number of samples

    Code: Select all
    picoscope /a NumberOfSamples.Value=1M


Placing a '?' after the command name will show the Actions, Inputs and Outputs.

PicoScope 6 doesn't have a TCP connection but if you can remote login to the PC running PicoScope 6, then you should be able to call these commands.

I hope this helps.
Hitesh

Technical Specialist
Pico Technology
Hitesh
Site Admin
Site Admin
 
Posts: 1997
Joined: Tue May 31, 2011 3:43 pm
Location: St. Neots, Cambridgeshire

Re: Control PicoScope over TCP

Postby bennog » Tue Apr 30, 2013 9:14 am

It is for synchronizing the PicoScope window with a high-speed video.
When stepping trough the video the scope visible data will be automatically aligned with the video data.

So human typing is not an option, but if you can make the same interface available by TCP (witch will be quit simple in C#) this will be a nice addition to the PicoScope software for me.

Also for debugging a complex machine control, the machine control software can trigger the PicoScope program to stop sampling and save the data for later analyze.
This saves a input on the scope witch you would normally use to trigger with a digital output signal.

Regards,
Benno
bennog
Guru
Guru
 
Posts: 79
Joined: Mon Nov 26, 2012 9:16 am

Re: Control PicoScope over TCP

Postby bennog » Tue Apr 30, 2013 11:47 am

O I see now, will write some test program to test automation and the responcetimes.

will let you know how it is going :)

Benno
bennog
Guru
Guru
 
Posts: 79
Joined: Mon Nov 26, 2012 9:16 am

Re: Control PicoScope over TCP

Postby bennog » Tue Apr 30, 2013 12:12 pm

It looks like automation won't work in win7 64

Image

Tested in windows xp and works without problem.
Tested Win7-64 error message as above.
CMD start as admin (same error)
PicoScope and CMD start as admin (same error)

Any other suggestions ?

Regards,
Benno
bennog
Guru
Guru
 
Posts: 79
Joined: Mon Nov 26, 2012 9:16 am

Re: Control PicoScope over TCP

Postby bennog » Tue Apr 30, 2013 1:01 pm

Problem solved, PicoScope crashed several times on my system and left 5 incances of PicoScope.*32 open in the task manager.
After I killed all instances of PicoScope.exe*32 and restarted the PicoScope program the automation commands work as expected.

Benno
bennog
Guru
Guru
 
Posts: 79
Joined: Mon Nov 26, 2012 9:16 am

Re: Control PicoScope over TCP

Postby Hitesh » Tue Apr 30, 2013 4:07 pm

Hi Benno,

It looks as though you may only be able to control a single instance of the software so there may have been some confusion if other instances of PicoScope 6 were running.

Do these automation commands help? I will put in a feature enhancement request for consideration.

Thanks,
Hitesh

Technical Specialist
Pico Technology
Hitesh
Site Admin
Site Admin
 
Posts: 1997
Joined: Tue May 31, 2011 3:43 pm
Location: St. Neots, Cambridgeshire

Re: Control PicoScope over TCP

Postby bennog » Wed May 01, 2013 5:51 am

The other instances were of crashed PicoScope programs, they were not visible on the screen but still consuming about 1Gig of memory. They showed up only in the task-manager.
This was because I was working with big datasets and the PicoSocpe seems not too stable with this big datasets.

The automation commands will do the trick, only they are very slow compared to commands over a TCP connection.
This is because for every command a new instance of PicoScope is started for a short time.

Still not found the automation commands to start and stop the capturing.

If the future request is for TCP automation commands it will cover both multiple instances and a speed increment for the automation commands.

Regards,
Benno
bennog
Guru
Guru
 
Posts: 79
Joined: Mon Nov 26, 2012 9:16 am

Re: Control PicoScope over TCP

Postby Hitesh » Wed May 01, 2013 9:21 am

Hi Benno,

It is necessary to start an instance of PicoScope 6 before sending the automation commands.

There doesn't appear to be a start/stop command - you can create your own settings file and setup PicoScope 6 to start automatically with those settings.

To stop the capture you could use a single trigger or alarm condition or Buffer.Previous.

I'll add the additional comments to the feature request.

Regards,
Hitesh

Technical Specialist
Pico Technology
Hitesh
Site Admin
Site Admin
 
Posts: 1997
Joined: Tue May 31, 2011 3:43 pm
Location: St. Neots, Cambridgeshire

Re: Control PicoScope over TCP

Postby Tim Pico » Wed May 29, 2013 2:36 pm

Start/Stop is available through automation (Called Run, and Run.Pressed=true/false lets you stop and start). However, I've found a bug which means that many commands are not being reported to the command line correctly. This will be fixed in our next release, but until then please refer to the attached Commands.txt which lists all the supported automation commands.
Attachments
Commands.txt
PicoScope 6.7.21 Automation Commands
(2.76 KiB) Downloaded 194 times
Tim Pico
Newbie
 
Posts: 0
Joined: Wed May 29, 2013 2:22 pm

Re: Control PicoScope over TCP

Postby Tim Pico » Wed May 29, 2013 2:58 pm

For automation over TCP/HTTP, check out the attached .NET project which requires Visual Studio 2012.

This demo project and allows you to access PicoScope automation via HTTP POST requests to http://localhost:8080/automation

Simply HTTP POST the command string to the URL and get a string response. The demo application uses .NET IPC and is much faster than the command line interface. It should give you an idea of what is possible with your own solution.

If you compile it yourself you'll require a copy of Griffin.Networking and Griffin.Networking.Protocol.Http or the NuGet package manager which will fetch these for you.

Executable to follow...
Attachments
Picoscope.AutomationDemo.zip
Automation Demo Project
(226.2 KiB) Downloaded 151 times
Tim Pico
Newbie
 
Posts: 0
Joined: Wed May 29, 2013 2:22 pm

Re: Control PicoScope over TCP

Postby Tim Pico » Wed May 29, 2013 3:01 pm

PicoScope.AutomationDemo.exe attached...
Attachments
Executable.zip
PicoScope.AutomationDemo.exe
(140.58 KiB) Downloaded 146 times
Tim Pico
Newbie
 
Posts: 0
Joined: Wed May 29, 2013 2:22 pm

Re: Control PicoScope over TCP

Postby bennog » Thu May 30, 2013 2:02 pm

Many thanks for these samples.

I don't have much time at this moment, but when I have some time I will experiment with your samples.

Regards,
Benno
bennog
Guru
Guru
 
Posts: 79
Joined: Mon Nov 26, 2012 9:16 am

Re: Control PicoScope over TCP

Postby Hitesh » Fri Jul 03, 2015 1:01 pm

Hi Benno,

Just following up to see if you have had a chance to try the Automation demo?

Thanks,
Hitesh

Technical Specialist
Pico Technology
Hitesh
Site Admin
Site Admin
 
Posts: 1997
Joined: Tue May 31, 2011 3:43 pm
Location: St. Neots, Cambridgeshire

Re: Control PicoScope over TCP

Postby bennog » Fri Jul 03, 2015 6:39 pm

After 2 years :D

But still have had no time to test, also the need for the automation is over.
The problem I was hunting down was found.

Still very happy with my 4424 8)

Benno
bennog
Guru
Guru
 
Posts: 79
Joined: Mon Nov 26, 2012 9:16 am

Next

Return to PicoScope 6 for Windows

Who is online

Users browsing this forum: No registered users and 0 guests