Command line interface
SweepMe! can be controlled via a Command Line Interface (CLI) by handing over command line arguments.
Example
Open a command line (cmd) and type in the following line (assuming your currend working directory is the SweepMe! installation):
SweepMe!.exe --setting "examples/Instrument/SMU.set" --folder "SMU-Example_{y}{m}{d}" --file "IV" -r -s -c
(SweepMe! 1.5.7.3 and above)
SweepMe! will be started by loading the SMU.set example setting. Folder and file are set to test2 and test1, respectively. After start of SweepMe!, the measurement will automatically run (-r), save the data (-s), and close the program afterwards (-c).
For older SweepMe! versions, use this example:
SweepMe!.exe -setting="test.set" -folder="test2" -file="test1" -r -s -c
Command line output
SweepMe! is a GUI application, and on Windows, GUI applications do not have a console window and therefore no possibility to write messages into the console (even if SweepMe! was started from the command line). SweepMe! writes messages into the Debug window and the debug.log
file by default.
Starting with Version 1.5.7.3, SweepMe! utilises a technology to still enable output to the console, with following limitations:
- By default, GUI applications will be started in the background, returning the control to the console immediately. This will mess up the messages in the console. To prevent this, start SweepMe! in a blocking way. Using the command line (cmd), this can be achieved with following command:or using Powershell:
start "" /wait SweepMe!.exe
Start-Process -Wait SweepMe!.exe
- Output to the console will only work if SweepMe! is started from a console (cmd, Powershell) directly. Starting SweepMe! with command line arguments from an IDE might not give the desired results.
Batch processing
By using batch files, SweepMe! can be started multiple times to perform different measurements, which have previously been configured via a setting file. In that way, you can easily insert further commands between consecutive calls of SweepMe!, e.g. a time to stop or a call of another script evaluating some data.
Command line arguments
In SweepMe! 1.5.7.3 and newer, you can get a comprehensive list of supported command line arguments and examples by running following command in a command line window (cmd):
start "" /wait SweepMe!.exe -h
SweepMe! 1.5.6 and older
For older versions, the following table summarizes the command line arguments. Please note, that even the long command line arguments use single hyphens (like -setting
) instead of double hyphens (like --setting
).
Option | Explanation |
---|---|
-setting="file.set" | set setting file to specified file |
-r | run on start |
-c | close after measurement |
-s | save data after run |
-user="username" | set user to specified name (only set if user exists) |
-file="file" | set file name prefix |
-folder="folder" | set folder name |
-d | debug mode: show all error messages in ConsoleWindow |