Skip to content

g992/modbus-seplos-bms-reader

Repository files navigation

modbus-seplos-bms-reader

sample in index.ts

import {SeplosModbusConnector} from "./seplosModbusConnector";

const connector = new SeplosModbusConnector('COM17')
const start = async () => {
    connector.debug = false
    connector.storeSize = 5

    await connector.init()
    connector.startCircularReading() // starting circular reading
    //await connector.readAllData() // one shot reading

    setInterval(async () => {
        console.log(connector.requestInfoStore()[0][1]) //entries of map
        const t1 = connector.requestInfoStore()[0][1].at(-1)!.timestamp
        const t2 = connector.requestInfoStore()[0][1].at(-2)!.timestamp
        console.log(t1-t2) //reading speed
    }, 1000)


}

start()

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published