@genee/modbus
TypeScript icon, indicating that this package has built-in type declarations

1.4.9 • Public • Published

@genee/modbus: A ModBus Library

Usage

const port = new SerialPort('/dev/ttyS0', {
    baudRate: 38400,
    autoOpen: false,
});

const bus = new ModBus({
    logger: console,
    write: (chunk) => {
        port.write(chunk);
    },
});

port.on('data', (chunk) => {
    bus.read(chunk);
});

const data = await bus.unit(0x33).readRegisters();

Readme

Keywords

none

Package Sidebar

Install

npm i @genee/modbus

Weekly Downloads

2

Version

1.4.9

License

MIT

Unpacked Size

38.2 kB

Total Files

9

Last publish

Collaborators

  • iamfat