Modbus Read

This function block is used to read data from a Modbus server via a specified client, offering flexibility in accessing various data types.

๐Ÿ“ฅ Inputs

Enable This boolean input activates the Modbus reading process. If false, the reading is halted.

Modbus Client This input provides the client needed to communicate with the Modbus server.

๐Ÿ“ค Outputs

Data This output contains the data read from the specified Modbus address, depending on the chosen data type.

๐Ÿ•น๏ธ Controls

Address A text input field to specify the Modbus register address to read from.

Quantity A text input field to define how many registers or coils to read.

Data Type A dropdown menu to select the type of data to be read, which can include:

  • Coil

  • Discrete Input

  • Input Register

  • Holding Register

๐ŸŽจ Features

Asynchronous Communication The block uses async functions to ensure non-blocking reads from the Modbus server, improving efficiency.

Error Logging If there are issues during the read process, error messages will be logged by the tool, allowing for quick troubleshooting.

๐Ÿ“ Usage Instructions

  1. Connect the Modbus Client: Ensure that you connect a valid Modbus client to the Modbus Client input.

  2. Set Address: Enter the desired Modbus address in the Address text input.

  3. Set Quantity: Define how many items to read by entering a value in the Quantity text input.

  4. Select Data Type: Use the dropdown menu to select the desired data type you want to read.

  5. Enable Reading: Send a true signal to the Enable input to start reading from the specified Modbus address.

๐Ÿ“Š Evaluation

When activated, this function block reads data from the Modbus server based on the specified parameters and returns the data.

๐Ÿ’ก Tips and Tricks

Understanding Addresses

Ensure the address entered is within the valid range supported by your Modbus server configuration to avoid errors during reading.

Setting Quantity Limits

Be mindful of the quantity being requestedโ€”fetching too many items at once may exceed the server limits or lead to performance issues.

Retrieving Coil States

When reading coils or discrete inputs, remember that the result will be a list of boolean states representing the coil values.

๐Ÿ› ๏ธ Troubleshooting

Error Reading from Server

If you encounter an error stating the data could not be read, ensure that the Modbus server is reachable and the client is properly configured.

Invalid Address or Quantity

Always verify that your specified address and quantity comply with the Modbus protocol and your server's specifications to prevent out-of-bound requests.

Last updated