Skip to main content

A Simple Modbus TCP Device Simulator used for modpoll tool

Project description

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,modsim001,1,,
poll,coil,0,12,BE_BE
ref,coil01-08,0,bool8,rw
ref,coil09-12,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,20,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

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

modsim-0.5.1.tar.gz (6.3 kB view details)

Uploaded Source

Built Distribution

modsim-0.5.1-py3-none-any.whl (7.3 kB view details)

Uploaded Python 3

File details

Details for the file modsim-0.5.1.tar.gz.

File metadata

  • Download URL: modsim-0.5.1.tar.gz
  • Upload date:
  • Size: 6.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.12.7 Linux/6.5.0-1025-azure

File hashes

Hashes for modsim-0.5.1.tar.gz
Algorithm Hash digest
SHA256 1f3ce14c989ba28b8f0871a87a8b7de008685d419ad71c77c5d1928e69576ccb
MD5 1cf7128dba25f1a2a147687b350bda12
BLAKE2b-256 29054d00b18665ba02753d37579e30486c0ee3bd3651e4894b419523694f7265

See more details on using hashes here.

File details

Details for the file modsim-0.5.1-py3-none-any.whl.

File metadata

  • Download URL: modsim-0.5.1-py3-none-any.whl
  • Upload date:
  • Size: 7.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.12.7 Linux/6.5.0-1025-azure

File hashes

Hashes for modsim-0.5.1-py3-none-any.whl
Algorithm Hash digest
SHA256 39b3558588f38ac4f62d5532bf932b6bbc53c3e93a47d899004003e7f6dcddd0
MD5 ddc26a4aa9b554499dad5f83e680b04b
BLAKE2b-256 b3c6cff95e8e74738b59e11b688a336430d66dc047a8ed9e7ad4b5ca381d2fe2

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page