Modbus Connect
This function block facilitates connection to a Modbus server over TCP. It is designed to create and manage a connection that allows for communication with Modbus devices.
📥 Inputs
This function block does not have any inputs.
📤 Outputs
Modbus Client
This output provides the Modbus client instance, allowing for further interactions with Modbus devices.
🕹️ Controls
IP Address
A text field where you can enter the IP address of the Modbus server you wish to connect to. Default is set to 192.168.0.1
.
Modbus TCP Port
A text field for specifying the port number for the Modbus TCP connection. Default is set to 502
.
🎨 Features
Dynamic Connection Management
Automatically manages and reconnects to the Modbus server if connection parameters change.
Non-blocking Operation
Utilizes asynchronous programming for connecting without freezing the user interface.
📝 Usage Instructions
Configure IP Address: Enter the IP address of the target Modbus server in the
IP Address
text field.Set TCP Port: Specify the Modbus TCP port in the
Modbus TCP Port
text field.Establish Connection: The connection will be established when the node is evaluated. You can then retrieve the Modbus client from the output.
📊 Evaluation
Upon evaluation, this function block tries to connect to the specified Modbus server using the provided IP address and port number. If successful, it returns a reference to the Modbus client for further communication.
💡 Tips and Tricks
🛠️ Troubleshooting
Last updated