Command line option to Add Measurement?

Forum for discussing PicoScope version 6 (non-automotive version)
Post Reply
AJJ
Newbie
Posts: 0
Joined: Tue Jun 08, 2021 7:52 pm

Command line option to Add Measurement?

Post by AJJ »

Hi,
The Command line tool is very helpful and I understand it is not complete. But wondering if it is possible to add Measurements (example: AC RMS, Frequency) from the Command line. The available picoscope /a Measurement.Add.Pressed does not help.
I am able to add the measurements from the GUI and then read the measurements from commandline using Measurements.CSV? command. But if I could add measurements from command line it will complete my script.
Let me know.

Thanks!

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

Re: Command line option to Add Measurement?

Post by Gerry »

Hi AJJ.

Sorry for the late reply (I have been working through a backlog of Help desk tickets and forum posts).

To answer your question, the CLI was initially created to perform in-house testing, but has long since been replaced with custom software. It was released to the public along with the Macro recorder, because they provided a means to log and control quite few PicoScope software GUI functions. There was no documentation released as you could use the Macro Recorder in PicoScope 6 to generate the commands , which is intuitive enough. You still can use the Macro Recorder to show what works, or give clues to what might work, but you have to be aware that there just may not be equivalent Command Line calls for certain features, even for those documented in the Recorder because, since the Macro Recorder and Command Line were last updated, the features in PicoScope 6 have moved on significantly to many new and improved versions. So, for instance, the ‘Tools' commands still refer to ‘Marquee’ and 'Pan’, which haven't been in the tools menu since before I joined the company 7 years ago. It is still possible to create automation with the commands, as many of our customers do, but just be aware that there are anomalies that can be very frustrating if you spend too much time on them, for instance, for opening additional views:

PicoScope /a View.Add.Scope.Click
fails on the Command Line but is logged in the Macro Recorder
PicoScope /a View.Add.Scope.Click=True
fails
PicoScope /a View.Add.Scope.Checked=True
puts a check mark against the selection but doesn't open the view

So, this seems to indicate that "PicoScope /a View.Add.Scope.Checked=True" accesses an older mechanism (perhaps that used to allow only one type of a different view) while "PicoScope /a View.Add.Scope.Click" is the correct updated command but is only reported it in the Macro Recorder (hasn't replaced the selection mechanism in the CLI automation tool).

What doesn't help are that there are different types of syntax that you could use for commands and their arguments, which can make the number of combinations and permutations one barrier too many. Unfortunately, Measurements fall into that category and, although I can give you some pointers, as to how to find out what might work, I can't guarantee that anything would (the measurements window has changed somewhat since I have been here). For instance, because selecting Measurements in the PicoScope 6 GUI opens a window with more than just one selection, the Command Line appears to require the correct setting of the parameters that you want on the line that follows the command ‘Picoscope /a Measurement.Add', but it’s not clear if they should all be on the same line or on individual lines, or what order they should be in (what’s in the GUI doesn’t necessarily correspond with the CLI, as ‘PicoScope /a Trigger.TriggerSource.SelectedIndex=1’ refers to Trigger Channel in the GUI). Also, Because of inconsistencies in the CLI syntax, variations of the following (or even something completely different) would be needed (assuming that it's still implemented):

PicoScope /a MeasurementChannel.SelectedIndex=2
PicoScope /a Measurement.Channel.SelectedIndex=2
PicoScope /a Measurement.MeasurementChannel.SelectedIndex=2
PicoScope /a MeasurementChannel.#0
PicoScope /a Measurement.Channel.#0
PicoScope /a Measurement.SelectedChannel.#0
PicoScope /a MeasurementType.SelectedIndex=1
PicoScope /a Measurement.Type.SelectedIndex=1
PicoScope /a MeasurementSection.SelectedIndex=1
PicoScope /a Measurement.Section.SelectedIndex=1
PicoScope /a Measurement.GraphSection.SelectedIndex=1

So, my advice would be that it's likely that there isn't a CLI implementation for setting measurements, but if you're still keen to explore what might be possible, feel free to either experiment with the information I have given you (I exhausted a lot of permutations but unfortunately my time is limited) or/and any other pointers you may get from the Command Line list, the Macro Editor, and a search on our Forum.

Regards,

Gerry
Gerry
Technical Specialist

Post Reply