Command-Line Options

Serial Port Monitor provides command line options to launch and start monitoring serial ports automatically:

			
  SerialMonitor.EXE /new   
      PORT
      [A] [T] [L] [R] [D]

where

  • “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

Example:

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:

Either:

> SerialMonitor.exe <session>

or:

> SerialMonitor.exe /Open <session> [<session-option>] [<session-option>] ...

Where:
is the name of a serial device to monitor.
is file name with the saved session to open.

All keys and switches are case-insensitive.

Each is a separate argument for SerialMonitor.exe, so they should be space-separated.
An option can either specify views to show or set up data redirection for the specific view.
       

<session-option> ::= <show-views>|<configure-redirect>

The option is a string containing views to show and the ‘A’ character if monitoring should be started automatically.

To disable monitoring auto-start, put the ‘-‘ after ‘A’.

<show-views> ::= <show-view-character>+

 

<show-view-character> ::= <view>|<autostart>

 

<autostart> ::= A[-]

The specific character can be: T for Table, L for Line, D for Dump or R for terminal.
       

<view> ::= T|L|D|R

Redirection setup starts with one character followed by colon ‘:’, contains optional and ends with character and , separated with ‘=’ character.
       

<configure-redirect> ::= <view>:[<split-or-limit-config>:]<file-format>=<file-name>

The parameter is used to split file with the redirected data into a bunch of files or to limit the redirected file size.
       

<split-or-limit-config> ::= <split-on-time>|<split-on-size>|<limit-to-size>

To create a new file with given , use the ‘T’ parameter. The current time will be added to a file name as YY-MM-DD hh-mm-ss.
       

<split-on-time> ::= T=<time-interval>

To split the output into a bunch of files not bigger than , use the ‘S’ parameter. The current time will be added to a file name as YY-MM-DD hh-mm-ss.
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 , it will be renamed to -old.
       

<limit-to-size> ::= L=<file-size>

The is a number optionally followed by ‘H’, ‘M’ or ‘S’ character to specify Hours, Minutes or Seconds. If no such character is present, is measured in seconds.
       

<time-interval> ::= <number>[H|M|S]

Note: Do not use 1.5h or 1h30m as argument, it won’t apply. Instead, use 90m.

The is a number optionally followed by ‘M’ or ‘K’ (for Megabytes or Kilobytes). Kilobytes are the default.
       

<file-size> ::= <number>[M|K]

Note: Do not use 1.5M, use 1500k or just 1500 instead.

To choose in which data will be redirected, use ‘A’ for ANSI text files, ‘U’ for Unicode text (UTF16-LE), ‘H’ for HTML.
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.

Example:

> 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=).