Modbus Polling Configuration

September 20th, 2021


When choosing a poll period for a Modbus data source, understanding the following is important. Modbus data sources will poll all of their data points each poll by sending multiple requests to the slave device for the values. Depending on the configuration Modbus4J will choose to break up the requests into requests. The following settings will define how the messages are chosen:

  1. Contiguous batches only - can be used to specify that the modbus implementation should not attempt to optimize disparate value requests into a single request. Checking this field will cause the implementation to only make requests for multiple values when those value form contiguous register space.
  2. Max read register count - the number of registers to read within a single request
  3. Max read bit count - the number of Coils or Inputs to read within a single request
  4. Timeout

When determining if the data source can make all the requests within the poll period it is very helpful to look at the IO Log. This log shows the O (Output from Mango) messages and the I (Input to Mango) messages with timestamps. This allows one to see what messages are being sent and if they can be completed within the poll period. Enable IO logging using the checkbox on the data source settings and looking in the logs folder for the modbusIO-<data source id>.log file.

One thing to consider when setting the timeout is the number of requests made during a poll. The timeout applies to each request (I/O pair in the log) so if the data source is making 10 requests with a timeout of 1000ms the data source will take over 10s to poll a device that doesn't respond. If you were to choose a poll period of 5s then the next poll will be aborted if the device is timing out.

Copyright © 2021 Radix IoT, LLC.