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