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-tcp-plc-ide/assets/pmc_plcide_hardware_connection_eth.svg
Copy file name to clipboardExpand all lines: content/hardware/05.pro-solutions/solutions-and-kits/portenta-machine-control/tutorials/pmc-modbus-tcp-plc-ide/assets/pmc_plcide_modbustcp_overview.svg
Copy file name to clipboardExpand all lines: content/hardware/05.pro-solutions/solutions-and-kits/portenta-machine-control/tutorials/pmc-modbus-tcp-plc-ide/content.md
+21-18Lines changed: 21 additions & 18 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -19,7 +19,7 @@ hardware:
19
19
20
20
Portenta Machine Control is characterized by its industrial-grade hardware, which provides consistent performance and durability even in the most demanding conditions. A notable feature of its design is the provision of various connectivity options, emphasizing Modbus TCP via the RJ-45 port.
21
21
22
-

22
+

23
23
24
24
In this tutorial, you will learn how to set up Modbus TCP-based communication between two Portenta Machine Controls using the Arduino PLC IDE.
25
25
@@ -35,7 +35,7 @@ In this tutorial, you will learn how to set up Modbus TCP-based communication be
@@ -110,9 +110,9 @@ We will use two Portenta Machine Control devices and the PLC IDE to set up the M
110
110
111
111
The Ethernet LAN (RJ-45) cable makes a physical connection between both devices using the `ETH RJ45` port. The following image provides a connection diagram for both devices:
112
112
113
-

113
+

114
114
115
-
The setup uses an Ethernet switch that monitors Portenta Machine Control using the PLC IDE. This configuration not only links both Portenta Machine Control devices using the PLC IDE but also lets you employ a profile to observe information exchanges in real time. We recommend using an Ethernet switch for this tutorial to ensure optimal communication between devices and monitor in real-time.
115
+
The setup incorporates an Ethernet switch that monitors Portenta Machine Control using the PLC IDE. This configuration not only links both Portenta Machine Control devices using the PLC IDE but also lets you employ a profile to observe information exchanges in real time. We recommend using an Ethernet switch for this tutorial to ensure optimal communication between devices and monitor in real-time.
116
116
117
117
### Workspace Pre-Configuration
118
118
@@ -128,17 +128,19 @@ We highly recommend reviewing [this tutorial](https://docs.arduino.cc/tutorials/
128
128
#### Portenta Machine Control Basic Configuration
129
129
<br></br>
130
130
131
-
To establish Modbus TCP communication, identify the IP address assigned to each Portenta Machine Control device. When you connect the Portenta Machine Control to a computer using an RJ-45 cable via an Ethernet port with standard ethernet settings, it automatically obtains an IP address from the external *Dynamic Host Configuration Protocol (DHCP)* server. To locate these auto-assigned IP addresses, using tools like this [scanner](https://angryip.org/) can prove invaluable.
131
+
To establish Modbus TCP communication, identify the IP address assigned to each Portenta Machine Control device. When you connect the Portenta Machine Control to a computer using an RJ-45 cable via an Ethernet port with standard ethernet settings, it automatically obtains an IP address from the external *Dynamic Host Configuration Protocol (DHCP)* server. To locate these auto-assigned IP addresses, utilizing tools like this [scanner](https://angryip.org/) can prove invaluable.
132
132
133
-
It is also possible to assign a custom IP address with desired properties to the Portenta Machine Control using the __Ethernet.begin()__ method. This approach is handy when specific addresses need to be designated due to particular operational criteria. To achieve this, we will employ the sketch located in the `Resources` tab of the PLC IDE. An attached image offers an overview of the setup possibilities within the sketch.
133
+
It is also feasible to assign a custom IP address with desired properties to the Portenta Machine Control using the __Ethernet.begin()__ method. This approach is handy when specific addresses need to be designated due to particular operational criteria. To achieve this, we will employ the sketch located in the `Resources` tab of the PLC IDE. An attached image offers an overview of the setup possibilities within the sketch.
134
134
135
135

136
136
137
137
***The __Ethernet.begin(ip, dns, gateway, subnet)__ method will delay initialization for 60 seconds if either the RJ45 cable is not connected or the Ethernet properties, like the IP address, are misconfigured. This behavior can be modified with the __Ethernet.begin(NULL, ip, dns, gateway, subnet, connection_timeout)__ method by adjusting the `connection_timeout` argument. This parameter defines the timeout for establishing a Data Layer connection.***
138
138
139
-
The IP address set for the Portenta Machine Control is essential for establishing and developing in the Arduino PLC IDE environment. To pair with the Portenta Machine Control device, activate the Modbus RTU feature and select the highest secondary USB port number by navigating to `On-line -> Set up communication`.
139
+
If opting to set the IP address for the Portenta Machine Control manually, it is also necessary to adjust the computer's Ethernet interface in the *IPv4* settings. The information input in the IPv4 configurations should correspond to the gateway settings. A stable connection to the Portenta Machine Control via the PLC IDE is pivotal for successful project execution. Below, an illustrative setup is depicted for the Windows 11 operating system:
140
140
141
-
TODO Update GIF animation
141
+

142
+
143
+
The IP address set for the Portenta Machine Control is essential for establishing and developing in the Arduino PLC IDE environment. To pair with the Portenta Machine Control device, activate the Modbus TCP feature and enter its unique IP address by navigating to `On-line -> Set up communication`. To verify the link between the Portenta Machine Control and the development platform, execute the `ping <Portenta Machine Control IP Address>` command in a terminal.
142
144
143
145

144
146
@@ -224,9 +226,9 @@ The subsequent image presents the `Status variables (volatile)` window. In this
224
226
225
227
The `cnt` status variable uses the following parameters:
226
228
227
-
*_Address_: 25000 (dec) / 0x61A8 (hex)
228
-
*_Name_: cnt
229
-
*_PLC type_: INT
229
+
*Address: 25000 (dec) / 0x61A8 (hex)
230
+
*Name: cnt
231
+
*PLC type: INT
230
232
231
233
To get started with these configurations, navigate to `Resources -> Portenta Machine Control`, select the corresponding port, and begin the `Manual sketch download`. Afterward, go to `On-line -> Set up Communication` and activate the Modbus TCP using the designated IP address for the Portenta Machine Control.
232
234
@@ -283,10 +285,10 @@ To configure the Portenta Machine Control as a Modbus TCP Client, access the 'Et
283
285
284
286
To begin communication with the configured Modbus TCP Server on the Portenta Machine Control, add a Modbus node by right-clicking the 'Ethernet' section within the 'Resources' panel. This action will reveal the 'Add' button. Clicking on it will allow you to introduce a 'Generic Modbus' node. For this example, set the node with the following specific parameters:
285
287
286
-
*_Name_: PMC_TCP_1
287
-
*_IP address_: 192.168.1.2
288
-
*_Minimum polling time_: 1 ms
289
-
*_Address type_: Modbus
288
+
*Name: PMC_TCP_1
289
+
*IP address: 192.168.1.2
290
+
*Minimum polling time: 1 ms
291
+
*Address type: Modbus
290
292
291
293
The settings for these properties should mirror those for the Modbus TCP Server Portenta Machine Control. The IP address is the most vital configuration to take into account. Ensure that this address matches the one given to the server Portenta Machine Control or any other compatible devices if you add more nodes. The final configuration should resemble the image provided:
292
294
@@ -298,9 +300,9 @@ When defining the Modbus node for the Client Portenta Machine Control, it is ess
298
300
299
301
To retrieve counter information from the server Portenta Machine Control, choose the 'Modbus FC-04 (Read Input Registers)' function. To ensure correct data access, set up the 'General' tab using the subsequent parameters:
300
302
301
-
*_Start address_: 25000
302
-
*_Polling time_: 0 ms (Continuous Read)
303
-
*_Timeout_: 1000 ms
303
+
*Start address: 25000
304
+
*Polling time: 0 ms (Continuous Read)
305
+
*Timeout: 1000 ms
304
306
305
307

306
308
@@ -313,6 +315,7 @@ The following image shows a visual representation of the expected configuration:
313
315
The Modbus TCP Client Portenta Machine Control will use the following Ethernet properties for this example.
0 commit comments