modbus 0.0.1

Modbus protocol


To use this package, run the following command in your project's root directory:

Manual usage
Put the following dependency into your project's dependences section:

Modbus protocol

Library provides modbus wrapper over RTU and TCP (WIP) connections.

Modbus not manage your serial port or tcp connection. They uses through simple interfaces with read and write methods and you must close opened connections by yourself.

Simple usage:

import serialport;

auto com = new SerialPort("/dev/ttyUSB0", 19200);

auto mbus = new Modbus(new RTU(new class SerialPortIface{
            override:
                void write(const(void)[] msg) { com.write(msg); }
                void[] read(void[] buffer)
                { return com.read(buffer, 1500.dur!"msecs"); }
            }));

auto registers = mbus.readInputRegisters(device, address, count);
Be careful: RTU and Modbus don't know about state of com -- don't use mbus before closing com.
Authors:
  • Oleg Butko (deviator)
Dependencies:
none
Versions:
0.20.2 2021-Dec-02
0.20.1 2020-Sep-04
0.20.0 2020-Aug-26
0.19.5 2020-Aug-24
0.19.4 2020-Jul-27
Show all 49 versions
Download Stats:
  • 0 downloads today

  • 0 downloads this week

  • 1 downloads this month

  • 975 downloads total

Score:
1.2
Short URL:
modbus.dub.pm