Macro Recorder Edit

Forum for discussing PicoScope version 6 (non-automotive version)
Post Reply
red03
Newbie
Posts: 0
Joined: Fri Dec 06, 2019 3:55 pm

Macro Recorder Edit

Post by red03 »

Hi,

I would like to use the macro recorder to execute sequences for me to specific times as I am not accustomed to coding automations. But it seems to be limited to a time period of about 200 seconds? I want the macro recorder to save my signals 1, 2, 5, 10 minutes and so on after starting, so I recorded a few sequences and tried to edit the time values to the ones I wanted but after ca 200 seconds it comes out as "-214,7s". How do I enter anything above 3m20s correctly? Or is the recorder actually limited to that period of time?

thanks in advance!

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

Re: Macro Recorder Edit

Post by Gerry »

Hi red03,

I don't see a problem with editing values to beyond 3m20s in the macro recorder (and saving and reloading them to use again).

Could you post your psmacro file and tell us what PicoScope you are using.

Regards,

Gerry
Gerry
Technical Specialist

red03
Newbie
Posts: 0
Joined: Fri Dec 06, 2019 3:55 pm

Re: Macro Recorder Edit

Post by red03 »

Hi Gerry,

yes, I think it should be working as well. But somehow it won't with my program (Picoscope 6). I can't seem to upload the file though...
How would you enter say, 5 minutes? Because I tried entering 5m, 5min, 600s, but as I said, anything after 214,7s turns to "-214,7s".

Or maybe you could tell me how to make a recurring sequence? So that I could at least have my signal saved every 1 minute or so?

Or else I would have to leave my laptop connected and record the steps for up to 6 hours in logarithmic style. But I will do so if the rest doesn't work I guess.

thanks in advance
Red

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

Re: Macro Recorder Edit

Post by Gerry »

Hi Red,

Just so that you know, you can make slight changes to the times in the Macro editor, but if you want to make significant time changes then you need to save and edit the psmacro file.

The psmacro file is an xml file, and the time is saved as absolute time hrs:mins:secs.thousandths, so you have to adjust the interval between any 2 absolute time values to exactly 5 minutes as shown in the attached psmacro file Macro_test_1.

The limitation of using a macro file instead of, say, a batch file with automation commands in it, is that there are no programming constructs, so there is no way to perform a recurring sequence with a single command. You would have to copy the interval for however many times you want to perform the sequence, as shown in the attached psmacro file Macro_test_2.

Regards,

Gerry
Attachments
Macro_test.zip
(629 Bytes) Downloaded 320 times
Gerry
Technical Specialist

red03
Newbie
Posts: 0
Joined: Fri Dec 06, 2019 3:55 pm

Re: Macro Recorder Edit

Post by red03 »

Hi Gerry,

so I tried saving with the macro recorder while running some sequences and as you can see in the files I uploaded, it worked in one of them ("test works after 215s") and it doesn't in the other - even though I didn't do anything differently. Do you know why that could be?
Also, I cannot edit the times in either of these files (to anything after 215s). Can you manages to do so? Am I maybe missing a tool?

How exactly did you enter your time values? e.g. for 5 minutes? "00:05:00"?

Regards
Attachments
test macro recorder.zip
(960 Bytes) Downloaded 314 times

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

Re: Macro Recorder Edit

Post by bennog »

have you tried notepad++ for editing the files.

Benno

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

Re: Macro Recorder Edit

Post by Gerry »

Hi Red,

I'm not 100% sure why one macro file works and the other doesn't, as they both have events set to run simultaneously (which could be a problem), but it could be because you have 2 events starting simultaneously in the second file while you only had 1 event starting in the first file. Alternatively, in the first file you're saving file names that increment, but in the second file you're trying to save a second file with a file name that would precede the first file name if the files were being incremented. This may or may not cause an issue with file incrementing when the system is attempting to over-write a file with the same name.

So, I would start by incrementing the time for each event (you have a whole bunch of things happening at the same time, which just wouldn't happen in the real world). Just set every event to occur after the previous event (use a 1 thousandth of a second increment if you want them as close together as possible).
Next, just to be sure, have the file names also incrementing where the non-numeric part of the file names are the same.

(Incidentally, I didn't increment the last value correctly in the second example that I gave but, even though the Macro still works, that was a mistake that you shouldn't repeat.)

Regards,

Gerry
Gerry
Technical Specialist

red03
Newbie
Posts: 0
Joined: Fri Dec 06, 2019 3:55 pm

Re: Macro Recorder Edit

Post by red03 »

Hi Gerry,

yes, that was a mistake that the second file name of the second file precedes the first. It still works though. Saving the sequences in chronological order and having the file names saved incrementally is not the problem. Have you tried editing the time values of any of the files - e.g. to 5 minutes? If I edit just one value of the second file, save, close and reopen the file using the macro recorder, all the time values of the sequences that occur 214,7s or later turn to "-214,7s". Does that happen with you as well?

Also, as I said, you can't enter anything higher than 214,7 seconds. Could you maybe give it a try?
And I'm still curious as to how you enter your time values in general e.g. for the files you uploaded. For 5 minutes did you actually just type in "5m"? Because that turns into "5ms" when I do that.

Thanks,
Red

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

Re: Macro Recorder Edit

Post by Gerry »

Hi Red,

Yes, editing directly in the Macro Recorder window is much more limited. As mentioned previously, you can only make small changes in time (as you have found out), and if you try and make larger time changes, the values either revert to what they were before you made the change, change from minutes to milliseconds, or they become the default value of -214.7s (e.g. if you try and get a 5 minute value by entering 300000ms).

So, you can't make direct changes larger than 214.7s, instead you do have to edit the macro file to make the changes you want, as mentioned. I don't enter anything higher than 214.7 seconds in the Macro editor - I use Notepad++ to edit the xml file created when I save the actions recorded in the Macro Recorder as a file.

Regarding your second file not working, having had more time to look at it more closely, I can see what the problem is. You are actually trying to get the Macro Recorder to go backwards in time after the second file save!

Regards,

Gerry
Gerry
Technical Specialist

red03
Newbie
Posts: 0
Joined: Fri Dec 06, 2019 3:55 pm

Re: Macro Recorder Edit

Post by red03 »

Hi Gerry (and Benno!),

I've been editing the files within the picoscope programme this whole time! Using an xml editor was the solution. Thanks for your help! Too bad I didn't see Bennos post right away.

Regards,
Red

Post Reply