- Modbus TCP support
- Single and Continuous Polling of registers
- Writing Registers
- Data display settings including:
- Data type
- Radix
- Byte and Word Endianness
- Modbus Error Response Handling
- Modbus Serial Support for the following framers:
- RTU
- ASCII
- Binary
- Unit ID Selection (For Modbus TCP devices)
- Logging to File
- Zero mode (1 or 0 index for registers)
- Full register address display (show what the full register number is)
- Read Device information metadata
- Settings save to and load from file.
- Clone the repository and checkout the develop branch (default)
- Install Python 3
- Install dependencies with
pip3 install -r requirements.txt
(can be in virtualenv) - Install
pyqt5-tools
Global or user python installation (not virtualenv)
To edit the .ui
files navigate to where pyqt5-tools
installed and launch designer.exe
. Open the .ui
file in
QtDesigner and edit it. Save it in the ui_files
directory. Generate the related python file using the pyuic5
command
(part of pyqt5-tools
). Example:
pyuic5 ./ui_files/modbus_visualizer.ui > ./visualizer/gui_main_window.py
Run the program: python main.py
The provided test server hosts a live modbus server on the interface of choice specified by command line arguments. This allows for a manual test server to be used to verify new features or bugfixes to the program. Eventually we should write some automated test, but this will do for now.
Specify the network type and protocol framer (only for serial) when launching the test server by passing command line arguments.
-s, --server-type
: Can be eitherserial
ortcp
sets the network type for the test server (defualt = tcp)-i, --ip
: Sets the IP address for the tcp server (defualt = 127.0.0.1)-p, --tcp-port
: Sets the port for the tcp server (default = 5020)-f, --framer
: Sets the protocol framer for serial server. Can bertu
,ascii
, orbinary
. (default = rtu)-c, --com-port
: Com port name for the serial server. MUST BE PROVIDED. (default = None)--stop-bits
: The number of stop bits for the serial server. Can be 1 or 2 (default = 1)--byte-size
: The byte length for the serial server. Can be 5,6,7, or 8. (default = 8)-b, --baud-rate
: The baud rate for the serial server. (default = 19200)-u, --unit-id
: The unit ID to use for the TCP server. (default = None (Broadcast Mode))
To test a serial server without an actual modbus device, a virtual com port program can be used on windows such as:
On Linux a pty can be used to link two serial sessions to test the server.