# ModbusEndpoint

## `unitId` (integer)

By setting this optional parameter, the unitId defined in the Connection resource will be overwritten.

Examples: `1`, `2`

Additional restrictions:

* Maximum: `255`

## `fc` (integer, enum, required)

The Function Code (fc) defines the operation of the request. This can be any of the common Modbus codes, but the exact implementation depends on the concrete device manufacturer.

This element must be one of the following enum values:

* `1`
* `2`
* `3`
* `4`
* `5`
* `6`
* `15`
* `16`

Example: `2`

## `address` (integer, required)

Example: `0`

## `length` (integer, required)

The length describes how many registers should be read starting at the specified address. The registers of a modbus device have a length of 16 bits.

Example: `4`

## `dataType` (string, enum)

If given, convert the Modbus value to this specified type. Types are available in byte ordering Big Endian (BE), or Little Endian (LE), or with additional word swap (BEWS, LEWS).

This element must be one of the following enum values:

* `raw`
* `base64`
* `boolean`
* `doubleBE`
* `doubleLE`
* `floatBE`
* `floatBEWS`
* `floatLE`
* `floatLEWS`
* `int16BE`
* `int16LE`
* `int32BE`
* `int32LE`
* `uint16BE`
* `uint16LE`
* `uint32BE`
* `uint32LE`

Example: `"floatLE"`

## `interval` (integer)

Poll interval (best effort) in milliseconds

Default: `1000`

Example: `2000`

## `cronExpression` (string)

The Cron expression used to poll the endpoint. (For examples, see: <https://github.com/node-cron/node-cron>)

Examples: `"1,2,4,5 * * * *"`, `"1-5 * * * *"`, `"*/2 * * * *"`, `"* * * January,September Sunday"`


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.cybus.io/1-9-0/documentation/industry-protocol-details/modbus-tcp/modbusendpoint.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
