PicoScope 6 automatic use with batch file PicoScope_Run.bat

Forum for discussing PicoScope version 6 (non-automotive version)
Post Reply
Lucas
Newbie
Posts: 0
Joined: Thu Feb 06, 2020 8:30 am

PicoScope 6 automatic use with batch file PicoScope_Run.bat

Post by Lucas »

I created this topic just to share my findings hoping that it will be useful…

The attached zip file contains:

Make_WindowsAppl_Active.vi (md5: 080af91d82820a1e5395e0c4e527131b)
PicoScope_CSV-File_to_XY-Graph.vi (md5: 7c89d3f21046568988af4273f5550b6c)
PicoScope_Macro_Workaround_RealTime.txt (md5: 9e6719d9e00310f5359ad73ad1815ead)
PicoScope_preferences.xml (md5: c53199b03c368367e56bda5873df3e9e)
PicoScope_ReadMe.txt (md5: 2f8bd37e85694a20ec2ecccffea7ef1b )
PicoScope_Run.bat (md5: 388345fce3bfa21808ea83887445e808)
PicoScope_Settings.pssettings (md5: 9a7ad0ed85c88117c5525a5eb39d3e8d)
PicoScope_SetUp.psmacro (md5: 758db05d278613a4ab86da5b9eb5c97a)
PicoScope_Waveform.csv (md5: d0ffc411ba6df27304bf8a4490d2ee1a)
RunDetached.exe (md5: 9c973fb171601166525a60c2c0e25df3)


PicoScope_ReadMe.txt:
Launch the "PicoScope_Run.bat" e.g. from the LabView "System Exec.vi"

No need for setting the Working Directory it's set within the batch file.

All files resides into the same directory!

First is checked if an instance of PicoScope is already running.
If it's not a new instance will be started, if it is, that one will be used for settings and querying.
Before starting a new instance a costumized "preferences.xml" is copied to the user AppData directory. This because some settings can't be set automaticly in an other way, for example the waveformbuffer amount.
If the dedicated commandline parameters are present the next commands are run in this order:

First if present the "StartWithAllChannelsOFF" parameter, all channels/probes will be put into the off state.

Second if present the "PicoScope_Settings.pssettings" file it will be loaded into the PicoScope sw

Third if present the "PicoScope_SetUp.psmacro" file it will be run from the PicoScope sw.

Fourth if SaveCSV is present as a parameter the "PicoScope_Waveform.csv" will be saved in the same path location of this batch file with the PicoScope waveforms exported. The "PicoScope_CSV-File_to_Waveform.vi" can be used for importing this file into a LabView waveform graphic.

Aavalable measurements from PicoScope are sent to the Standard Output.

If error, return code (ERRORLEVEL) is not zero.

PicoScope is left running in background for speeding up the next run(s). Use "Make_WindowsAppl_Active.vi" to bring the PicoScope window to the foreground.

Command line examples:

PicoScope_Run.bat
PicoScope_Run.bat StartWithAllChannelsOFF PicoScope_Settings1.pssettings SaveCSV
PicoScope_Run.bat PicoScope_SetUp5.psmacro PicoScope_Settings3.pssettings
PicoScope_Run.bat SaveCSV PicoScope_Settings7.pssettings PicoScope_SetUp9.psmacro
Attachments
PicoScope6_automatic_use_with_batch_file.zip
(117.41 KiB) Downloaded 610 times

Post Reply