Coder Social home page Coder Social logo

modbussim's Introduction

About

Modbus simulator

Getting Started

Clone smartq-ems repository

Prerequisites

  • Docker
  • Java 17
  • Maven

Configuration

  • Modbus slave config
cd smartq-ems/modbussim/src/main/resources
vim application.properties

#Modbus
modbus.slave.port=10502
modbus.slave.unitId=1
# Modbus slave data update rate
modbus.update.rate=5000
cd smartq-ems/modbussim/src/main/resources
vim datapoints.json

[
  {
    "id": 1, -> unique id
    "min": 0, -> minimum value of random numbers
    "max": 5, -> maximum value of random numbers
    "start": 4167, -> data point start address
    "end": 4168, -> data point end address
    "acc": true, -> data accumulate or not
    "specify": false, -> whether to generate value at a specified time
    "specifyTimeStart": "1430", -> specify time from
    "specifyTimeEnd": "1500", -> specify time to
    "specifyMin": 6, -> minimum value of random numbers
    "specifyMax": 10 -> maximum value of random numbers
    # in specify time range, simulator will generate random value between specifyMin and specifyMax
  },
  {
    "id": 2,
    "min": 0,
    "max": 5,
    "start": 4169,
    "end": 4170,
    "acc": false,
    "specify": true,
    "specifyTimeStart": "1630",
    "specifyTimeEnd": "1635",
    "specifyMin": 10,
    "specifyMax": 100
  }
]

Run simulator

  • to simulator project directory
cd smartq-ems
cd modbussim
  • modify docker image name from pom.xml
vim pom.xml
edit following line to specify a docker image name
...
<imageName>meter_office_101</imageName>
...
  • Build docker images
mvn clean package docker:build
  • Run container
docker run -d -p [port]:[port] --name [container name] [image name]:latest

ex.
docker run -d -p 10502:10502 --name meter_office_101 meter_office_101:latest

modbussim's People

Contributors

hwacomk68 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.