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