Modbus Simulator

posted Oct 19, 2014, 8:53 PM by Javad Taghia   [ updated Oct 20, 2014, 6:47 AM ]
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:
1. RTU
2. TCP/IP

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/2.2.2.0/
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:
From: http://blog.kaliatech.com/2013/03/using-com0com-and-realterm-on-windows-8-x64/

Using com0com and RealTerm on Windows 8 (x64) & 8.1

Posted on 2013/03/25

Every new version of Windows seems to make this harder. (See updates below for windows 8.1 x64)

RealTerm

Initially RealTerm 2.0.0.70 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 3.0.0.0 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:

  1. Enable test mode per the readme.txt
    1. i.e. bcdedit.exe -set TESTSIGNING ON
    2. 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.
  2. In windows 8, you also need to A) bypass/disable driver signature verification or B) sign the com0com driver.
    1. 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.
      1. 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.)
    2. 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.

[Update 2014-06]

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 3.0.0.0
- 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.


Ċ
Javad Taghia,
Oct 19, 2014, 8:53 PM
ċ
com0com-2.2.2.0-x64-fre-signed.zip
(198k)
Javad Taghia,
Oct 20, 2014, 6:40 AM
ċ
com0com-3.0.0.0-i386-and-x64-unsigned.zip
(271k)
Javad Taghia,
Oct 19, 2014, 8:53 PM
ċ
mod_RSsim_8_20.zip
(473k)
Javad Taghia,
Oct 19, 2014, 8:53 PM
Comments