Coder Social home page Coder Social logo

githubdragonfly / modbusmaster Goto Github PK

View Code? Open in Web Editor NEW
4.0 1.0 4.0 1.28 MB

Standalone Windows app supporting Modbus RTU, TCP, UDP, RTUoverTCP, RTUoverUDP, ASCIIoverRTU, ASCIIoverTCP and ASCIIoverUDP protocols. It is designed to allow running multiple instances of the app at the same time, just use a different port. Also included are Linux and Mac OS X Mono versions.

License: MIT License

C# 100.00%
free linux macos modbus mono rtu simulator tcp udp windows plc ascii modbus-master modbus-simulator

modbusmaster's Introduction

ModbusMaster

Standalone Windows app supporting Modbus RTU , TCP , UDP , RTUoverTCP , RTUoverUDP , ASCIIoverRTU , ASCIIoverTCP and ASCIIoverUDP protocols. Also included are its Mono versions for Linux and Mac OS X (these are VB Net versions so for Linux you will have to install mono-complete and mono-vbnc packages while Mac might be different depending on the OS X version).

It is designed to allow running multiple instances of the app at the same time, just use a different port, example:

  • one instance on IP 127.0.0.1 TCP Port 501 and another instance on IP 127.0.0.1 TCP Port 502

Based on modified nModbus .NET 3.5 libraries, Copyright (c) 2006 Scott Alexander. These are included as a resource for Windows version but are separate for Mono version.

Intended to be used as a quick testing tool. Can be tested with its counterpart ModbusSlaveSimulation.

An easy alternative to use instead would be the AdvancedHMI software since it is highly functional and free.

Screenshot

Start Page

Functionality

  • Read the comments inside the form and also hover the mouse over the labels for hints.
  • No Offset Addressing (where xxxxx goes from 00000 up to 65534):
    • Coils = 0xxxxx
    • Discrete Inputs = 1xxxxx
    • Input Registers = 3xxxxx
    • Holding Registers = 4xxxxx
  • Apart from Int16, which is register adress only without modifier, this app also supports U, F, L, UL and S modifiers ( which are used for UInt16, Float32, Int32, UInt32, String )
  • A support for 64-bit values was added - Float64, signed and unsigned Integer64. Use FQ, LQ and UQ modifiers (where Q stands for Quad Word).
  • An experimental support for 128-bit values was added - signed and unsigned Integer128. Use LO and UO modifiers (where O stands for Octa Word).
  • It also supports bit/character Reading/Writing:
    • select either consecutive bits/characters within a single element or the exact individual bit/character from each of the multiple elements.
    • either a single value or the exact number of comma separated values will be required for writing if Points number > 1.
  • For RTU based protocols, on a single PC, this app can use the help of the com0com Windows program to provide virtual serial port pairs.
  • Additional TextBox allows manual input of the serial port (intended for Linux so tty0tty virtual port pairs, like /dev/tnt0 <=> /dev/tnt1, could be accessed). This box was removed in Mac Mono version.
  • The library supports Masked Bit Write, function code 22 (0x16H), but the app also includes the built-in code for slave devices that don't support FC22 (this entails read-modify-write process which can take a little time and could overwrite values that changed during its running).
  • IMPORTANT: Exercise caution when attempting to write any value to the PLC.

Build

All it takes is to:

-> For Windows

  • Either use Windows executable files from the exe folder or follow the instructions below to build it yourself.
  • Download and install Visual Studio community edition (ideally 2019).
  • Download and extract the zip file of this project.
  • Open this as an existing project in Visual Studio and, on the menu, do:
    • Build/Build Solution (or press Ctrl-Shift-B).
    • Debug/Start Debugging (or press F5) to run the app.
  • Locate created EXE file in the /bin/Debug folder and copy it over to your preferred folder or Desktop.

-> For Mono

  • Make sure that Mono is installed on your computer, both mono-complete and mono-vbnc for Linux while for Mac you might need to experiment (maybe mono and mono-basic).
  • Download and extract the zip file of this project and locate the Mono zip archive in the Mono folder.
  • Extract 4 files and potentially rename the newly created folder and/or exe file to something shorter if you wish, just to make terminal navigation quicker.
  • Open the terminal, navigate to the folder and type: sudo mono ModbusMaster.exe (on Mac you might need to switch to superuser "su" account)
  • For testing RTU protocols, on Linux you can possibly install and use tty0tty virtual port pairs while on Mac the later OS X versions seem to have pseudo terminals - pairs of devices such as /dev/ptyp3 <=> /dev/ttyp3.

Note for Mac users: this was tested on an old iMac G5 PowerPC computer with Mono v2.10.2. Some odd behaviour was present in a sense that the app was loosing focus thus disrupting TCP communication in Auto Read mode. There is a text box with red X that you can click to try to maintain focus (if you do something else afterwards then click it again). Since I cannot test it in any other way then it is left for you to experiment.

License

Licensed under MIT license - see the README.txt file inside the Resources folder.

Trademarks

Any and all trademarks, either directly or indirectly mentioned in this project, belong to their respective owners.

Useful Resources

The AdvancedHMI website forum, which is another open source project that has this app, its Mono version as well as its VB version.

modbusmaster's People

Contributors

githubdragonfly avatar

Stargazers

 avatar  avatar  avatar  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.