IMD SolutionComputing LibraryShop main store

How-to

Log Modbus data on a Windows PC without programming

Edge computing and IIoT Published 7 min read

Short answer

Map the signal path first: PLC and instrument values already on Modbus TCP or RTU go straight to a no-code logger on a Windows PC, while raw analog signals need a DAQ module in front of it. Configure one test channel, verify the logger against the device's own reading, then set a sampling period and file rollover you can prove end to end.

On this page
  1. Match the logger to the signal path
  2. Read the register map before you type anything
  3. Configure one channel end to end
  4. Worked example: 10 channels at a 1-second sampling period
  5. Prove the file matches the process
  6. When a plain file is not enough
  7. Questions asked

You can log Modbus data on a Windows PC without writing any code: a no-code Modbus logging application reads holding and input registers over Modbus TCP or Modbus RTU on a schedule you set, and writes each reading to a time-stamped data file. Whether it works is decided before you open the software, by one question: where do the values already exist? Values a PLC or instrument already holds in Modbus registers go straight to the logger. A raw 4–20 mA or millivolt signal does not — it needs a data acquisition (DAQ) module to convert the signal and hold the reading in registers first. Work the path in that order: map the signal, read the register map, configure one test channel end to end, size the sampling period with real numbers, then prove the saved file against the process.

Match the logger to the signal path #

A logger measures nothing. It stores register values a device already holds, so the first decision is which device holds your values and how the logger reaches it.

Signal source Path to the file Check before you start
PLC or instrument values already on Modbus TCP or RTU The logger reads the device's registers directly over Ethernet or serial The register map documents the values you need, and you can reach the device's IP address or serial port
Raw sensor signal: 4–20 mA, millivolts, a thermocouple The sensor wires to a DAQ module's input; the module converts the reading and holds it in registers; the logger reads the module The module's input range and channel type match the signal, and scaling is set in the module

No software substitutes for the second row's hardware: pointing a logger at a bare thermocouple wire reads nothing, because there is no register anywhere to read.

If the controller also serves the same values over OPC UA, you can leave Modbus out entirely and send them straight to SQL Server, as in Logging PLC values from an OPC server into SQL Server. Otherwise, the register route below is the no-code path.

Read the register map before you type anything #

Every Modbus register is 16 bits. A whole-number channel fits in one register; a 32-bit value — a float or a long integer — occupies two consecutive registers, and which word comes first is set by the device maker, not by the protocol. Device documents usually number holding registers from 40001 upward while the address on the wire starts at zero, so a tool that expects one convention and gets the other reads the neighboring channel.

From the device's register map, write down for each channel: register type (holding or input), address, count, data type, word order for anything 32-bit, and the scaling — the gain and offset printed in the device's own documentation that turn a raw count into a temperature or a pressure.

The reference measurement is the device's own display or web page, not the logger. Confirm the reading at the device first; an error there is wiring, channel type or scaling in the device, and no logger setting repairs it. Once the device reads correctly, make the logger agree with the device — never tune the device to make a plausible number appear in the logger. When a 32-bit channel shows a huge nonsense value instead of a plausible one, swap the word-order setting in the logger's channel definition before changing anything else.

Configure one channel end to end #

Keep the whole setup read-only: a data logger should read registers and never write to coils or holding registers that command the machine, and any network change to a device other systems already use gets coordinated with them first. Then work one channel top to bottom:

  1. Put the device on the network. For Modbus TCP, give the DAQ module or PLC its IP address on the plant network. For Modbus RTU, match the serial port, baud rate, parity and slave address on both ends.
  2. Verify the reading at the device. In the module's own web or configuration interface, set the input channel types and compare each displayed reading with the signal you connected.
  3. Install the logging software on the PC from the maker's own download channel, and confirm the license covers your device type and tag count. If the logger will live in the cabinet beside the machine rather than in an office, run it on a fanless industrial mini PC built for dust, heat and continuous duty, not an office tower.
  4. Create the connection. Add a Modbus TCP connection and enter the device's IP address, or the COM port and serial settings for RTU.
  5. Define the device. Select the module from the logger's device list when it has one; otherwise enter register type, address, count, data type and word order from the map, one channel at a time.
  6. Add one known test channel. Choose a value you can check at the device, and compare the logger's live value against the device's own display before adding anything else.
  7. Set recording options. Start with a 1-second sampling period and a new file every 24 hours, and point storage at a folder the Windows account running the logger can write to.
  8. Start recording and open the file. Check that rows exist, that timestamps advance by the set period, and that the test channel matches the device.

Worked example: 10 channels at a 1-second sampling period #

Inputs. The case is one DAQ module on Modbus TCP carrying a typical batch of 10 process values. Eight channels are 16-bit unsigned integers, one register each; two are 32-bit floats, two registers each, so 8 × 1 + 2 × 2 = 12 holding registers, entered as one contiguous block. The sampling period is 1 second and the file rollover is 24 hours — the shipped defaults of this class of logger. One Modbus read response can carry up to 125 registers (a protocol limit), so all 12 travel in a single request per scan. The practical floor practitioners report for Modbus TCP polling is about 100 ms — a reported field figure, not a specification.

Rule. The logger reads the whole block once per sampling period, stores one record per channel, and starts a new file when the rollover interval elapses.

Arithmetic. A day holds 24 h × 3,600 s/h = 86,400 s. At a 1-second period that is 86,400 records per channel per day and 86,400 read requests per day — one per scan. Cutting the period to the reported 100 ms floor multiplies both by ten: 86,400 × 10 = 864,000 scans per day.

Result. 86,400 records per channel per day at 1 second. Bytes per day depend on the record format each logger writes, which its own documentation states; the record count is the part you can compute here.

Decision. Keep the 1-second default unless the process moves faster than once per second. A slowly drifting temperature gains nothing from 1-second sampling: set 10 seconds and you store 86,400 ÷ 10 = 8,640 records per channel per day, one tenth of the load. Stay above the reported ~100 ms floor — below it, a Modbus TCP link stops delivering every scan on time before anything fails outright. If the data is genuinely millisecond-rate, record it in the device or controller instead of polling over the network.

Prove the file matches the process #

A changing live value proves communication, not logging. Three readings of one value must agree: the device's own display, the logger's live value and the record in the file. A difference between the first two is configuration; a difference between the live value and the saved record is usually the process changing between samples, which is why spacing matters as much as value.

  • Compare a saved record with the device display while the process is steady.
  • Let a real change pass through — a natural one or an approved test signal — and confirm the right channel follows it in the right direction and magnitude.
  • Measure the timestamp spacing between successive records; it should equal the set period, and unexplained gaps get traced to PC restarts, sleep or network loss.
  • Wait for the rollover: after 24 hours a new file must exist and the previous one must open intact.
  • Confirm the storage folder holds the files and the Windows account running the logger has write access there.

The installation is proven once one full rollover completes with spacing and value checks passing — not before.

When a plain file is not enough #

One PC writing one file serves one consumer. The moment several people need the same values — reports, plant-wide trends, alarms — the file stops scaling, and the question changes from which logger to choose to whether a logger is the right tool at all. Do you need a historian or just an OPC tag server? walks that decision. Decide by counting consumers, not channels: one operator reading one file is a logging job; a plant that needs the same values in three places has outgrown the file.

Questions asked

Can one logger watch a Modbus TCP device and a Modbus RTU device at the same time?

Most logging tools run several connections in parallel: one TCP connection addressed by IP address and one or more serial connections addressed by COM port, each with its own slave address and polling period. The tool's documentation states its limit on concurrent connections. Budget the load across them, because every channel on every connection polls on its own period, so a PC logging four devices at one second performs four reads every second.

How many channels can I log before I need a paid license?

It depends on the package. One Windows logger of this kind, EZ Datalogger, is described by its maker as free for up to 64 tags when it logs that maker's own DAQ modules, with a paid license for other DAQ hardware or more tags. Other tools count channels, devices or connections differently, so count your tags before you choose and confirm the terms on the vendor's own site.

My sensor outputs 4-20 mA. Can the logger read it directly?

No. A Modbus logger reads registers, and a current loop is not a register. Put a Modbus RTU or Modbus TCP input module between the sensor and the network, wire the signal to an input configured for its range, and set the scaling in the module. From then on, that module's stated input accuracy, not the logger, defines how good the measurement is.

Does the logging PC have to be on the same subnet as the Modbus TCP device?

No, but it must be able to open a TCP session to the device's IP address. Across subnets or VLANs that means a route and firewall rules that allow traffic to and from TCP port 502, the port Modbus TCP uses. Keep the rules as narrow as the logging PC's own address allows, and treat an open port 502 path as an OT security decision, not a convenience.

Why does my logged data show gaps of a few minutes every night?

Check the PC's power plan first. If Windows sleeps or hibernates, the logger stops with it and the file shows a gap matching the sleep duration. Set the PC to never sleep while plugged in, and check USB power-suspend settings if a serial adapter drops out. Confirm the clock syncs to one reliable time source so timestamps before and after the gap still line up.

Keep reading

  • Troubleshooting

    Historian trend empty: PLC tag collection troubleshooting

    A live PLC value proves nothing about what the historian stored. Work one known, changing tag through four boundaries — controller to data server, server to collector, collector to point, point to chart — and with a 2 s update rate, a 1% deadband on a 200 in span and a 24 in/h fill, a 20 min window must show about 4 stored events. Zero events means the collector; four events with a flat chart means the display.

    Edge computing and IIoT

  • Troubleshooting

    Historian tag scaling for an unscaled PLC integer value

    Scale the tenths-encoded integer on the historian tag itself: linear scaling with gain 0.1 and offset 0 turns raw 144 into 14.4 while keeping the direct PLC acquisition. Check the tag's existing scaling first so a second divide-by-ten does not log 1.44, and repoint the tag at a SCADA-supplied value only if logging that stops with that runtime is acceptable.

    Edge computing and IIoT

  • How-to

    Log production data from a panel PC to SQL Server

    Run Node-RED on the panel PC, read the production values straight from the controller, and insert one row per event into SQL Server with the mssql-plus node. Keep the panel's CSV-plus-FTP file relay only as a fallback, block duplicates with a last-record check and a unique key, and expect about 86,400 rows, roughly 8.6 MB, per day at one record per second.

    Edge computing and IIoT