Serial

The Serial plugin for IO Ninja is a powerful, versatile serial terminal designed for embedded developers, hardware engineers, and IoT enthusiasts. It supports text and binary data views, interleaves serial events with data for a complete timeline, and includes advanced features like regex colorization, real-time checksum calculations, and customizable packet templates.

Capabilities

Required

Required for establishing serial links.

Optional

Enables ability to programmatically prepare and transmit packets, which can be very useful when debugging serial communications.
Helps users organize commonly used packets, give them mnemonic names, and quickly send them to the wire. It also enables the recent packet history list.
Enables the regex-based markup of binary data in the log.

Basic Setup

  1. Ensure your serial device is connected to the computer that is running IO Ninja.
  2. In IO Ninja, click the “New Session” dropdown and select a new “Serial” session.
_images/serial-new-session.png
  1. If not selected automatically, select your serial device from the “Port:” dropdown.
_images/modbus-port.png
  1. Open the port by clicking the “Open” button located to the right of the “Port:” dropdown.
_images/modbus-open-port.png
  1. Monitor traffic in the “Serial” window.
_images/serial-traffic.png
  1. Adjust settings as needed via the “Settings” button (see “Settings” section below for details).
_images/modbus-settings.png

Craft Serial Packets

  1. In the “Transmit” pane, type your binary packet and press “Send”.
_images/serial-craft-packet.png

Settings

_images/serial-settings.png
Setting Description Default
Port The port that should be used.  
Reopen on error Attempt to re-open port if disconnected on error, e.g., due to manual unplug of USB-to-Serial device. False
Reopen timeout Delay to insert between re-open attempts. 3000
Baud rate The serial baud rate. 38400 bps
Data bits Serial data bit count (word size). See available options. 8 bits
Parity Serial parity check type. See available options. None
Stop bits Serial stop bit count. See available options. 1 bit
Flow control Serial flow control. See available options. None
DTR State of the DTR (Data-Terminal-Ready) modem control line. True
RTS State of the RTS (Request-to-Send) modem control line. False
BREAK Enable the BREAK condition on the TX line. False
Read mode
(Windows-only)
Advanced read request-specific options. See available options. Wait for the 1st char
Read inter-char interval (ms)
(Windows-only)
Maximum inter-character delay during read request. 10
Read parallelism
(Windows-only)
Maximum number of read requests to issue in parallel. Having more than one pending read at a time helps with increasing read throughput when incoming data arrives in rapid streams (after filling one user buffer, the kernel can immediately switch to the next one without any waiting). Increasing this number beyond 4 usually won’t yield any extra performance gains. 4
Read block size (B) The size of each individual read block submitted to the underlying transport. 4KB
RX buffer size (B) The full size of the incoming data (RX) buffer. Affects read throughput. 16KB
TX buffer size (B) The full size of the outbound data (TX) buffer. Affects write throughput.. 16KB
Keep read block size Don’t merge read blocks in RX buffer. Incoming data blocks coming in quick succession can be merged together so that IO Ninja writes them to log as a whole. When this option is set to True, blocks are written to the log without merging, i.e., exactly as they are received from the underlying transport.. False
Keep write block size Don’t merge write blocks in TX buffer. Outbound data blocks sent in quick succession can be merged together before submission to the underlying transport. When this option is set to True, blocks are submitted to the transport without merging, i.e., exactly as they are sent by the Transmit or Script panes.. False
RX buffer full notifications Toggle warnings in log about the incoming data (RX) buffer getting full. False
Serial setting changes Toggle notifications about serial setting (baud rate, data size, parity, stop bits, flow control) changes in the log. on
DTR/RTS changes Toggle notifications about control line (DTR, RTS) changes in the log. on
DSR/CTS/DCD/RI changes Toggle notifications about status line (DSR, CTS, DCD, RI) changes in the log. on
Serial line errors Toggle warning about serial line errors (PARITY, FRAMING and BREAK) in the log. on

Data Bit Options

Option
5 bits
6 bits
7 bits
8 bits

Parity Options

Option Description
None No parity bit is used
Odd Odd parity (parity bit is set when the number of logical ones in the UART frame is odd).
Even Even parity (parity bit is set when the number of logical ones in the UART frame is even).
Mark Parity bit is present and always set.
Space Parity bit is present and always clear.

Stop Bit Options

Option
1 bit
1.5 bits
2 bits

Flow Control Options

Option Description
None No flow control.
RTS/CTS Hardware flow control using CTS and RTS lines.
XON/XOFF Software flow control using XON and XOFF lines.

Read Mode Options (Windows-only)

Option Description
Check COMSTAT.cbInQue Prior to reading, check the status of the incoming buffer of the serial driver. Only read the number of bytes available there.
Wait for the 1st character Read requests return as soon as possible (as soon as at least one byte arrives).
Interval-based Read requests keep accumulating bytes until the inter-character delay exceeds the limit specified by “Read inter-char interval (ms)” or the buffer is full.

Note

Typically, it’s best to leave the Read Mode setting at its default (Wait for the 1st character), unless compatibility issues require a change. The default setting is optimal in most situations.