Modbus client for capacitor
https://github.com/dhakerShiv/cordova-plugin-modbus-tcp https://capacitorjs.com/docs/plugins/workflow
npm install capacitor-modbus
npx cap sync
setIpAddress(...)
setPort(...)
connect()
connectTo(...)
disconnect()
isConnected()
readHoldingRegisters(...)
convertRegistersToFloat(...)
setIpAddress(options: { ip: string; }) => Promise<void>
Param | Type |
---|---|
options |
{ ip: string; } |
setPort(options: { port: number; }) => Promise<void>
Param | Type |
---|---|
options |
{ port: number; } |
connect() => Promise<void>
connectTo(options: { ip: string; port: number; }) => Promise<void>
Param | Type |
---|---|
options |
{ ip: string; port: number; } |
disconnect() => Promise<void>
isConnected() => Promise<{ result: boolean; }>
Returns: Promise<{ result: boolean; }>
readHoldingRegisters(options: { start: number; count: number; }) => Promise<{ result: number[]; }>
Param | Type |
---|---|
options |
{ start: number; count: number; } |
Returns: Promise<{ result: number[]; }>
convertRegistersToFloat(options: { registers: number[]; order: 0 | 1; }) => Promise<{ result: number; }>
Param | Type |
---|---|
options |
{ registers: number[]; order: 0 | 1; } |
Returns: Promise<{ result: number; }>