bg

MODBUS Slave Emulator: Advanced Serial Port Monitor Plugin Guide

The Professional Solution for MODBUS Simulation

Testing a MODBUS master device (such as a PLC, SCADA system, or HMI) often requires a physical slave device. However, hardware can be expensive, inaccessible, or still in development. The MODBUS Slave Emulator plugin for Advanced Serial Port Monitor bridges this gap by turning your PC into a fully functional "digital twin" of a MODBUS hardware device.

The plugin supports both MODBUS RTU and MODBUS ASCII protocols and allows you to simulate Holding Registers, Input Registers, Coils, and Discrete Inputs.

MODBUS simulator plugin window

Tutorial: Starting Your First Slave Emulation

Follow these steps to simulate a slave device on your COM port:

1. Configure the Physical Layer

Open Advanced Serial Port Monitor and select the COM port you wish to use. Ensure your baud rate and parity settings match your master device. Click the "Open" button. ASPM will connect to the selected COM port and start listening on it.

2. Enable the Plugin

Navigate to the Plugins menu and open the MODBUS ASCII/RTU slave and master simulation module.

3. Set Slave Parameters

Using the interface (see the reference image below):

  • Mode: Set to Slave.
  • Protocol: Choose MODBUS RTU or ASCII.
  • Device ID: Set the Slave ID (e.g., 1).
  • Function: Choose the register type (e.g., 03: Holding Registers).
  • Address & Length: Define your start address (e.g., 1) and how many registers to simulate (e.g., 100). The plugin will report an exception code if a master requests data out of the specified range.

4. Populate the Memory Map

The grid labeled Memory Map represents the internal memory of your virtual device. You can also scan the device's memory map online.

  • Double-click any cell to enter a value.
  • Use the "View as" dropdown to change how data is displayed (Float, Unsigned decimal, Signed, Hex, etc.). If you change the data view mode, you can enter data in the selected format (not RAW register's values).

5. Monitor Traffic

Once your Master device begins polling, switch to the Traffic tab. Here, you can see the raw request/response packets in real-time, helping you debug timing issues or CRC errors.

Typical Usage Scenarios

1. HMI and SCADA Screen Development

Engineers can build entire HMI screens or SCADA dashboards before the actual PLC or sensors are installed on-site. By using the emulator, you can verify that every "tag" points to the correct register and that the scaling (e.g., converting a raw integer to a temperature) is functioning as expected.

2. Software Driver Validation

If you are developing a custom software application that acts as a MODBUS master, you need a reliable slave to test against. The emulator allows you to test how your software handles large data blocks, slow response times, unexpected register values, or other MODBUS errors without risking hardware damage.

3. Testing Error Handling and Exception Responses

A critical part of industrial reliability is knowing how a system reacts to errors. You can use the plugin to simulate MODBUS Exception Codes (like 01: Illegal Function or 02: Illegal Data Address). This allows you to verify that your master controller correctly identifies and logs faults rather than simply crashing or displaying "zero."

Some other Serial Port Monitor advanced features

Expert Perspective: Data Integrity and Timing

In a professional MODBUS setting, this plugin isn't just a simple data transmitter. It translates data into register values, generates appropriate responses to master queries, and handles CRC and LRC checksum calculations on the fly.

One of the most powerful features for experts is the ability to save your Memory Map to a file (.mbmap). It lets you make "profiles" for various kinds of hardware. For example, you can have a "Power Meter Profile" and a "Temperature Controller Profile", switching between them in seconds to perform comprehensive system audits.

After testing, you can implement logn-time MODBUS data logging system in your application.

See also

Automated Hardware Validation
Identify Active Nodes: MODBUS Device Scan Plugin Guide
ASCII and Binary Device Emulation: Advanced Serial Port Monitor Plugins
MODBUS Slave Emulator: Advanced Serial Port Monitor Plugin Guide
RS232 Analyzer from Advanced Serial Port Monitor
RS232 Monitor
RS232 Port Sniffer