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 theModbus Connectblock.
π€ 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 includeCoil,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
Provide a Modbus client into the
Modbus Clientinput. For example, use theModbus Connectblock to create the client connection.Set
Addressto the starting register/coils address you want to read.Set
Quantityto the number of items to read (smaller values increase reliability).Choose
Data Typeaccording to what your device exposes (Coil,Discrete Input,Input Register, orHolding Register).Control when reads happen by feeding the
Enableinput (manualLogic 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 Connectto 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 JSONand then toCSV Export.Publish readings to an external system using
MQTT Publishor forward viaREST API - Post.Use
Scopeto visualize numeric register values in real time.Trigger single reads with
Rising Edgeor pace continuous reads usingDelay SteporCycle Timer.Use
Debug InputorData Read Local/Data Read Global/Data Write Local/Data Write Globalfor intermediate inspection or sharing between flow sections.
π οΈ Troubleshooting
No data returned: ensure
Modbus Clientis connected (useModbus Connect) and network/firewall allows communication.Unexpected values: verify
AddressandData Typematch the device documentation (coils vs registers).Partial or missing results: reduce
Quantityto smaller batches and retry.Reads failing intermittently: use
Delay Stepto space requests and avoid overloading the Modbus server.Still stuck: add a debugging block such as
Debug Inputto inspect raw outputs and confirm the client is alive.
Last updated
Was this helpful?