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/user-manual/content.md
+8-20Lines changed: 8 additions & 20 deletions
Original file line number
Diff line number
Diff line change
@@ -1434,25 +1434,15 @@ You should see the four onboard LEDs of the Opta™ device turn on and off, as s
1434
1434
1435
1435

1436
1436
1437
-
The following example shows how to establish Modbus RTU communication between two Portenta Machine Control devices. Since Portenta Machine Control supports half-duplex and full-duplex modes, each mode requires a different wiring setup.
1437
+
The following example shows how to establish Modbus RTU communication between **two Portenta Machine Control devices**. Since Portenta Machine Control supports half-duplex and full-duplex modes, each mode requires a different wiring setup.
1438
1438
1439
1439
We will begin showing **Full-Duplex mode** example following the connection diagram below between two Portenta Machine Control devices:
1440
1440
1441
-
TODO Update image with two PMC in full-duplex wiring
1441
+

1442
1442
1443
-

1444
-
1445
-
The following script assigns a Portenta Machine Control as a Client device, which sends four coils to the Server Portenta Machine Control.
1443
+
The following script assigns a Portenta Machine Control as a Client device, which sends four coil values to the Portenta Machine Control assigned as a Server.
1446
1444
1447
1445
```arduino
1448
-
/*
1449
-
Portenta's Machine Control Modbus RTU Client Example
Purpose: Demonstrates controlling Modbus RTU coils using a
1452
-
Portenta Machine Control device.
1453
-
@author Arduino PRO Content Team
1454
-
@version 1.0 01/10/23
1455
-
*/
1456
1446
// Include the necessary libraries
1457
1447
#include <Arduino_PortentaMachineControl.h>
1458
1448
#include <ArduinoRS485.h>
@@ -1530,13 +1520,13 @@ void loop() {
1530
1520
}
1531
1521
```
1532
1522
1533
-
Because the Portenta Machine Control is operating in Full-Duplex mode, the following line is essential and must be included within the code to enable Full-Duplex mode:
1523
+
Because the Portenta Machine Control is operating in **Full-Duplex mode**, the following line of code is essential and must be included within the code to enable Full-Duplex mode:
1534
1524
1535
1525
```arduino
1536
1526
MachineControl_RS485Comm.setFullDuplex(true);
1537
1527
```
1538
1528
1539
-
The Server Portenta Machine Control uses the script below, which translates received coils into corresponding Digital Outputs. It will blink four Digital Outputs accordingly in a timely manner.
1529
+
The Server Portenta Machine Control uses the script below, which translates received coil values into corresponding Digital Outputs. It will blink four Digital Outputs accordingly in a timely manner.
1540
1530
1541
1531
```arduino
1542
1532
// Include the necessary libraries
@@ -1642,17 +1632,15 @@ With this, we have two Portenta Machine Control devices, each assigned as a Clie
1642
1632
1643
1633
Alternatively, to establish communication between two Portenta Machine Control with Modbus RTU in **Half-Duplex mode**, the following wiring setup is required:
1644
1634
1645
-
TODO Update image with two PMC in half-duplex wiring
1646
-
1647
-

1635
+

1648
1636
1649
-
Previous examples can be used in half-duplex mode, and it requires only one minor change in the following line:
1637
+
Previous examples can be used in half-duplex mode, and it requires only one minor change in the following line of code:
1650
1638
1651
1639
```arduino
1652
1640
MachineControl_RS485Comm.setFullDuplex(false);
1653
1641
```
1654
1642
1655
-
The line can be updated to disable *Full-Duplex* mode or to ignore the corresponding process by commenting the line. Thus, with the complementary wiring setup and code changes, two devices will begin communicating with Modbus RTU in half-duplex mode.
1643
+
The line can be updated to disable *Full-Duplex* mode or to ignore the corresponding process by commenting the line. Thus, with the complementary wiring setup and minor code changes, two devices will begin communicating with Modbus RTU in half-duplex mode.
0 commit comments