For simulation of our program we need to install Modbus simulators.
There are two main options.
1. Is a demo
and commercial package. It's powerful and comprehensive; it's pricey though.
2. Is a free version
that needs more practice to master and is limited but practical.
I've added both versions to this post.
For testing; you need either a real hardware communication means or you may use virtual communication.
Modbus comes in two general categories in sense of communication:
For RTU which is essentially a serial communication we need an emulator to provide us a loop. There is a nice piece of software that makes the loop possible virtually.
It is called com0com.
1. Signed version:
download it from or take the attachment: http://sourceforge.net/projects/com0com/files/com0com/184.108.40.206/
2. Unsigned version:
Unfortunately it is unsigned software and the driver doesn't work on Windows 7. There is a mode though you can work on in the Windows 7 that makes it possible to run it.
Good helps are on:
Using com0com and RealTerm on Windows 8 (x64) & 8.1
Every new version of Windows seems to make this harder. (See updates below for windows 8.1 x64)
Initially RealTerm 220.127.116.11 displays errors when installing and running. The fix is simply to run as administrator. (Having administrator privileges is not sufficient.) At some point something changed though and now I no longer have to run as administrator. I’m not sure if it’s only required on the initial install/run, or if changes I made to get com0com working also affected RealTerm.
com0com (windows 8)
Installing com0com 18.104.22.168 required more effort. Initially it showed multiple errors during install. Something like:
(SetupCopyOEMInf(C:\Program Files (x86)\com0com\com0com.inf) ERROR: 0xE000022F)”.
The virtual com ports displayed in DeviceManager, but after reboot were labeled with a warning about not having digital signature verification. I tried a number of things before I got it working. In the end, I think this is all that’s required:
- Enable test mode per the readme.txt
- i.e. bcdedit.exe -set TESTSIGNING ON
- In windows 7 (x64), that was sufficient for me. It seems some people also had to disable verification via that same tool, but that no longer works in Windows 8 regardless.
- In windows 8, you also need to A) bypass/disable driver signature verification or B) sign the com0com driver.
- To bypass temporarily, you can go in to the windows 8 startup options menu and disable driver signature verification. Once disabled, com0com installed and worked fine. However, I could not figure out how to disable the verification permanently at the time, so it reverted after every reboot. The drivers would be installed, but disabled in device manager.
- I later did read about ways to permanently disable the driver verification. I did not try this though since signing the driver was sufficient (and would seem to be slightly more secure.)
- To sign the com0com.sys driver (in the “Windows/System32/Drivers” directory), I used this tool: “Driver Signature Enforcement Overrider 1.3b” at ngohq.com. Once signed (and still in windows test mode), com0com works as it did in Windows 7 x64.
com0com (windows 8.1)
In windows 8.1, signing the driver as described above no longer seems to work. However disabling driver signature verification via windows 8.1 recovery troubleshooting restart menus did allow com0com to install and function. (I’m not sure if it will continue to function after a normal restart though.)
There is another good help written for Windows 7 and com0com as a pdf
; I have attached the pdf to this post as well.
Now it's time to test.
We assume we already installed:
- Com0Com 22.214.171.124
- PlcSimulator.org free Modbus simulator.
- We have no warning sign on the virtual ports in Device Manager in the Control Panel.
- We already are in Test Mode in Windows 7.