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_server_mainCode.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_server_statVar.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
+8-12Lines changed: 8 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -206,11 +206,11 @@ void setup()
206
206
{
207
207
// Configure static IP address
208
208
IPAddress ip(192, 168, 1, 2);
209
-
IPAddress dns(192, 168, 1, 23);
209
+
IPAddress dns(192, 168, 1, 23);
210
210
IPAddress gateway(192, 168, 1, 23);
211
211
IPAddress subnet(255, 255, 255, 0);
212
-
// If cable is not connected this will block the start of PLC with about 60s of timeout!
213
-
Ethernet.begin(ip, dns, gateway, subnet);
212
+
// If cable is not connected this will block the start of PLC with about 60s of timeout!
213
+
Ethernet.begin(ip, dns, gateway, subnet);
214
214
}
215
215
```
216
216
@@ -220,7 +220,7 @@ Upon starting a new project file in the PLC IDE, some crucial lines within the s
220
220
221
221
The subsequent image presents the `Status variables (volatile)` window. In this window, the `cnt` variable will be defined, where its access address and datatype will be specified for Modbus TCP communication.
222
222
223
-

223
+

224
224
225
225
The `cnt` status variable uses the following parameters:
226
226
@@ -270,15 +270,11 @@ END_IF;
270
270
271
271
The main role of the Portenta Machine Control server is to operate a binary counter, programmed using digital outputs determined by a sub-counter variable, `cnt`. This variable operates within an 8-Bit value range. The counter's speed is modulated through `counter_buffer` and `delay_buffer`, using as adjustable timing parameters. For the client Portenta Machine Control, the shared Modbus counter variable known as `counter_stack` is used.
272
272
273
-

273
+

274
274
275
275
To integrate the `counter_buffer` and `delay_buffer` variables, access the `New Variable` option by right-clicking on `Global_vars`. While `counter_buffer` can be designated as an `automatic` variable, `delay_buffer` was originally defined as a `constant` variable with a set value.
276
276
277
-
For deploying the main PLC code to the Portenta Machine Control, choose `Download PLC code` or simply press `F7`. With everything set up correctly, a successful upload should resemble the following image.
278
-
279
-

280
-
281
-
Upon completing these instructions, you will have set up the Portenta Machine Control device as a Modbus TCP Server. The subsequent section will walk you through the process of configuring another Portenta Machine Control as a Modbus TCP Client.
277
+
For deploying the main PLC code to the Portenta Machine Control, choose `Download PLC code` or simply press `F7`. Upon completing these instructions, you will have set up the Portenta Machine Control device as a Modbus TCP Server. The subsequent section will walk you through the process of configuring another Portenta Machine Control as a Modbus TCP Client.
282
278
283
279
#### Modbus TCP Client Portenta Machine Control
284
280
<br></br>
@@ -288,7 +284,7 @@ To configure the Portenta Machine Control as a Modbus TCP Client, start by acces
288
284
To begin communication with the configured Modbus TCP Server Portenta Machine Control, you can add a Modbus node. Right-click on the 'Ethernet' section within the 'Resources' panel. It will reveal the 'Add' button. Click on it to introduce a 'Generic Modbus' node. For this example, we can set the node using these specific parameters:
289
285
290
286
* Name: PMC_TCP_1
291
-
* IP address: 192.168.1.5
287
+
* IP address: 192.168.1.2
292
288
* Minimum polling time: 1 ms
293
289
* Address type: Modbus
294
290
@@ -424,7 +420,7 @@ Furthermore, through a practical example, you have learned how to ensure that th
424
420
425
421
### Next Steps
426
422
427
-
Now that you have learned to implement the Modbus TCP between Portenta Machine Control devices using Arduino PLC IDE, try expanding the setup by integrating additional Modbus TCP compatible devices into the communication network.
423
+
Now that you have learned to implement the Modbus TCP between Portenta Machine Control devices using Arduino PLC IDE, try expanding the setup by integrating additional Modbus TCP compatible devices into the communication network. You can enhance this setup further with Opta™. Learn more about it by watching this [video](https://youtu.be/reBrbCq86uQ).
428
424
429
425
Additionally, you can explore the possibilities by leveraging the onboard features of the Portenta Machine Control device combined with the Modbus TCP communication network. This combination offers a robust enhancement solution for industrial management systems.
0 commit comments