bg

Polling And Logging MODBUS RTU Device to Excel or OpenOffice

A complete guide to read data from MODBUS RTU serial devices and exporting parsed values directly into a Excel or OpenOffice sheets with your value-column binding.

1. Protocol Configuration: MODBUS RTU

Communication Type: Active Polling (Master/Slave over RS485/COM)

Because MODBUS transmits data in binary, the parser must extract specific Holding Registers (e.g., 40001) or Input Registers. If your sensor uses 32-bit floating-point numbers, configure the parser to read two adjacent 16-bit registers and apply the correct byte-swapping (endianness) to reconstruct the float.

Apply this base configuration for the serial connection:

{
  "port": "COM3",
  "baud_rate": 9600,
  "data_bits": 8,
  "stop_bits": 1,
  "parity": "none",
  "protocol": "modbus_rtu_serial",
  "poll_interval_ms": 1000
}
MODBUS RTU plugin selection to query and parse data.

MODBUS RTU plugin selection to query and parse data.

MODBUS RTU query queue: custom configuration to read different registers.

MODBUS RTU query queue: custom configuration to read different registers.

Ready to connect MODBUS RTU to Microsoft Excel?

2. Database Setup: Microsoft Excel

Use the 'Direct Excel Connection' or 'Local Database' export plugin. RS232 Data Logger uses OLE/DDE to write directly to .xlsx or .csv files, meaning MS Office does not strictly need to be installed on the server.

Use the following SQL script to create your target table. Limit active files to 1 million rows (Excel's maximum). Use the software's 'Log File Rotation' feature to automatically create a new Excel workbook daily or weekly to prevent file corruption.

No SQL required. Create an Excel template with headers in Row 1 (e.g., Timestamp | Port | Value). The software will automatically append new incoming serial data starting at Row 2.
Direct Excel connector selection.

Direct Excel connector selection.

Excel file location and naming.

Excel file location and naming.

Excel workbook settings.

Excel workbook settings.

Excel worksheet settings.

Excel worksheet settings.

Binding: assign your parser data to columns

Binding: assign your parser data to columns

3. Protocol-Specific Troubleshooting

  • Timeout or CRC errors: Unlike TCP, serial MODBUS RTU relies on strict timing. Verify that your RS485 A/B wires are not inverted, and that the baud rate and device ID in the software exactly matches the slave device.
  • The device returns the "Illegal address" error code: Try to use the function #3 instead of the function #4 in your MODBUS request. Otherwise, verify that you are using the correct registe address. Try to specify an absolute offset (not logical address like 40001).
  • I have several values that I want to export in one data row. Now, the logger writes one value per row: You need to enable the "Export all data at once" option in the MODBUS plugin settings.

4. Database-Specific Troubleshooting

  • File is locked or cannot be written to: If a user has the target Excel file open on their desktop, the logger cannot write live data to it. Schedule your data exports during off-hours, or log to a temporary CSV first.
  • Excel shows a strange number instead of a date value: This is a formatting issue. You can select a colum data type in our software as 'datetime' and select the necessary date format.
  • How can I add column headers for my data: You can create an empty template file and specify it in the settings. When the logger starts a new file, it copies this template to the destination folder, and starts writing data from the configured cell.
  • How to use data in the Excel file while the logger writes data to it?: Unfortunately, it is not possible. But, for example, you can create a new Excel file more frequently and use a closed (previous) Excel file for your needs. Or use a database instead and link to your sheet as a data source.

Ready to connect MODBUS RTU to Microsoft Excel?

Product Buy Download Support Contacts Site map
Copyright © 1999 - 2026, AGG Software.
All rights reserved.. Terms of use | Privacy policy