udmi

UDMI / Docs / Specs / Modbus

Modbus Specification

UDMI supports reading Modbus points by specifying them via a modbus:// URL schema.

URI Schema

modbus://<host>[:port]/<unitid>/<function>/<address>[/<quantity>][?interpretation]

Function Codes

Interpretation Parameters

Parameters passed in the query string define how to interpret the fetched register data:

Network Parameters

The host maps to a named network in the device’s model_localnet.json (under the networks field). Each named network can define the following parameters for communication:

Examples

The metadata values in the examples below map to the following complete Modbus URIs:

Network Configuration Example

The serial-bus RTU network specification as part of a gateway metadata.json file:

{
  "localnet": {
    "networks": {
      "modbus_rtu_1": {
        "family": "modbus",
        "adjunct": {
          "protocol": "RTU",
          "baud": 9600,
          "parity": "none",
          "data_bits": 8,
          "stop_bits": 1,
          "device": "COM1"
        }
      }
    }
  }
}

Proxy Device Example

For a proxied Modbus device, the gateway block in the metadata.json specifies the target device ID (Unit ID), while the pointset block defines the individual points and their register mappings.

{
  "gateway": {
    "target": {
      "family": "modbus",
      "addr": "2",
      "network_id": "modbus_rtu_1"
    }
  },
  "pointset": {
    "points": {
      "fan_status": {
        "ref": "1/101?type=BOOLEAN"
      },
      "filter_differential_pressure": {
        "units": "Pascals",
        "ref": "4/30005?type=UINT32&worder=LWF&scale=0.01"
      }
    }
  }
}