Serial Port Monitor provides command line options to launch and start monitoring serial ports automatically:
SerialMonitor.EXE /new PORT [A] [T] [L] [R] [D]
- “PORT” defines the serial port to monitor (COM1, COM4, etc.)
- “A” means that monitoring should be started automatically once you press the “Enter” button
- “T” means that “Table View” should be toggled on
- “L” means that “Line View” should be toggled on
- “R” means that “Terminal View” should be toggled on
- “D” means that “Data View” should be toggled on
SerialMonitor.exe /new COM1 ATLRD
This command launches Serial Port Monitor and straightaway opens COM1 port. All visualizers are enabled.
Command-line syntax to start a new session:
> SerialMonitor.exe /New <com-port> [<session-option>] [<session-option>] ...
Command-line syntax to open an existing session:
> SerialMonitor.exe <session>
> SerialMonitor.exe /Open <session> [<session-option>] [<session-option>] ...
All keys and switches are case-insensitive.
An option can either specify views to show or set up data redirection for the specific view.
<session-option> ::= <show-views>|<configure-redirect>
To disable monitoring auto-start, put the ‘-‘ after ‘A’.
<show-views> ::= <show-view-character>+
<show-view-character> ::= <view>|<autostart>
<autostart> ::= A[-]
<view> ::= T|L|D|R
Redirection setup starts with one
<configure-redirect> ::= <view>:[<split-or-limit-config>:]<file-format>=<file-name>
<split-or-limit-config> ::= <split-on-time>|<split-on-size>|<limit-to-size>
To create a new file with given
<split-on-time> ::= T=<time-interval>
To split the output into a bunch of files not bigger than
Note: The actual file size can be bigger if data is coming too fast.
<split-on-size> ::= S=<file-size>
To limit the file size to the specific value, use the ‘L’ parameter. When the current file size will be bigger than
<limit-to-size> ::= L=<file-size>
<time-interval> ::= <number>[H|M|S]
Note: Do not use 1.5h or 1h30m as argument, it won’t apply. Instead, use 90m.
<file-size> ::= <number>[M|K]
Note: Do not use 1.5M, use 1500k or just 1500 instead.
For Table view, you can also specify C to redirect data as Comma separated values (CSV).
<file-format> ::= A|U|H|C
To append data to a file instead of overwriting it, add ‘:A’ at the end of the file’s name.
> SerialMonitor.exe /New COM1 TA- L:L=1M:H=LineView.html r:a=Terminal.txt:A
– Start a new session to monitor COM1;
– show Table view (T), do not start monitoring immediately (A-);
– show Line view (L:), redirect data from it into LineView.html in HTML format (H=), limiting (L) LineView.html file size up to 1 MB (=1M) (LineView.html back-uped version will be named LineView-old.html);
– show Terminal view (r:), redirect and append data from it into text file Terminal.txt in ANSI encoding (a=).