You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-Power cables for supply and load: Wires with a cross-sectional area ranging from 13.3 mm² to 21.2 mm², corresponding to AWG sizes 6 to 4
45
+
-For the power supply and load: Use wires with cross-sectional areas between 13.3 mm² and 21.2 mm² (AWG sizes 6 to 4)
46
46
47
47
### Software Requirements
48
48
49
49
-[Arduino IDE 2.0+](https://www.arduino.cc/en/software) or [Arduino Web Editor](https://create.arduino.cc/editor)
50
-
- If you choose an offline Arduino IDE, you must install the following libraries via the Library Manager: [**ArduinoRS485**](https://github.com/arduino-libraries/ArduinoRS485) and [**ArduinoModbus**](https://github.com/arduino-libraries/ArduinoModbus).
50
+
- If you choose an offline Arduino IDE, you must install the following libraries via the IDE's Library Manager: [**ArduinoRS485**](https://github.com/arduino-libraries/ArduinoRS485) and [**ArduinoModbus**](https://github.com/arduino-libraries/ArduinoModbus).
51
51
-[Modbus TCP example code](assets/Opta_Modbus_TCP_Example.zip)
52
52
53
53
## Modbus Protocol
54
54
55
-
Modbus is a widely used, open, and royalty-free serial communication protocol based on a client/server architecture. It is commonly known in industrial electronic devices, such as Building Management Systems (BMS) and Industrial Automation Systems (IAS).
55
+
Modbus is a widely used, open, and royalty-free serial communication protocol based on a client/server architecture. It is commonly used in industrial electronic devices, such as Building Management Systems (BMS) and Industrial Automation Systems (IAS). BMS include HVAC control systems, lighting control systems, and fire alarm systems; IAS examples include manufacturing process control, robotic automation, and assembly line management.
56
56
57
57
Developed by Modicon (now Schneider Electric) in 1979, Modbus has become a standard communication protocol for industrial electronic devices, particularly those using programmable logic controllers (PLCs).
58
58
59
-
The Modbus protocol is frequently used to connect supervisory devices with Remote Terminal Units (RTUs) in Supervisory Control and Data Acquisition (SCADA) systems. Modbus ensures reliable communication between electronic devices through simple 16-bit messages with a Cyclic Redundant Checksum (CRC) for error-checking.
59
+
The Modbus protocol is frequently used to connect supervisory devices with Remote Terminal Units (RTUs) in Supervisory Control and Data Acquisition (SCADA) systems. Modbus ensures reliable communication between electronic devices through simple 16-bit messages, including a Cyclic Redundancy Check (CRC) for error-checking.
60
60
61
-
For more information on the Modbus protocol, check out the[Modbus article](https://docs.arduino.cc/learn/communication/modbus) complying with Opta™.
61
+
For more information on the Modbus protocol, check out this[Modbus article](https://docs.arduino.cc/learn/communication/modbus).
62
62
63
63
## Modbus TCP
64
64
65
-
The Modbus protocol is a messaging service that uses Client/Server or Controller/Peripheral communications. It keeps its data handling separate from its transmission method as an *application protocol*.
65
+
The Modbus protocol is a messaging service that uses Client/Server or Controller/Peripheral communications. As an *application protocol*, it keeps its data handling separate from its transmission method.
66
66
67
67
**Modbus over TCP/IP**, commonly known as **Modbus TCP**, is a variant of the Modbus RTU protocol. It uses the TCP/IP interface over Ethernet for data transfer between compatible devices. Here are some key points about Modbus TCP:
68
68
@@ -95,27 +95,25 @@ Install the latest versions of the following libraries required for Modbus TCP c
You can easily install them through the Library Manager in the Arduino IDE. The Library manager can be accessed using the **"ctrl + shift+ i"** shortcut, by going to **Tools > Manage Libraries...**, or by navigating the left panel of the Arduino IDE and selecting the third option from the top.
99
-
100
-
These two libraries are required for properly working Modbus TCP communication, as the [**ArduinoModbus**](https://github.com/arduino-libraries/ArduinoModbus) library depends on the [**ArduinoRS485**](https://github.com/arduino-libraries/ArduinoRS485) library.
98
+
You can easily install the libraries through the Library Manager of the Arduino IDE. The IDE's Library manager can be accessed using the **ctrl+shif+i** shortcut, by navigating to **Tools > Manage Libraries...**, or by navigating to the IDE's left panel and selecting the Library Manager icon (third option from the top).
101
99
102
100
### Connecting the Opta™ Over Ethernet LAN
103
101
104
-
Set up the connection by attaching the Ethernet LAN (RJ-45) cable to both devices using the `ETH RJ45` port. The following image provides a connection diagram for both devices:
102
+
Set up the connection by attaching the Ethernet LAN (RJ-45) cable to both devices using the `ETH RJ45` port. The image below shows how to connect both devices:
105
103
106
104

107
105
108
-
The setup in the diagram includes an optional Ethernet switch that connects and monitors both Opta™ devices using the Arduino IDE. This configuration with the Ethernet switch can be used for this tutorial, and it can be expanded to include other devices that support Modbus TCP.
106
+
The setup in the image above includes an optional Ethernet switch that connects and monitors both Opta™ devices using the Arduino IDE. This configuration with the Ethernet switch can be used for this tutorial, but it can also be expanded to include other devices that support Modbus TCP.
109
107
110
108
### Code Overview
111
109
112
110
The following example aims to configure and use the Modbus TCP communication protocol over the Ethernet interface between two Opta™ devices.
113
111
114
112
Modbus is a well-known client-server protocol for its reliability. The Modbus client is responsible for sending requests, and the Modbus server provides the requested information when available. Multiple Modbus servers can be present, but only one Modbus client can be active.
115
113
116
-
In this example, one Opta™ device will be assigned as a client to handle writing coil values. A secondary Opta™ device will perform as a server, polling for Modbus TCP requests and returning the appropriate values. The status LED #1 output will be a visual indicator for the Opta™ server.
114
+
One Opta™ device will be assigned as a client to handle writing coil values in this example. A secondary Opta™ device will perform as a server, polling for Modbus TCP requests and returning the appropriate values. The status LED 1 output will be a visual indicator for the Opta™ server.
117
115
118
-
You can access the complete example code below. Compile and upload each example to the appointed Opta™ as you follow along with the following sections.
116
+
The complete code for both devices, the client and server, are shown below. Compile and upload each example to the appointed Opta™ as you follow along with the following sections.
119
117
120
118
#### Modbus TCP Client
121
119
@@ -318,9 +316,7 @@ Once the Modbus TCP Client and Server code for each Opta™ device has been uplo
318
316
319
317
## Conclusion
320
318
321
-
This tutorial shows how to use the Arduino ecosystem's `ArduinoRS485` and `ArduinoModbus` libraries and the Arduino IDE to implement the Modbus TCP protocol between two Opta™ devices. These libraries are essential for allowing connections with Modbus TCP compliant devices.
322
-
323
-
With these examples, you can easily understand how to establish Modbus TCP communication between a Server and a Client using Opta™. This setup is scalable for connecting additional Modbus Server devices, such as another Opta™ or a Modbus TCP compatible module.
319
+
This tutorial shows how to use the Arduino ecosystem tools to implement the Modbus TCP protocol between two Opta™ devices. With these examples, you can easily understand how to establish Modbus TCP communication between two Opta devices acting as a Server and a Client. This setup is scalable for connecting additional Modbus Server devices, such as another Opta™ or a Modbus TCP compatible module.
0 commit comments