Control PicoScope over TCP

Forum for discussing PicoScope version 6 (non-automotive version)
bennog
Advanced User
Advanced User
Posts: 206
Joined: Mon Nov 26, 2012 9:16 am
Location: Netherlands

Control PicoScope over TCP

Post by bennog »

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

Hitesh

Re: Control PicoScope over TCP

Post by Hitesh »

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.

bennog
Advanced User
Advanced User
Posts: 206
Joined: Mon Nov 26, 2012 9:16 am
Location: Netherlands

Re: Control PicoScope over TCP

Post by bennog »

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
Advanced User
Advanced User
Posts: 206
Joined: Mon Nov 26, 2012 9:16 am
Location: Netherlands

Re: Control PicoScope over TCP

Post by bennog »

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
Advanced User
Advanced User
Posts: 206
Joined: Mon Nov 26, 2012 9:16 am
Location: Netherlands

Re: Control PicoScope over TCP

Post by bennog »

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
Advanced User
Advanced User
Posts: 206
Joined: Mon Nov 26, 2012 9:16 am
Location: Netherlands

Re: Control PicoScope over TCP

Post by bennog »

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

Hitesh

Re: Control PicoScope over TCP

Post by Hitesh »

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,

bennog
Advanced User
Advanced User
Posts: 206
Joined: Mon Nov 26, 2012 9:16 am
Location: Netherlands

Re: Control PicoScope over TCP

Post by bennog »

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

Hitesh

Re: Control PicoScope over TCP

Post by Hitesh »

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,

Tim Pico
Newbie
Posts: 0
Joined: Wed May 29, 2013 2:22 pm

Re: Control PicoScope over TCP

Post by Tim Pico »

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 748 times

Tim Pico
Newbie
Posts: 0
Joined: Wed May 29, 2013 2:22 pm

Re: Control PicoScope over TCP

Post by Tim Pico »

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 563 times

Tim Pico
Newbie
Posts: 0
Joined: Wed May 29, 2013 2:22 pm

Re: Control PicoScope over TCP

Post by Tim Pico »

PicoScope.AutomationDemo.exe attached...
Attachments
Executable.zip
PicoScope.AutomationDemo.exe
(140.58 KiB) Downloaded 563 times

bennog
Advanced User
Advanced User
Posts: 206
Joined: Mon Nov 26, 2012 9:16 am
Location: Netherlands

Re: Control PicoScope over TCP

Post by bennog »

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

Hitesh

Re: Control PicoScope over TCP

Post by Hitesh »

Hi Benno,

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

Thanks,

bennog
Advanced User
Advanced User
Posts: 206
Joined: Mon Nov 26, 2012 9:16 am
Location: Netherlands

Re: Control PicoScope over TCP

Post by bennog »

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

Post Reply