Modbus Read

This function block reads data from a Modbus server when enabled. It accepts a Modbus client connection and returns the read values (coils or registers) according to your selected data type and address settings.

πŸ“₯ Inputs

  • Enable - Boolean signal to allow or prevent reading. Provide a manual or logic signal to control when reads occur.

  • Modbus Client - Generic connection object that performs Modbus communication. Typically provided by the Modbus Connect block.

πŸ“€ Outputs

  • Data - The read result. Depending on the chosen data type this will contain coil bits or register values.

πŸ•ΉοΈ Controls

  • Address - Starting address (numeric) to read from the Modbus server.

  • Quantity - Number of items (coils/registers) to read in a single request. Keep this small for reliable reads.

  • Data Type - Select which Modbus data to read. Available options include Coil, Discrete Input, Input Register, Holding Register.

🎯 Features

  • Read multiple Modbus data types (coils or registers) using one simple interface.

  • Works with an external Modbus client connection supplied to the block.

  • User controls for address, quantity and data type make it easy to adapt to many Modbus devices.

  • Designed to integrate with flow controls and export tools to forward read values.

πŸ“ Usage Instructions

  1. Provide a Modbus client into the Modbus Client input. For example, use the Modbus Connect block to create the client connection.

  2. Set Address to the starting register/coils address you want to read.

  3. Set Quantity to the number of items to read (smaller values increase reliability).

  4. Choose Data Type according to what your device exposes (Coil, Discrete Input, Input Register, or Holding Register).

  5. Control when reads happen by feeding the Enable input (manual Logic Input, a periodic timer, or an edge trigger).

πŸ“Š Evaluation

When enabled and given a valid client, this block performs a read and outputs the result through Data. Use downstream blocks to log, visualize or forward the values.

πŸ’‘ Tips and Tricks

  • Combine with Modbus Connect to provide a proper client connection.

  • To write back to the device after reading, pair with Modbus Write.

  • For logging or analytics, send results to Data to JSON and then to CSV Export.

  • Publish readings to an external system using MQTT Publish or forward via REST API - Post.

  • Use Scope to visualize numeric register values in real time.

  • Trigger single reads with Rising Edge or pace continuous reads using Delay Step or Cycle Timer.

  • Use Debug Input or Data Read Local / Data Read Global / Data Write Local / Data Write Global for intermediate inspection or sharing between flow sections.

πŸ› οΈ Troubleshooting

  • No data returned: ensure Modbus Client is connected (use Modbus Connect) and network/firewall allows communication.

  • Unexpected values: verify Address and Data Type match the device documentation (coils vs registers).

  • Partial or missing results: reduce Quantity to smaller batches and retry.

  • Reads failing intermittently: use Delay Step to space requests and avoid overloading the Modbus server.

  • Still stuck: add a debugging block such as Debug Input to inspect raw outputs and confirm the client is alive.

Last updated

Was this helpful?