(updated January 2024)
Modbus is a communication protocol for industrial devices developed in 1979 by Modicon, now Schneider Electric.
A Modbus network consists of up to 247 Servers (originally Slave), and typically one Client (originally Master). A server is commonly a dedicated end-point device, such as a sensor or control device, and a client is commonly a Programmable Logic Controller (PLC) or gateway device in a SCADA network. A client reads or writes to the Coils and Registers in a server, whose purpose is unique to that server.
A Modbus communication starts when a client sends a message to a specific server, either requesting current coil states or register values, or sending states or values for the server to use. The server responds with either the requested data, or confirmation the sent data was accepted.
Modican designed the Modbus protocol for their PLC products, and freely provided the specification so that others could communicate with their PLCs. Modbus has since become a de facto industry standard for industrial devices, due at least in part to the specification being freely available to use. Modbus has evolved over time to remain current, starting with Modbus ASCII using serial RS-232 and RS-485 communications, then binary Modbus RTU for efficiency (also using RS-232 and RS-485), and more recently Modbus TCP for use with Ethernet networks.
The Modbus specification is now controlled by Modbus.org, a U.S. non-profit trade association, which continues to freely publish the Modbus protocol specifications and related technical resources.
Interest in Modbus has surged recently for use in the Industrial Internet of Things (IIoT). Modbus TCP enables data to be exchanged over a wide network, leveraging the advantages of Ethernet and the IwIP network stack for wireless end devices.
For testing and evaluation, general purpose Modbus software running on a desktop or laptop computer is often more convenient than using a purpose-designed Modbus device. A Modbus Client (Master) simulator can be used to query data from devices, and can be a valuable test tool when developing a Modbus Server (Slave) device. A Server (Slave) simulator can be useful as a digital twin for verification testing when developing a physical slave device, or as a device to interact with when developing a Modbus Client.
The following is a non-comprehensive list of available Modbus Server and Client software. If one of these doesn’t quite suite your needs, you consider adapting an existing open-source project or create your from-scratch solution using an open-source Modbus library.
Please post a comment to say if you have found any of these useful, or if you use software that is not listed.
Free Client (Master) Simulators
CAS Modbus Scanner
CAS Modbus Scanner is free Windows-only software from Chipkin Automation Systems recommended by Stephen. CAS Modbus Scanner can retrieve coils, inputs, holding registers, and input registers (displaying values in a variety of formats), and also discover Modbus devices on a network (testing every address, function, length, and offset to check for exceptions or responses). Source is not provided.
The scanner function came in handy recently when I used it as part of the verification test program for a new industrial controller.
ModbusScope
ModbusScope is a free open-source cross-platform app for capturing and graphing Modbus data. In the past, I would capture Modbus data using Modpoll and hammer the output into CSV with sed, or use ModScan to capture CSV directly, and plot using using either DatPlot or spreadsheet software. However, thanks to Ben’s comment, ModbusScope is now my go-to for data logging and capture when I’m looking at three or fewer registers from up to three devices.
ModbusScope is a Qt app and coded in C++, and uses muparser (“fast math parser library”) and QCustomplot (“easy to use plotting widget for Qt”), with icons from Lucide.
Modbus Tester
Modbus Tester from Schneider Electric is a free proprietary Windows GUI program for reading Modbus registers, and supports Modbus RTU and TCP. I found “Tester” did what it claimed, but it didn’t do anything better than I was already doing with other software.
modpoll
modpoll from proconX is a command-line program for Windows and Linux. It supports Modbus ASCII, RTU and TCP, and is a de facto standard based on the number of references it has on the web.
proconX provides modpoll as reference software for their commercial driver libraries. Source is provided, but compiling requires a paid license for the libraries.
mbpoll
mbpoll is an open source (GPL-3) cross-platform command-line utility based on libmodbus (see Libraries). It supports Modbus RTU and TCP and is available in many (most?) Linux distributions. mbpoll conveniently uses similar output syntax and command options as modpoll, I use mbpoll on a Linux Mint test computer and the two are essentially interchangeable. Unfortunately, although mbpoll claims to be multiplatform, I haven’t found a pre-built Windows binary and have found building from source on Windows to be problematic (if you are building mbpoll on Windows, please submit a comment explaining your procedure).
QModMaster
QModMaster is a free open-source Qt-based Modbus master based on libmodbus (see Libraries below). QModMaster is licensed using the LGPL and includes a bus monitor for examining traffic on the bus.
A binary executable is available for Windows, but using on Linux will require compiling the from source using Qt Creator (which I was unable to do successfully, so on Linux I use ModbusScope or Scanbus-BR when I prefer GUI software).
RMMS
Radzio! Modbus Master Simulator (RMMS) is a free proprietary Windows utility (GUI) and claims to replace commercial ModScan and Modbus Poll utilities. It supports Modbus RTU and TCP, and multiple Modbus slave devices.
Scanbus-BR
Scanbus-BR is is a free cross-platform multi-lingual Modbus RTU and TCP GUI client (Windows and Linux, and Portuguese, Spanish and English). Rodrigo Hernandes created Scanbus to scratch his own itch and released it publicly to help others and as a demo to support his project development work (he is also a Brazilian, which presumably is the reason for the “- BR” suffix). I found the charting capability very handy (plotting up to six registers vs time), and having register values shown in integer, hex and binary simultaneously saved time by not having to convert or switch display formats.
Paid Client (Master) Simulators
Modbus Poll
Modbus Poll from modbus tools was designed to help developers of Modbus slave devices and others to test and simulate the Modbus protocol. Using a multiple document interface, several Modbus slaves and/or data areas can be monitored at the same time. US$129 per developer. The modbus tools website also has a good intro to Modbus.
ModScan
ModScan from WinTECH Software was developed to verify correct protocol operation in new or existing systems. ModScan supports an arbitrary number of queries, each with its own document window, and you can create your own custom windows and add content using the provided widgets (for example, using the trendline display shown below, which can plot up to four difference sources in one display). The data from each document window can be logged to its own data file.
Extensions provide third-party data acquisition using Control Automation routines or the MS Jet Database engine, and a debug mode displays raw serial data to and from a connected device. A single-user license cost US$65 when I last checked.
Simply Modbus Master
Simply Modbus Master (RTU and ASCII ). The Free mode allows six request messages before the application must be re-started. C$60. A slave simulator and TCP client are also available. The website has a nice intro to Modbus and Modbus Enron.
Free Server (Slave) Simulators
ModRSsim2
ModRSsim2 was forked from MOD_RSSIM and includes compiling on Visual Studio 2010. ModRSsim2 supports RS-232 and TCP/IP connections, the full range of Modbus addresses for all four Modbus types (0xxxxx, 1xxxx, 3xxxx, & 4xxxx addresses), as well as diagnostics with complete traffic byte capture and logging capability. ModRSsim2 supports CSV loading and a scripting environment for testing as well as HTML custom displays. It is free and open-source, and licensed under the GPL.
MOD_RSSIM
MOD_RSSIM is a Windows-based Modbus PLC Simulator (and parent of ModRSsim2). It is free and open-source, and started as a test program for a SCADA/HMI with Modbus RTU and TCP/IP. Typical uses are to verify device configuration, support development of Modbus master and slave drivers for embedded and desktop platforms, and as an educational tool to learn Modbus protocols.
pyModSlave
pyModSlave is a free and open-source Qt-based Python-code ModBus RTU and TCP slave from the developer of QModMaster. A Windows executable is provided and pyModSlave includes a bus monitor for examining all traffic on the bus. pyModSlave is licensed under the LGPL
UnSlave Modbus Slave Simulator
UnSlave Modbus Slave Simulator . UnSlave simulates any number of Modbus slaves. UnSlave is provided free from Unserver, possibly as a source of test data for Unserver’s Modbus REST API Server, which provides data from Modbus networks and devices to higher-level clients – and is monetized. The informative Complete Modbus Guide is also provided by Unserver.
Paid Server (Slave) Simulators
SimServe
SimServe by SCADAmatic can simulate Modbus ASCII, RTU, or TCP/IP. It provides a user interface for setting up a network topology of multiple devices simultaneously. The developer James brought it to my attention, and was kind enough to provide a guest key for evaluation. SimServe could be a valuable development aid if you are developing SCADA software and need simulated devices for testing, or if you are developing a device and could benefit from having a digital twin for comparison (assuming SimServe is capable of simulating your device).
WinModbus
WinModbus is a Modbus Slave Simulator for Windows. When I found it, the price was GBP62.50 which included lifetime support. A 14-day functional demo is available, and there is an attractive polished website.
Libraries
A number of Modbus libraries are available to leverage application development.
FreeMODBUS
FreeMODBUS is a free open-source implementation of the Modbus protocol with separate ASCII/RTU and TCP ports for a variety of embedded systems. I can recommend FreeMODBUS based on first-hand experience replacing a DIY protocol stack in an embedded industrial controller with an 8-bit MPU. FreeMODBUS is licensed using the BSD 3-clause license.
libmodbus
libmodbus is a free open-source library for Linux, Mac OS X, FreeBSD, QNX and Win32. The library is written in C, supports RTU (serial) and TCP (Ethernet) communications, and is licensed using the BSD 3-clause license. QModMaster, pyModSlave and mbpoll (reviewed above) use libmodbus.
Other Resources
Peter Chipkin has a nice list of Modbus-related tools on the CHIPKIN website, including their own CAS Modbus Scanner, which is handy for investigating the functions, coils and registers supported by a device.
com0com is a free open-source kernel-mode virtual serial port driver for Windows. An unlimited number of virtual COM port pairs can be created, and any pair can be used to connect one COM port based application to another. The module is signed with a test certificate, and requires configuring Windows to load test-signed boot modules.
Hi Dale, ScanBus-br version 0.9.8 is now available, it includes more plotting tools to be even more versatile for data visualization.
I found a couple projects I found super interesting (I liked it). OpenModSim and OpenModScan are clones of Modsim and Modscan. OpenModSim has most (if not all) of the Modsim functions plus some extra functions. I detected some small bugs, but nothing that hinders use. Binaries are provided for Linux (.deb) and Windows (.exe installer). I only tried the Windows version. For those who are used to classic Modsim / Modscan, they are great free alternatives.
OpenModScan (Master): https://github.com/sanny32/OpenModScan
OpenModSim (Slave): https://github.com/sanny32/OpenModSim
I have a Modbus Master Simulator available Who wants to try it it’s freeware available for Windows 64 bits and Linux 64 bits (Ubuntu and Xubuntu)
https://www.intexp.com.br/donwload/scanbus_br/scanbus_br.html
Thanks Rodrigo for posting. I executed the Linux version on Linux Mint Cinnamon v21.2 and can confirm the GUI renders correctly. I don’t have a Modbus server (sensor) connected, but will experiment more next week and add Scanbus to the main post.
Cheers,
Dale
Let’s step by step.
First of all, I’m Brazilian, English is not my native language, so sorry if parts are confusing.
“Why did you create Scanbus?”
Previously it was just a personal tool, used to configure a development board that was made with dspic. The appearance was much simpler, I only started to “improve” on the appearance after I decided to distribute it to the industrial automation people.
The reason I made this tool is that:
1. In the beginning, when I was making a modbus library for a microcontroller, I didn’t adapt very well with “modbus poll”, as I had to keep going into menus and internal windows to change settings to test my library.
2. In my country things are a little more complicated lol… either I would buy a license from “modbus poll” or modscan or use a cracked one, as I intended to use in my service, this second option wouldn’t work either.
3. You will rarely find simulator software that works on Linux, especially in graphical mode.
“What development tools did you use?”
It is made in Lazarus, the language is Pascal.
“Why did you choose to release Scanbus as freeware and not FOSS?”
1. The main objective at the moment with this software is just an “attraction or advertisement” for other things I intend to do, it is just a complimentary software, my profession is actually with electronic projects, so maybe I will do some things related to electronics for selling, the software and another “gig” for the site and the name itself.
2. As I said before, I live in Brazil and here things are a little more complicated lol, I could do it in free software and have someone take the source code, say it’s theirs, and still sue me…
“Do you plan to eventually sell Scanbus as a product?”
No, it’s not my intention at the moment and I honestly don’t think it will ever be, they already told me to charge for it, but I refused, I remember the difficulty of finding good free software to start creating the library, maybe the next one “Rodrigo “Have the pleasure of meeting him and making your work easier.
————————————————————-
Just a few considerations:
1st, as you are running on Linux, if you are going to use RTU mode, the serial port must be free for your user.
If it doesn’t work, I suggest the following command in the terminal
sudo adduser USERNAME dialout
After giving the command restart the operating system.
Scanbus-br has many functions, but I haven’t made a manual for it yet. If you have any questions, don’t hesitate to get in touch.
hug
Dale Scott, thank you very much for doing a review of the software, I think you are the first site to review the software.
As it is still in the final stages of development, there are still a lot of updates taking place.
Good morning.
I posted a new version of Scanbus-br (0.9.2), in this version there are not many new features, but there are many corrections (mainly for Linux) and now Linux can have a dark theme.
The only new thing is that you can now adjust the time for signaling changes (in seconds) in “Wide Vision”.
Are there any slave simulators that simulate single and/or triple phase power/energy-meters?
Hi Bart, thanks for your question. If you have a particular commercial device in mind, please reply with a link so I can understand the device better.
I haven’t come across any slave simulators that simulate a specific device, but on the other hand I haven’t really looked for any. However, the slave simulators I’ve listed can generally be configured to expose whatever registers you wish, such as the registers your power/energy meter provides, although the register data returned will be nonsensical compared to the actual device.
If you want to simulate the _behavior_ of the device, then I would probably start with pyModSlave and extend the simulation function so it behaves like an actual real power/energy meter. I hope you write back and clarify your use case, it sounds intriguing!
Cheers, Dale.
Hi Dale,
something like https://www.eastroneurope.com/products/view/sdm630modbus or https://new.abb.com/products/2CMA100164R1000/b23-112-100
Thanks for the links Bart. I found manuals with descriptions of the Modbus interfaces – there are a LOT of registers! Also the registers are organized in two or more blocks, with one set of registers providing measured or calculated data (and at least for the SDM630 seemed could be written to, although I’m not sure why a user would want to), and one set of registers controlling the device configuration. I also noted the SDM630 manual advised that user interface software is available that might be be more convenient to use than the Modbus interface (especially if the device is configured to require a password to change settings).
You could configure one of the slave simulators listed in the post to expose registers in the same ranges as these devices, it may not be possible to configure the _exact_ same registers, but probably not too difficult to modify a simulator such as pyModSlave if this was essential. It would take more work if you want the data in the registers to approximate a real device configured in a specific way, and a LOT more work if you want the data to respond like a real device (e.g. to have the calculated power change appropriately if the sytem voltage is changed, given the same measured current).
I hope this is of help. Certainly anything is possible given enough time and motivation! 🙂
If anyone is interested, here are the manuals that Google found (no guarantee though they are the correct versions):
Eastron SDM630
ABB B23 112-100
“there are a LOT of registers”
Especially the triple phase ones and the models that also come with bidirectional measurements.
“and one set of registers controlling the device configuration”
Some provide an interface with buttons on the device itself to config everything (address, baudrate etc), while there are also some that allow to change settings through modbus.
“I also noted the SDM630 manual advised that user interface software is available that might be be more convenient to use than the Modbus interface (especially if the device is configured to require a password to change settings).”
Windows only as far as I can see, so not convenient when the device intended to access and process the data is (for example) a Raspberry Pi.
“You could configure one of the slave simulators listed in the post to expose registers in the same ranges as these devices, but it may not be possible to configure them for the _exact_ same registers – but probably not too difficult to modify e.g. pyModSlave if required.”
Well, I was hoping someone already had done something like this, which I could work with.
“It would be more work if you want the data read from the registers to approximate data from a real device configured a specific way, and a lot more work if you want the data to respond to changes in configuration (e.g. the calculated power changes appropriately if the sytem voltage is changed, given the same measured current).”
Changing values like in a real world situation would be great :). In the case of kWh-counters as simple as incremental, voltage varying around 230V and power also varying (up to couple thousand watts or so).
Are there any Python-based slave simulators that might be capable of doing this?
Sorry Bart, if there is such a simulator I’m not aware of it.
pyModSlave has the basics, and could make a good starting point. You might consider contacting the developer to discuss the posibility and potential development stratgies.
Another option might be to develop your simulator using a simulation environment such as GNU Octave. There is a Modbus toolkit for interacting with devices as a Modbus Master, which could possibly be used as a guide for creating a Slave toolkit.
Good luck whatever path you take!
If you would like to generate modbus traffic, I need a Server and a client.
Ideally the client would simulate values continuously that can be read.
Is there any opensource solution for this ?
Hi Modbus, please clarify what you mean by “simulate values continuously that can be read” so I understand correctly.
A Modbus “Server” (aka Slave) provides data (in “registers”) for reading by a Modbus “Client” (aka Master). Do you want the server to simply provide changing register values so that the client gets different data values when it reads from the server? If so, PyModSlave can do this, but the data will be random (IIUC).
If you want to simulate a specific process (e.g. a temperature change from 0C to 100C over 5 minutes with some given resolution), you could replace the random simulation code in pyModSlave with your desired simulation.
If you also need a Client (aka Master) simulator, you might consider QModMaster. It is developed by the same developer as pyModSlave, and in relatively active development (fwiw, I have used PyModMaster for simple register reading).
If you need to graphically plot the server data, you might consider ModbusScope. I added ModbusScope to the list recently after receiving a comment recommendation, and can say based on a (brief) evaluation that it works very nicely for the purpose.
Good luck!
We use ModbusScope extensively which is an open source pet project by a colleague https://modbusscope.readthedocs.io/en/stable/
Thanks Ben! ModbusScope look very cool and I will be testing it tomorrow! For the benefit of others, ModbusScope is a cross platform Qt app, coded in C++, and uses muparser (“fast math parser library”) and QCustomplot (“easy to use plotting widget for Qt”) libraries, and Lucid icons.
I was thinking it would be a nice educational exercise to work through building ModbusScope on both Windows and Linux. Is it hard to build? I didn’t see a makefile (so that’s how much I know! 😉 ).
It’s QT so should be pretty straightforward, but I must admit I am mainly an avid user. The dependencies are bundled with it. You could always take a peek at the .github folder with the workflows that show the commands used in CI.
I know this post is a few years old, but I wanted to toss out another commercial product that functions as a Modbus Simulator. It’s called SimServe by SCADAmatic. It can simulate Modbus ASCII, RTU, or TCP/IP. It provides a user interface that allows the user to setup a network topology of multiple devices simultaneously.
Fyi, the SimServe URL is https://www.scadamatic.com/ for anyone who hasn’t discovered that Jame’s name links there (I hadn’t Doh!).
Fyi I took a quick look at SimServe and installed it with a guest key (thanks James!). It looks like an interesting product, although I haven’t had time to do any thorough testing yet.
I hope to start working on a client soon for configuring and monitoring the Kayden CLASSIC flow transmitter and switch. I will need to setup a small network for testing, and will include a SimServe server on the network. Watch out for a post on my progress.
I wanted to give Eltima Serial Port Monitor a shout-out. Eltima is commercial proprietary software with a two week trial period, which was put to very good use.
https://www.eltima.com/products/serial-port-monitor
Having used Modbus Poll and ModScan32 for many years (I particularly liked the register naming feature in the former) I initiated a development project in-house to make a master simulator that would allow us to work with the kind of instrument specifications we typically have to exchange with out customers (mixing different register and data types, applying scaling, units, descriptions, grouping etc.). I also wanted the ability to trend and log values and get help during debugging by getting the traffic decoded / described in text. So now there is another shareware option available:
https://www.softpedia.com/get/Others/Miscellaneous/Modbus-Test-Master.shtml
Little late to the party here, but I wanted to share an open source multipurpose Modbus GUI tool I have been working on called ModbusMechanic. It’s Java based so it runs on any platform.
I originally wrote it to quickly read and simulate float data from instruments but now it does quite a few other things including act as a TCP->RTU gateway and scan the RTU bus for active nodes. Couple of my co-workers found it useful, and I’m always looking for feedback to improve it.
I hope the community finds it useful!
https://modbusmechanic.scifidryer.com
Thanks Matt, I appreciate the notice and will add it to the list after trying it out.
Thanks,
I discovered UnSlave thanks to you!
Very useful.
There’s also “mbpoll” which looks like a rewrite of the “modpoll” command-line utility (it uses exactly the same command-line syntax), but using libmodbus instead of the FieldTalk driver, and adding a few useful options such as quiet mode.
Thanks for the heads-up!
I have used Modbus Tools (old but works) and ModbusMonitor to simulator total complex projects in Windows 10 with good luck.
Thanks for references to more commercial tools, especially ModbusMonitor which appears to be unique as an Android app.
Modbus Tools: https://www.modbustools.com
ModbusMonitor: https://www.modbusmonitor.com
Cheers,
Dale
Modbus Monitor: https://modbusmonitor.com
Hi Allison, the commercial ModScan software supports a “DANIEL/ENROM/OMNI” transmission mode in addition to “Standard”, but I don’t recall seeing DANIEL support in the other simulators.
If you want an open simulator, you may want to review the capabilities of the modbus library used by qModMaster (http://www.libmodbus.org/) used by qModMaster to see if DANIEL support is baked-in. If it is, forcing qModMaster to use DANIEL mode may not be difficult. Good luck!
Fwiw Alison reported selecting the 64bit version of the WinTECH packages. At the time she was working on set-up and still confident in her choice.
Thanks for the summary. I’m looking for something to test a Daniels dialect link which uses function code 65 for FP values. Do you know of one?
Thanks for the information, Dale!
You’re the best!
Thanks Ed, great reference.
And I’ll also mention the OpenPLC project at https://www.openplcproject.com/
Hi,
Yet another Freeware Modbus-TCP Server Simulator with quite better functionality…
http : // tdogan dot net / #mss
Hi Talat, thanks for the news. I will try MSS when I have some time. Cheers, Dale.
gone away?
tdogan.net is no longer available, I will remove the link but leave the post for reference.
I also suggest taking a look at the CAS Modbus Scanner. It’s a free Modbus master application meant for people who don’t know anything about Modbus! https://store.chipkin.com/products/tools/cas-modbus-scanner