Protonest Master

Configuration

Modbus

Configure the RS-485 bus and add Modbus RTU registers using an XY-MD02 example.

On this page

Protonest Master reads values from Modbus RTU devices through its RS-485 interface. Before configuring the gateway, record the slave address, baud rate, parity, stop bits, function codes, data types, and register map from the device datasheet.

Example device

This example uses an XY-MD02 temperature and humidity transmitter.

Datasheet itemExample value
Slave address1
Communication9600 baud, 8 data bits, no parity, 1 stop bit
TemperatureInput register 0x0001, function 04, signed value divided by 10
HumidityInput register 0x0002, function 04, unsigned value divided by 10

1. Configure the RS-485 bus

  1. Open the bus settings

    Open Sensors > Modbus, then select RS-485 bus.

  2. Match the serial settings

    Set Speed (baud) to 9600, Parity to None, and Stop bits to 1.

  3. Set the polling interval

    Enter an interval such as 10 seconds.

  4. Save the bus

    Select Save bus settings.

RS-485 bus configured for 9600 baud, no parity, one stop bit, and a 10-second polling interval.

2. Add the temperature register

  1. Create a register

    Select All Modbus sections > Registers > Add register and turn on Enable register.

  2. Name the published value

    Enter temperature in JSON keyword.

  3. Enter the address

    Set Slave address to 1, Register address to 1, and Function to 04 - Read input registers.

  4. Choose the data format

    Select Signed 16-bit. Leave Command interval (ms) at 100 unless the device requires another value.

  5. Scale the value

    Expand Advanced and set Decimal places to 1, Scale factor to 0.1, and Unit to °C.

  6. Review and create

    Confirm the summary says Reading 1 register as Signed 16-bit from slave 1, address 1., then select Create register.

3. Add the humidity register

Repeat the process with these values:

FieldValue
JSON keywordhumidity
Slave address1
Register address2
Function04 - Read input registers
Data formatUnsigned 16-bit
Decimal places1
Scale factor0.1
Unit%RH
The register workspace combines search and selection with addressing, data-format, timing, scaling, and alarm controls.

4. Verify the readings

  1. Check the interface

    Open Diagnostics > Hardware and confirm that Modbus interface shows OK.

  2. Validate the decoded values

    Confirm that the temperature and humidity readings are plausible.

  3. Confirm MQTT delivery

    Check that values publish under the configured Modbus MQTT subtopic, whose factory default is modbus-values.

Modbus reference

Bus limits

SettingAccepted value
Speed1200, 2400, 4800, 9600, 19,200, 38,400, 57,600, or 115,200 baud
ParityNone, Even, or Odd
Stop bits1 or 2
Polling intervalWhole number from 1-86,400 seconds
Register definitionsUp to 150

Register addressing and formats

FieldAccepted value or behavior
JSON keyword1-15 letters, digits, or underscores; first character must be a letter or underscore
Slave address1-247
Register address0-65,535
Function01 Read coils, 02 Read discrete inputs, 03 Read holding registers, or 04 Read input registers
Data formatUnsigned 16-bit, Signed 16-bit, Unsigned 32-bit, Float 32-bit, or Boolean
Data lengthSet automatically: two registers for 32-bit formats, otherwise one
Command intervalWhole number from 10-60,000 ms
Decimal places0-3
UnitAt most 3 UTF-8 bytes

Functions 01 and 02 require the Boolean format. Use Scale factor to convert raw numeric values. Report zero while offline substitutes zero when the field device is unavailable; enable it only if downstream systems can distinguish that fallback from a real zero. Out-of-range alarm requires a minimum that does not exceed the maximum.

The register list can be searched by name, slave, address, or function. Select a register to edit it. Unsaved edits can be discarded; deleting a register requires confirmation and reindexes the remaining list.

If the Modbus interface stops working

  • Confirm the field device has power.
  • Check that A and B are not swapped.
  • Confirm the slave address, baud rate, parity, and stop bits match the device.
  • Confirm the function code, register address, and data type against the register map.
  • Recheck the scale factor. For example, 305 × 0.1 = 30.5 °C.