Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Modbus tools

License

NotificationsYou must be signed in to change notification settings

christianhals/mbtools

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

59 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Description

Modbus tools based on libmodbus to log data fetched by a master/clientor received by a slave/server (writing of registers). mbcollect is ableto act as client or server (in TCP or RTU):

  • in client/master mode, it reads addresses defined by the user at regularinterval and output results to a local Unix socket
  • in server/slave mode, it waits for requests from other devices and outputregister writes to a local Unix socket.

Requirements

automake libtool pkg-config libglib2.0-dev libmodbus >= v3.1.1

Installation

$ ./autogen.sh$ ./configure$ make

Testing

To run the full suite of tests, you need to connect two USB-serial adapters onthe same link. The tests assume there seen as ttyUSB0 and ttyUSB1.You must be able to open port 1502 on your localhost for TCP unit tests.Once you're ready, you can launch the 4 tests with:

$ cd tests$ python ./testcase.py

To launch one test at once, you must specify the class of TestCase:

$ python -m unittest testcase.ClientTestCase

Settings

The program mbcollect accepts many options from command line, all options fromcommand line are also available in config .ini file. Some options related toremote slave/server when in master/client mode are only available in .ini file.

To list all available options:

$ ./mbcollect --help

All these options are also available in the[settings} section of config .inifile:

[settings]mode = clientsocketfile = /tmp/mbsocketinterval = 1verbose = 1

To define, the servers/slaves to read you can add one or many sections like thisone in your config .ini file:

[server "faraway"]# A server called 'faraway' with IP 192.18.0.5ip=192.168.0.5port=502# Read 4 integers at address 0# Read 1 float at address 10addresses=0;10;lengths=4;1;types=int;floatmsb;

Ifmbcollect runs in:

  • client mode, the[settings] and[server] sections will be used
  • master mode, the[settings] and[slave] sections will be used, thissection allows to define slave ID instead of IP address and port number.
  • server andslave modes, only the commonsettings section will be used

Seetests/ for a list of config file examples.

Stop and reload

The programs are designed to handle SIGTERM to stop them.mbcollect is alsoable to reload its config file on SIGHUP signal.

About

Modbus tools

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C84.3%
  • Python10.3%
  • M42.9%
  • Makefile2.0%
  • Shell0.5%

[8]ページ先頭

©2009-2025 Movatter.jp