Skip to main content

ModSim - A Simple Modbus TCP Device Simulator

modsim is a simple Modbus TCP device simulator deployed at modsim.topmaker.net:502. It works as a remote Modbus-TCP (virtual) device, which has already been populated with all 4 types of registers, i.e.

  • Coil Type
  • Discrete input Type
  • Input register Type
  • Holding register Type

It is recommended to use modpoll tool to communicate with it, the example configuration is as following,

device,modsim01,1,,
poll,coil,0,16,BE_BE
ref,coil01-08,0,bool8,rw
ref,coil09-16,1,bool8,rw
poll,discrete_input,10000,16,BE_BE
ref,di01-08,10000,bool8,rw
ref,di09-16,10001,bool8,rw
poll,input_register,30000,20,BE_BE
ref,input_reg01,30000,uint16,rw
ref,input_reg02,30001,uint16,rw
ref,input_reg03,30002,uint16,rw
ref,input_reg04,30003,uint16,rw
ref,input_reg05,30004,int16,rw
ref,input_reg06,30005,int16,rw
ref,input_reg07,30006,int16,rw
ref,input_reg08,30007,int16,rw
ref,input_reg09,30008,uint32,rw
ref,input_reg10,30010,uint32,rw
ref,input_reg11,30012,int32,rw
ref,input_reg12,30014,int32,rw
ref,input_reg13,30016,float32,rw
ref,input_reg14,30018,float32,rw
poll,holding_register,40000,44,BE_BE
ref,holding_reg01,40000,uint16,rw
ref,holding_reg02,40001,uint16,rw
ref,holding_reg03,40002,uint16,rw
ref,holding_reg04,40003,uint16,rw
ref,holding_reg05,40004,int16,rw
ref,holding_reg06,40005,int16,rw
ref,holding_reg07,40006,int16,rw
ref,holding_reg08,40007,int16,rw
ref,holding_reg09,40008,uint32,rw
ref,holding_reg10,40010,uint32,rw
ref,holding_reg11,40012,int32,rw
ref,holding_reg12,40014,int32,rw
ref,holding_reg13,40016,float32,rw
ref,holding_reg14,40018,float32,rw
ref,holding_reg15,40020,uint64,rw
ref,holding_reg16,40024,int64,rw
ref,holding_reg17,40028,float64,rw
ref,holding_reg18,40032,float64,rw
ref,holding_reg19,40036,string16,rw

Quick Start

A docker image has been provided for user to directly run the program,

docker run -p 5020:5020 topmaker/modsim:latest

The above one-line command will create a virtual Modbus TCP device running at localhost:5020.

To verify it, you can test by modpoll tool with the following command,

modpoll \
  --tcp localhost \
  --tcp-port 5020 \
  --config https://raw.githubusercontent.com/gavinying/modpoll/master/examples/modsim.csv

Note: add sudo before docker run command if you want to use the Modbus TCP standard port 502.

Metadata

Release files for modsim 0.5.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for modsim 0.5.2
File Size Uploaded
modsim-0.5.2.tar.gz 6.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for modsim 0.5.2
File Interpreter ABI Platform
modsim-0.5.2-py3-none-any.whl Python 3 none any Details

Total release size: 13.7 kB

Release files / modsim-0.5.2.tar.gz

Download URL modsim-0.5.2.tar.gz
Size 6.3 kB
Tags Source
SHA-256 checksum
How to use checksums
f0ba5499b206c874600d8c8d2af12bdc647bbd7a71278a3a32d4732c576705fa
BLAKE2b-256 checksum
How to use checksums
59a73d8f9fab468ba8c69ff9c6cc06a36ee1633cc9cd34b278c4edea2cbf9991
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.8.5 CPython/3.12.8 Linux/6.8.0-1017-azure

Release files / modsim-0.5.2-py3-none-any.whl

Download URL modsim-0.5.2-py3-none-any.whl
Size 7.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e7f1586d5d84ca447a8ee0e85ed8134eabb57d5ce77a8e1a4bf4364e65cb19a6
BLAKE2b-256 checksum
How to use checksums
abb642d60152d743c72a91819eba9822ffc19361397314bdd938a441573eef3b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.8.5 CPython/3.12.8 Linux/6.8.0-1017-azure

Release history Release notifications | RSS feed

This release

0.5.2 This release

2 release files

0.5.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page