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();
@genee/modbus
1.4.11 • Public • PublishedReadme
Keywords
nonePackage Sidebar
Install
npm i @genee/modbus
Weekly Downloads
23
Version
1.4.11
License
MIT
Unpacked Size
38.2 kB
Total Files
9