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/portenta-machine-control/tutorials/pmc-modbus-rtu-plc-ide/assets/plcide_software_download.svg
Copy file name to clipboardExpand all lines: content/hardware/05.pro-solutions/solutions-and-kits/portenta-machine-control/tutorials/pmc-modbus-rtu-plc-ide/content.md
-[Micro USB cable](https://store.arduino.cc/products/usb-2-0-cable-type-a-micro) (x2)
39
38
- Wire with either specification for RS-485/RS-422 connection (x3):
40
39
- STP/UTP 24-18AWG (Unterminated) 100-130Ω rated
41
40
- STP/UTP 22-16AWG (Terminated) 100-130Ω rated
@@ -44,8 +43,7 @@ In this tutorial, you will discover how to establish Modbus RTU communication be
44
43
45
44
### Software Requirements
46
45
47
-
-[Arduino PLC IDE Tools](https://www.arduino.cc/en/software#arduino-plc-ide)
48
-
-[Arduino PLC IDE software](https://www.arduino.cc/en/software#arduino-plc-ide)
46
+
-[Arduino PLC IDE Installer](https://www.arduino.cc/en/software#arduino-plc-ide)
49
47
- If you have a Portenta Machine Control, you will need a unique PLC IDE License key for your device. Get your license key [here](https://store.arduino.cc/products/plc-key-portenta-machine-control). Go to section [__License Activation with Product Key (Portenta Machine Control)__](https://docs.arduino.cc/software/plc-ide/tutorials/plc-ide-setup-license#6-license-activation-with-product-key-portenta-machine-control) to know more.
50
48
-[Portenta Machine Control Modbus RTU PLC IDE Project Example File](assets/ModbusRTU_PMC_Example.zip)
51
49
@@ -69,13 +67,13 @@ The entire procedure is divided into three distinct stages:
69
67
70
68
*__Modbus RTU Configuration__ serves as the initial step, wherein we configure the Portenta Machine Control device with Modbus RTU and other inherent properties.
71
69
72
-
In this phase, the role of the Portenta Machine Control device as either a Client or Server within Modbus RTU is specified. It includes settings such as 'Port type', 'Baud rate', and 'Serial Mode', which are crucial for the communication protocol.
70
+
In this phase, the role of the Portenta Machine Control device as either a Client or Server within Modbus RTU is specified. It includes settings such as *Port type*, *Baud rate*, and *Serial Mode*, which are crucial for the communication protocol.
73
71
74
-
Depending on the device's role within Modbus RTU, we either outline the 'Status variables' or define the Modbus node to identify the devices communicating under this protocol.
72
+
Depending on the device's role within Modbus RTU, we either outline the 'Status variables' or define the Modbus node to identify the devices communicating under this protocol.
75
73
76
-
*__PLC Program__, is created post-device configuration, integrating Modbus RTU and other functionalities. An essential aspect of this stage is removing the need for detailed Modbus RTU configurations within the PLC code.
74
+
*__PLC Program__ is created as a post-device configuration, integrating Modbus RTU and other functionalities. An essential aspect of this stage is removing the need for detailed Modbus RTU configurations within the PLC code.
77
75
78
-
The setup is user-friendly. The system autonomously manages Modbus RTU data exchange by referencing predefined variables in the PLC code. Such an approach leverages the device's initial configuration, reducing redundancy and ensuring efficient communication.
76
+
The setup is user-friendly. The system autonomously manages Modbus RTU data exchange by referencing predefined variables in the PLC code. Such an approach leverages the device's initial configuration, reducing redundancy and ensuring efficient communication.
79
77
80
78
*__System Operation__ showcases the expected results after Modbus RTU setup and the PLC program's execution based on the developer's logic. As an outcome, the device can be seen communicating with its counterparts via Modbus RTU.
81
79
@@ -89,16 +87,13 @@ With this broader perspective, we are ready to delve into the details.
89
87
90
88
### Setting Up the Arduino PLC IDE
91
89
92
-
Access the Arduino PLC IDE software by following [Arduino PLC IDE official website](https://www.arduino.cc/pro/software-plc-ide). You will have to download two executable files for proper software installation:
90
+
To get the Arduino PLC IDE software, go to the [official software website of the Arduino PLC IDE](https://www.arduino.cc/pro/software-plc-ide) and choose to download the PLC IDE installer file. The software is named `Arduino PLC IDE Installer`.
93
91
94
-
-[Arduino PLC IDE Tools](https://www.arduino.cc/en/software#arduino-plc-ide)

96
93
97
-

94
+
The software requires **Windows 10** or a newer operating system version for the x64 architecture.
98
95
99
-
The **Arduino PLC IDE Tools** will provide all the required drivers, libraries, and cores for development, while the **Arduino PLC IDE** will install the IDE software.
100
-
101
-
Install the Arduino PLC IDE Tools before the Arduino PLC IDE to avoid potential problems related to old libraries and drivers.
96
+
The Arduino PLC IDE installer contains the IDE and all the required drivers, libraries, and cores. The continuing sections will help you install the Arduino PLC IDE software properly.
102
97
103
98
***For more details regarding Arduino PLC IDE setup, please take a look at [Arduino PLC IDE Setup and Board's License Activation](https://docs.arduino.cc/tutorials/portenta-machine-control/plc-ide-setup-license) tutorial.***
104
99
@@ -124,7 +119,7 @@ The Portenta Machine Control has integrated RS-485 120 Ω differential cable ter
124
119
125
120
### Workspace Pre-Configuration
126
121
127
-
Some considerations must be considered beforehand to properly enable and use Modbus RTU on Portenta Machine Control using PLC IDE for appropriate Modbus RTU operation. The following subsections will briefly explain such aspects.
122
+
Before properly enabling and using Modbus RTU on Portenta Machine Control, some considerations must be considered before using PLC IDE for appropriate Modbus RTU operation. The following subsections will briefly explain such aspects.
128
123
129
124
***It is recommendable to check out [this tutorial](https://docs.arduino.cc/tutorials/portenta-machine-control/plc-ide-setup-license#3-project-setup) to familiarize with Arduino PLC IDE environment.***
130
125
@@ -138,13 +133,13 @@ Portenta Machine Control can be initialized further in the process if additional
138
133
139
134
#### Modbus RTU Client and Server Mode
140
135
141
-
The PLC IDE software allows setting the Portenta Machine Control as either a Modbus RTU Client, Server or none of the previous modes. It also provides a *Port type* option to set to use RS-485 (For Half-Duplex mode) or RS-422 (For Full-Duplex mode) interface. The option is configurable under `RS485 SerialPort` listed within the `Resources` tab. The provided instructions are set to use the RS-485 interface, Half-Duplex mode.
136
+
The PLC IDE software allows the Portenta Machine Control to be set as either a Modbus RTU Client, Server or none of the previous modes. It also provides a *Port type* option to use the RS-485 (Half-duplex mode) or RS-422 (Full-duplex mode) interface. The option is configurable under `RS485 SerialPort` listed within the `Resources` tab. The provided instructions are set to use the RS-485 interface, Half-Duplex mode.
142
137
143
138
The Portenta Machine Control set as a Modbus RTU Client will provide 'Baud Rate' and 'Serial Mode' settings. The baud rate is available from 600 b/s to 115200 b/s. The serial mode offers a set of options conformed with the following elements:
144
139
145
-
- Parity: No Parity, Even Parity, Odd Parity
146
-
- Data Bits: 8 Data Bits (Only option for Data Bits)
147
-
- Stop Bits: 1 - 2 Stop Bits
140
+
-**Parity**: No Parity, Even Parity, Odd Parity
141
+
-**Data Bits**: 8 Data Bits (Only option for Data Bits)
142
+
-**Stop Bits**: 1 - 2 Stop Bits
148
143
149
144
Alternatively, the Portenta Machine Control set as a Modbus RTU Server requires an additional configuration called 'Slave Settings'. It will ask you to define the Modbus address with a range between `1 .. 247`.
150
145
@@ -184,32 +179,32 @@ To create a live handshake verification procedure between two Portenta Machine C
184
179
185
180
Using the counter data from the 'Modbus RTU Server Portenta Machine Control', the 'Modbus RTU Client Portenta Machine Control' manages the programmable digital I/Os and digital outputs. Each Portenta Machine Control is assigned a simple task using the abovementioned elements. You will learn to configure the Modbus RTU role for each Portenta Machine Control device using the sections dedicated to each role.
186
181
187
-
You may access the entire example project [here](assets/ModbusRTU_PMC_Example.zip) if you want to test it immediately. Every setting and component is ready to be assembled and uploaded to the corresponding Portenta Machine Control.
182
+
If you want to test it immediately, you may access the entire example project [here](assets/ModbusRTU_PMC_Example.zip). Every setting and component is ready to be assembled and uploaded to the corresponding Portenta Machine Control.
188
183
189
184
The following sections will demonstrate how to set up each Portenta Machine Control according to its function in a Modbus RTU connection.
190
185
191
186
#### Modbus RTU Server Portenta Machine Control
192
187
193
188
To configure the Portenta Machine Control as a Modbus RTU Server, navigate to the `RS485 SerialPort` tab in the `Resources` panel within the PLC IDE. It will open a `Modbus Configuration` window where you should choose the `Modbus RTU Slave` setting. For the tutorial example, we will employ the following properties for the server Portenta Machine Control:
194
189
195
-
- Port type: `RS485`
196
-
- Baud Rate: 19200 b/s
197
-
- Serial Mode: N,8,1 (No parity, 8 data bits, 1 stop bit)
198
-
- Slave settings (Modbus address): 10
190
+
-**Port type**: `RS485`
191
+
-**Baud Rate**: 19200 b/s
192
+
-**Serial Mode**: N,8,1 (No parity, 8 data bits, 1 stop bit)
193
+
-**Slave settings (Modbus address)**: 10
199
194
200
195

201
196
202
197
Alternative values can be used per requirements if needed.
203
198
204
-
The subsequent image displays the `Status variables (volatile)` window. We will define the `counter_stack` variable within this window, specifying its access address and data type for Modbus RTU transmission.
199
+
The subsequent image displays the `Status variables (volatile)` window. In this window, we will define the `counter_stack` variable, specifying its access address and data type for Modbus RTU transmission.
205
200
206
201

207
202
208
203
The `counter_stack` status variable uses the following parameters:
209
204
210
-
* Address: 25000 (dec) / 0x61A8 (hex)
211
-
* Name: cnt
212
-
* PLC type: INT
205
+
***Address**: 25000 (dec) / 0x61A8 (hex)
206
+
***Name**: cnt
207
+
***PLC type**: INT
213
208
214
209
After finishing the settings, go to `Resources -> Portenta Machine Control` and select the corresponding port, beginning the `Manual sketch download` process. Navigate to `On-line -> Set up Communication` and activate Modbus RTU, ensuring that the elevated USB port number designated for the Portenta Machine Control is selected.
215
210
@@ -267,21 +262,21 @@ Upon completing these steps, you will have effectively set up a Portenta Machine
267
262
268
263
To configure the Portenta Machine Control as a Modbus RTU Client, navigate to the `RS485 SerialPort` tab in the `Resources` section of the PLC IDE. This action will reveal the `Modbus Configuration` panel, where you should choose the `Modbus RTU Master` setting. For the tutorial example, set the client Portenta Machine Control with these specifications:
269
264
270
-
- Port type: `RS485`
271
-
- Baud Rate: 19200 b/s
272
-
- Serial Mode: N,8,1 (No parity, 8 data bits, 1 stop bit)
265
+
-**Port type**: `RS485`
266
+
-**Baud Rate**: 19200 b/s
267
+
-**Serial Mode**: N,8,1 (No parity, 8 data bits, 1 stop bit)
273
268
274
269

275
270
276
271
Alternative values can be used per requirements if needed.
277
272
278
273
To establish communication with the pre-configured Modbus RTU Server Portenta Machine Control, add a Modbus node by right-clicking the `RS485 SerialPort` tab within the `Resources` section. Once ready, you will see an 'Add' option. Use this to insert a 'Generic Modbus' node. For this example, configure the node with the following parameters:
279
274
280
-
* Name: PMC_RTU_1
281
-
* Modbus address: 10
282
-
* Minimum polling time: 1 ms
283
-
* Address type: Modbus
284
-
* Swap words mode: Little-endian compliant (No words swapping)
275
+
***Name**: PMC_RTU_1
276
+
***Modbus address**: 10
277
+
***Minimum polling time**: 1 ms
278
+
***Address type**: Modbus
279
+
***Swap words mode**: Little-endian compliant (No words swapping)
285
280
286
281
Use the configuration model applied to the Modbus RTU Server Portenta Machine Control for these settings. The vital detail to consider is the Modbus address. Ensure this address corresponds with the server Portenta Machine Control or any other compatible device in case more nodes are added. The setup should resemble the image provided:
287
282
@@ -299,7 +294,7 @@ To retrieve the counter data from the server Portenta Machine Control, select th
299
294
300
295

301
296
302
-
Next, you will need to assign a variable to hold the counter data captured from the server Portenta Machine Control. Go to the `Input Reg.` tab in the Modbus function configuration menu to do this. Create a variable named `counter_rec` to store the data sent via the protocol.
297
+
Next, you will need to assign a variable to hold the counter data captured from the server Portenta Machine Control. Go to the Modbus function configuration menu's `Input Reg.` tab to do this. Create a variable named `counter_rec` to store the data sent via the protocol.
303
298
304
299
The following image shows a visual representation of the anticipated configuration:
305
300
@@ -373,15 +368,15 @@ Finally, Portenta Machine Control is now ready as a Modbus RTU Client.
373
368
374
369
You can access the complete example project [here](assets/ModbusRTU_PMC_Example.zip). You can download the compressed file, extract it, and use the pre-configured example project for your Portenta Machine Control devices.
375
370
376
-
Set both Portenta Machine Control devices running with the corresponding main PLC code with the hardware setup explained in [this section](#hardware-setup).
371
+
Set both Portenta Machine Control devices to run with the corresponding main PLC code, with the hardware setup explained in [this section](#hardware-setup).
377
372
378
373
The following short clip briefly shows the expected behavior of the example project.
The server Portenta Machine Control (on the right side) will:
383
378
384
-
- Execute a binary counter with digital outputs working as visual indicators within an 8-bit boundary.
379
+
- Execute a binary counter with digital outputs as visual indicators within an 8-bit boundary.
385
380
- Increase the shared Modbus counter variable each time the 8-bit binary counter completes a cycle.
386
381
- Adjust the binary counter's speed by modifying buffer variables according to the desired values.
387
382
@@ -397,6 +392,6 @@ In this tutorial, you have learned to configure the workspace environment to wor
397
392
398
393
### Next Steps
399
394
400
-
Now that you have learned to implement the Modbus RTU between Portenta Machine Control devices using Arduino PLC IDE, try adding additional Modbus RTU-compatible devices and creating a Modbus RTU communication network.
395
+
Now that you have learned to implement the Modbus RTU between Portenta Machine Control devices using Arduino PLC IDE try adding additional Modbus RTU-compatible devices and creating a Modbus RTU communication network.
401
396
402
-
Further, explore the possibilities by combining the Portenta Machine Control device's onboard features with the Modbus RTU communication network and deploy it as an enhancement solution for industrial management systems.
397
+
Further, the possibilities can be explored by combining the Portenta Machine Control device's onboard features with the Modbus RTU communication network and deploying it to enhance industrial management system solutions.
0 commit comments