Overview

This simulator was originally created around 1999 to allow testing of a driver for a Texas Instruments 500 series controller which I had limited access to while writing the driver. A year latter I re-wrote it to support modbus RTU and TCP, basically because the simulator had allowed me not only to learn the role of master, but also of slave. So that others could benefit from the kind of test I was able to set up, I published the modbus simulator on the web in 2002. It may be used as a "virtual" PLC for training and easily simulating for test or development purposes. This simulator was written to allow the testing of a MODBUS RTU serial driver without having to get 254 little MODBUS PLCs into one office. As such it fulfills the need very well, but is not, by any means, a full implementation of the protocol; it implements only the common functions used in MODBUS and other protocols supported here.

Overview: Menus and User Interface (UI)


(Simulator splash screen)

Running this program

Launch the app, "mod_rssim.exe" you will see the splash screen similar to above for a few moments. The simulator should open the 1st available serial/RS-232 port the first time it runs, select the desired protocol (if ethernet, no serial port is used/needed), and then click on the Port Settings..." button to change any settings.

For details on command-line usage, see section CSV Import and misc .

Menus

The first menu is the Task/System menu. Right-click on the window title.

The normal ways of controlling a window are available here, highlighted is the About box, which gives program version and contact information

Always on top - ensures that the simulator window remains on top of other windows, select it again to turn the mode off

Advanced Emulation - Takes you to the advanced emulation settings dialog relevant to the protocol you are using.

CSV Import - Import CSV files containing register values

Read only - Turns the simulator into read-only mode, registers cannot be set.

Solid Window,Alpha blend % - set the transparncy of the window, (not for windows versions < Windows2000)

Port open/close - In Serial protocols this makes the sim release the serial port so other programs can access it. The simulator is effectively disabled in this mode.

Settings are saved to WindowsTM registry.

User Interface

........................

  • Load will not work unless you have saved first.
  • Save will save all the register values to a flat binary file (don't edit it, I can't) called 'modbus.dat', (ABDATA.DAT if using the DF1 protcol) in the current folder. This is nice to allow you to fill the registers with values, and then come back latter to the same setup. Comms will be slow and may time out during load/save, since they are interlocked. 
  • Zero values will clear all values (also the digitals become 0). 
  • Switch between the Hex and Decimal views.
  • The boxes at the bottom work like indicators to show which stations are active; the gray outline of each box will change color (they turn off after five seconds), and clicking them disables each station (only 60 are shown). The green background turns red to show a disabled station. Disabled stations will still show activity, but the sim. will just not respond back.
  • Double-click on the list-view over a register, to edit it's value, double-clicking on digital I/O just toggle them. 
  • Click on Animation Settings... to change the color of the indicators at the bottom, and set up some simulation data.
  • Hotkeys

    • <CTRL>-A = Save register values
    • <CTRL>-B = About box
    • <CTRL>-C = Toggle display registers/comms debugger mode
    • <CTRL>-E = Erase, clears all register values
    • <CTRL>-J = inJect error, injects a char on the RS232 protocol used
    • <CTRL>-L = Load (opposite of save)
    • <CTRL>-M = Open emulation settings dialog for the current protocol
    • <CTRL>-N = Noise, opens noise settings dialog (RS232 protocols only)
    • <CTRL>-S = Settings, opens dialog for current protocols's settings
    • <CTRL>-T = Transparency, toggles to the next alpha-blend level 1=opaque, 2=semi see-thru, 3=very see-thru, this is more a fancy feature that is useful in that the program becomes transparent, so you can sometimes superimpose it over another program
    • F1 = Help, opens the local help file in your default web browser.

     


    • Serial protocols:Hook up a cable (just a 2,3 and 7 crossed ,4,5 looped, and 6,8,20 looped should be fine, hardware handshaking is not my strong side), but there is some support there.
      Ethernet:U must have an ethernet adapter or loopback adapter installed.
    • New option for starting with all devices offline added.
    • The "responsiveness" setting changes the delay in the program before it responds to a valid request.

    Note: If the station indicator button for a station is off, the simulator will not respond to data requests for that station ID, even though the client is connected.