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
Copy file name to clipboardExpand all lines: content/hardware/05.pro-solutions/solutions-and-kits/opta/tutorials/getting-started-connectivity/content.md
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -43,7 +43,7 @@ The Arduino Opta® is a powerful PLC device that has many features, allowing you
43
43
44
44
Using the Arduino IDE we can easily work with these peripherals. Some features have their own library that we can make use of. Make sure the latest version of the Arduino IDE is installed. The IDE can be downloaded [here](https://www.arduino.cc/en/software).
45
45
46
-
Then we need to install the appropriate core for the Arduino Opta®. Go to **Tools > Board > Boards Manager**, in the boards manager section search for **Opta mbed** and install it. For more detailed instructions on setting up the Arduino Opta® with the Arduino IDE, have a look at the [Getting started with Opta tutorial](/tutorials/opta/getting-started).
46
+
Then we need to install the appropriate core for the Arduino Opta®. Go to **Tools > Board > Boards Manager**, in the boards manager section search for **Opta mbed** and install it. For more detailed instructions on setting up the Arduino Opta® with the Arduino IDE, have a look at the [Getting started with opta™ tutorial](/tutorials/opta/getting-started).
Copy file name to clipboardExpand all lines: content/hardware/05.pro-solutions/solutions-and-kits/opta/tutorials/getting-started-with-modbus-rtu/content.md
@@ -53,19 +55,19 @@ Using messages with a simple 16-bit structure with a Cyclic-Redundant Checksum (
53
55
54
56
### Setting Up the Arduino IDE
55
57
56
-
First, let's ensure we have the latest Arduino IDE version installed on our computers; you can download the latest Arduino IDE version [here](https://www.arduino.cc/en/software). If you are using Opta for the first time, please look at our [getting started tutorial](/tutorials/opta/getting-started) and install the device drivers on your computer. Modbus RTU communications protocol will be implemented using the [`ArduinoModbus`](https://www.arduino.cc/reference/en/libraries/arduinomodbus/) library, be sure to install the latest version of the library.
58
+
First, let's ensure we have the latest Arduino IDE version installed on our computers; you can download the latest Arduino IDE version [here](https://www.arduino.cc/en/software). If you are using Opta™ for the first time, please look at our [getting started tutorial](/tutorials/opta/getting-started) and install the device drivers on your computer. Modbus RTU communications protocol will be implemented using the [`ArduinoModbus`](https://www.arduino.cc/reference/en/libraries/arduinomodbus/) library, be sure to install the latest version of the library.
57
59
58
60
***`ArduinoModbus` library requires the `ArduinoRS485` library as the Modbus library is dependent on it; remember to install both libraries.***
59
61
60
62
### Connecting the Optas Over RS-485
61
63
62
64
Now that we have the Arduino IDE configured and the libraries installed, let's connect both Opta™ devices via RS-485, as shown in the image below:
63
65
64
-

66
+

65
67
66
68
### Code Overview
67
69
68
-
The objective of the example described below is to configure and use Modbus RTU communications protocol over RS-485 between two Opta devices, one acting as a Client and the other acting as a Server. The Client is responsible for writing and reading `Coil`, `Holding`, `Discrete Input`, and `Input` register values. The Server will poll for Modbus RTU requests and return values accordingly to each request. To help you understand better how the example works, we will briefly explain the essential parts of the code used in this tutorial.
70
+
The objective of the example described below is to configure and use Modbus RTU communications protocol over RS-485 between two Opta™ devices, one acting as a Client and the other acting as a Server. The Client is responsible for writing and reading `Coil`, `Holding`, `Discrete Input`, and `Input` register values. The Server will poll for Modbus RTU requests and return values accordingly to each request. To help you understand better how the example works, we will briefly explain the essential parts of the code used in this tutorial.
69
71
70
72
#### Modbus RTU Client
71
73
@@ -103,7 +105,7 @@ void setup() {
103
105
104
106
Given Modbus RTU specification, `preDelay` and `postDelay` must be configured for correct operation. The baud rate can be configured as `4800`, `9600`, and `19200`; in the current example, we are using a baud rate of `9600`, but it can be changed depending on the system requirements. The `SERIAL_8E1` defines the serial port parameters setting (8 data bits, even parity, and one stop bit).
105
107
106
-
In this example, an Opta device is defined as a Modbus Server from which information will be retrieved. The Server can be a module or a sensor with registers that can be accessed using specified addresses to obtain desired information about what's being measured or monitored. Inside the loop function of the example code of the Client, we will have several tasks in charge of reading and writing specific values to test Modbus RTU communication with the Server.
108
+
In this example, an Opta™ device is defined as a Modbus Server from which information will be retrieved. The Server can be a module or a sensor with registers that can be accessed using specified addresses to obtain desired information about what's being measured or monitored. Inside the loop function of the example code of the Client, we will have several tasks in charge of reading and writing specific values to test Modbus RTU communication with the Server.
107
109
108
110
```arduino
109
111
void loop(){
@@ -392,4 +394,4 @@ Once you have uploaded the Modbus RTU Client and Server code for each Opta™ de
392
394
393
395
## Conclusion
394
396
395
-
In this tutorial, we established a Modbus RTU connection between two Opta devices using the Arduino ecosystem tools, such as the Arduino IDE and Arduino libraries. The `ArduinoRS485` and `ArduinoModbus` libraries are essential components that enable communication with compatible Modbus RTU devices. With the demonstrative example described in this tutorial, we have established communication between a Modbus RTU Server and a Client; we can now configure and set a secondary Arduino Opta® or use a Modbus RTU-compatible module for your project developments.
397
+
In this tutorial, we established a Modbus RTU connection between two Opta™ devices using the Arduino ecosystem tools, such as the Arduino IDE and Arduino libraries. The `ArduinoRS485` and `ArduinoModbus` libraries are essential components that enable communication with compatible Modbus RTU devices. With the demonstrative example described in this tutorial, we have established communication between a Modbus RTU Server and a Client; we can now configure and set a secondary Arduino Opta® or use a Modbus RTU-compatible module for your project developments.
First make sure the latest version of the Arduino IDE is installed. Download the IDE from [here](https://www.arduino.cc/en/software) if you need help setting up the Opta with the Arduino IDE, please have a look at our [Getting started with Opta tutorial](/tutorials/opta/getting-started).
42
+
First make sure the latest version of the Arduino IDE is installed. Download the IDE from [here](https://www.arduino.cc/en/software) if you need help setting up the Opta™ with the Arduino IDE, please have a look at our [Getting started with Opta™ tutorial](/tutorials/opta/getting-started).
43
43
44
-
To make it easier to use the RS485 protocol with Opta let's make use of a library. The library is called [ArduinoRS485 library](https://www.arduino.cc/reference/en/libraries/arduinors485/), which can be found in the Arduino IDE library manager. Once installed let's take a look at a simple sketch to use for testing out the UART protocol.
44
+
To make it easier to use the RS485 protocol with Opta™ let's make use of a library. The library is called [ArduinoRS485 library](https://www.arduino.cc/reference/en/libraries/arduinors485/), which can be found in the Arduino IDE library manager. Once installed let's take a look at a simple sketch to use for testing out the UART protocol.
45
45
46
-
### Using RS485 on Opta
46
+
### Using RS485 on Opta™
47
47
48
-
The sender sketch will run a RS485 connection between your two devices and it will let you send a message over the serial monitor to the receiving device. The receiving device, which will be an Opta in this example, will then take the message, open or close the corresponding relay and turn on or off a LED. If you send the number 0 through the serial monitor, the receiving Opta will open or close relay 1 depending on its current status, while turning on or off a status LED.
48
+
The sender sketch will run a RS485 connection between your two devices and it will let you send a message over the serial monitor to the receiving device. The receiving device, which will be an Opta™ in this example, will then take the message, open or close the corresponding relay and turn on or off a LED. If you send the number 0 through the serial monitor, the receiving Opta™ will open or close relay 1 depending on its current status, while turning on or off a status LED.
49
49
50
50
Here are some important functions in the sketch:
51
51
@@ -54,9 +54,9 @@ Here are some important functions in the sketch:
54
54
-`RS485.print()`: Writes binary data over RS485. This data is sent as a byte or series of bytes.
Connect the sender and receiver Opta according to the image shown below.
57
+
Connect the sender and receiver Opta™ according to the image shown below.
58
58
59
-

59
+

60
60
61
61
### UART RS485 Sender Sketch
62
62
@@ -156,12 +156,12 @@ The values the device can receive and the result:
156
156
157
157
## Conclusion
158
158
159
-
In this tutorial we went through how to establish a serial communication between two Optas using the RS485 connection, learning how to write sketches using the `ArduinoRS485.h` library to send and receive values between these two devices. Finally, the tutorial showed how to take these values sent with RS485 to interact with the Opta activating its relays and LEDs accordingly.
159
+
In this tutorial we went through how to establish a serial communication between two Optas using the RS485 connection, learning how to write sketches using the `ArduinoRS485.h` library to send and receive values between these two devices. Finally, the tutorial showed how to take these values sent with RS485 to interact with the Opta™ activating its relays and LEDs accordingly.
160
160
161
161
### Next Steps
162
162
163
-
Now that you are familiar with the R485 on the Opta, have a look at our [Getting started with Opta tutorial](../getting-started-with-rs485/content.md) to get a better overview of other features on the device.
163
+
Now that you are familiar with the R485 on the Opta™, have a look at our [Getting started with Opta™ tutorial](../getting-started-with-rs485/content.md) to get a better overview of other features on the device.
164
164
165
-
If you wish to incorporate connectivity in your Opta solutions, have a look at the [Connectivity on Opta tutorial]().
165
+
If you wish to incorporate connectivity in your Opta™ solutions, have a look at the [Connectivity on Opta™ tutorial](../getting-started-connectivity).
166
166
167
-
If you are interested in seeing the RS485 interface, used with the Modbus protocol, being put to work in a real-life scenario, have a look at our [Tank levels application note for the Opta]().
167
+
If you are interested in seeing the RS485 interface, used with the Modbus protocol, being put to work in a real-life scenario, have a look at our [Tank levels application note for the Opta](../tank-level-app-note).
0 commit comments