An open API service indexing awesome lists of open source software.

https://github.com/nicolasroehm/capacitormodbus

Modbus client for Capacitor 4.x
https://github.com/nicolasroehm/capacitormodbus

Last synced: 3 months ago
JSON representation

Modbus client for Capacitor 4.x

Awesome Lists containing this project

README

        

# Capacitor Modbus

Modbus client for Android with Capacitor 4.x

## Install

```bash
npm install capacitor-modbus
npx cap sync
```

## API

* [`setIpAddress(...)`](#setipaddress)
* [`setPort(...)`](#setport)
* [`connect()`](#connect)
* [`connectTo(...)`](#connectto)
* [`disconnect()`](#disconnect)
* [`isConnected()`](#isconnected)
* [`readHoldingRegisters(...)`](#readholdingregisters)
* [`convertRegistersToFloat(...)`](#convertregisterstofloat)

### setIpAddress(...)

```typescript
setIpAddress(options: { ip: string; }) => Promise
```

| Param | Type |
| ------------- | ---------------------------- |
| **`options`** | { ip: string; } |

--------------------

### setPort(...)

```typescript
setPort(options: { port: number; }) => Promise
```

| Param | Type |
| ------------- | ------------------------------ |
| **`options`** | { port: number; } |

--------------------

### connect()

```typescript
connect() => Promise
```

--------------------

### connectTo(...)

```typescript
connectTo(options: { ip: string; port: number; }) => Promise
```

| Param | Type |
| ------------- | ------------------------------------------ |
| **`options`** | { ip: string; port: number; } |

--------------------

### disconnect()

```typescript
disconnect() => Promise
```

--------------------

### isConnected()

```typescript
isConnected() => Promise<{ result: boolean; }>
```

**Returns:** Promise<{ result: boolean; }>

--------------------

### readHoldingRegisters(...)

```typescript
readHoldingRegisters(options: { start: number; count: number; }) => Promise<{ result: number[]; }>
```

| Param | Type |
| ------------- | ---------------------------------------------- |
| **`options`** | { start: number; count: number; } |

**Returns:** Promise<{ result: number[]; }>

--------------------

### convertRegistersToFloat(...)

```typescript
convertRegistersToFloat(options: { registers: number[]; order: 0 | 1; }) => Promise<{ result: number; }>
```

| Param | Type |
| ------------- | ---------------------------------------------------- |
| **`options`** | { registers: number[]; order: 0 \| 1; } |

**Returns:** Promise<{ result: number; }>

--------------------


## Sources
- https://github.com/dhakerShiv/cordova-plugin-modbus-tcp
- https://capacitorjs.com/docs/plugins/workflow