Modbus TCP (Transmission Control Protocol) is a communication protocol used in industrial automation and control systems for transmitting data over Ethernet networks. It is an extension of the Modbus protocol, which was originally designed for serial communication but was adapted to work over TCP/IP networks, such as Ethernet. Modbus TCP is widely used to facilitate communication between various devices, including programmable logic controllers (PLCs), remote terminal units (RTUs), sensors, and other industrial equipment. Here are the key features and characteristics of Modbus TCP:
Ethernet-Based Communication: Modbus TCP is designed to work over Ethernet networks, which are common in industrial settings. This allows for faster and more reliable data communication compared to the original serial Modbus protocol.
Client-Server Architecture: Modbus TCP uses a client-server communication model. A client device initiates requests to read or write data, while a server device (typically a PLC or RTU) responds to these requests. The client sends queries to specific server addresses to access data and control functions.
Open Protocol: Modbus TCP is an open and well-documented protocol, which promotes interoperability between devices from different manufacturers. It is supported by various industrial equipment and software applications.
Request-Response Model: Communication in Modbus TCP is based on request-response interactions. A client sends a request to the server, and the server responds with the requested data or acknowledges the action.
Function Codes: Modbus TCP uses function codes to specify the type of operation being performed. Common function codes include reading and writing holding registers, coils, and input registers. Each code corresponds to a specific data access or control action.
Data Types: Modbus TCP supports various data types, such as binary (coils), 16-bit integers (holding registers), and 32-bit floating-point numbers. This versatility allows it to handle a wide range of industrial data.
Addressing: Devices in a Modbus TCP network are identified by their IP addresses and device IDs. The combination of the IP address and device ID is used to target specific devices for communication.
Broadcast Messaging: Modbus TCP supports broadcast messaging, allowing a client to send a message to all devices on the network. However, this should be used with caution due to its potential impact on network traffic.
Error Handling: Modbus TCP includes error-checking mechanisms to detect and address data transmission errors or issues with the integrity of the data.
Security Considerations: While Modbus TCP itself does not include strong security features, it is typically used within a secured network or in conjunction with additional security measures to protect data and network access.
Modbus TCP is widely used in various industries, including manufacturing, energy, and building automation, to facilitate communication between different components of industrial control systems. It provides a standardized and efficient way to read sensor data, control actuators, and monitor industrial processes over Ethernet networks.
Host: The hostname or IP address of the Modbus device.
Port: The port the used to connect to the Modbus device.
Reads a sequence of coils from a Modbus device.
Address: The address to start reading coils from.
Length: The number of coils to read from the starting address.
Writes values to a block of coils on a Modbus device.
Address: The starting address to write values to.
Values: An array of booleans to write to a block of coils starting at address.
Reads a sequence of discrete inputs from a Modbus device.
Address: The address to start reading discrete inputs from.
Length: The number of discrete inputs to read from the starting address.
Reads a sequence of holding registers from a Modbus device.
Address: The address to start registers from.
Length: The number of registers to read from the starting address.
Writes a values to a block of holding registers on a Modbus device.
Address: The starting address to write values to.
Values: An array of UInt16s to write to a block of registers starting at Address.
Reads a sequence of input registers from a Modbus device.
Address: The address to start registers from.
Length: The number of registers to read from the starting address.