This is a MODBUS TCP server simulator.
Make sure the Python is version 3.7 or newer.
./server.py
The default listening port is 5020.
- Read Coils
- Read Discrete Inputs
- Read Holding Registers
- Read Input Registers
- Write Single Coil
- Write Single Register
- Write Multiple Coils
- Write Multiple registers
- Server will response ILLEGAL FUNCTION exception if the request function code is not listed above.
- Server will response ILLEGAL DATA ADDRESS exception if the request address is invalid.
- Server will response ILLEGAL DATA VALUE exception if the request data value is invalid.
- Server will response random values if the reading request format is correct.
- Server will accept all of the written values if the writing request format is correct.