Skip to content

Commit 1ddfb24

Browse files
committed
Minor patch
1 parent fc95a91 commit 1ddfb24

File tree

1 file changed

+16
-12
lines changed
  • content/hardware/05.pro-solutions/solutions-and-kits/portenta-machine-control/tutorials/pmc-opta-modbus-tcp

1 file changed

+16
-12
lines changed

content/hardware/05.pro-solutions/solutions-and-kits/portenta-machine-control/tutorials/pmc-opta-modbus-tcp/content.md

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ Here is a detailed guide in video format if you are a visual learner.
4242
- 24 VDC Power Supply (x2)
4343
### Software
4444
- The [Arduino PLC IDE](https://www.arduino.cc/pro/software-plc-ide) (including Arduino PLC IDE Tools)
45-
- [Portenta Machine Control - PLC IDE Activation](https://docs.arduino.cc/tutorials/portenta-machine-control/plc-ide-setup-license)
45+
- [Portenta Machine Control - PLC IDE Activation](https://store-usa.arduino.cc/products/plc-key-portenta-machine-control?queryID=undefined&selectedStore=us)
4646

4747
## Instructions
4848

@@ -62,7 +62,7 @@ After downloading the [PLC IDE](https://www.arduino.cc/pro/software-plc-ide), op
6262

6363
![New project for the PMC](assets/new-project.png)
6464

65-
We need a license for this product to be used with the PLC IDE that we can buy directly from the [Arduino store](https://store-usa.arduino.cc/products/plc-key-portenta-machine-control), it will include a **product key** needed to activate the device.
65+
A license is needed for this product to be used with the PLC IDE, you can buy it directly from the [Arduino store](https://store-usa.arduino.cc/products/plc-key-portenta-machine-control), and it will include the **product key** to activate the device.
6666

6767
Connect the PMC to the computer using a micro USB cable, the board needs to run a specific program (runtime) in order to interact with the **PLC IDE**. To flash it, select the device serial port and click on download.
6868

@@ -77,13 +77,13 @@ Now, in the upper left corner, click on the **Connect** button and wait for the
7777

7878
![Connecting the board](assets/connect.png)
7979

80-
The device will show its activation status, in this case, **No License** as is the first time we are using it with the PLC IDE. To activate it, paste the **product key** you bought in the highlighted box and click on **Activate**.
80+
The device will show its activation status, in this case, **No License** as it is the first time using it with the PLC IDE. To activate it, paste the **product key** you bought in the highlighted box and click on **Activate**.
8181

8282
![Activation process](assets/activate.png)
8383

8484
After that, the status should say **OK**, and now you are ready to start programming the Portenta Machine Control with the PLC IDE.
8585

86-
If want to learn more about the PLC IDE first setup, continue reading this [detailed guide](https://docs.arduino.cc/software/plc-ide/tutorials/plc-ide-setup-license/#6-license-activation-with-product-key-portenta-machine-control).
86+
To learn more about the PLC IDE first setup, continue reading this [detailed guide](https://docs.arduino.cc/software/plc-ide/tutorials/plc-ide-setup-license/#6-license-activation-with-product-key-portenta-machine-control).
8787

8888
#### Modbus TCP - Server
8989
For the Modbus TCP configuration, on the **resources tab** go to the **Ethernet** section. As noticed, the Modbus TCP Slave mode is always enabled, so you don't have to make any changes.
@@ -102,7 +102,7 @@ arduino::EthernetClass eth(&m_netInterface);
102102
void setup()
103103
{
104104
// Configure static IP address
105-
IPAddress ip(10, 0, 0, 157); // Portenta IP address
105+
IPAddress ip(10, 0, 0, 157); // PMC IP address
106106
IPAddress dns(10, 0, 0, 1); // gateway IP address
107107
IPAddress gateway(10, 0, 0, 1); // gateway IP address
108108
IPAddress subnet(255, 255, 255, 0);
@@ -113,7 +113,11 @@ void setup()
113113
```
114114
![Network settings for Modbus TCP](assets/ip-setup.png)
115115

116-
Now, create the variable that will be shared with the temperature sensor data in the network. For this, we go to **status variables** and click on **Add**, we give it a name, in this case: `temp_send`, change the variable address to `25000`, and the type to `REAL`.
116+
Now, create the variable that will be shared with the temperature sensor data in the network. For this, we go to **status variables** and click on **Add**. Configure it as follows:
117+
118+
- Name: `temp_send`
119+
- Address: `25000`
120+
- PLC type: `REAL`
117121

118122
![Temperature variable setup](assets/var-setup.png)
119123

@@ -151,7 +155,7 @@ Upload the runtime for Opta™ by selecting its serial port and clicking on the
151155

152156
Once the runtime is flashed, with your Opta™ connected to your router, search for its IP address on the router configurations.
153157

154-
On the PLC IDE, navigate to **On-line > Set up communication**, activate and then open the **ModbusTCP** properties, add the Opta™ IP address, then click "OK".
158+
On the PLC IDE, navigate to **On-line > Set up communication**, activate and then open the **ModbusTCP** properties. Add the Opta™ IP address, then click "OK".
155159

156160
![Modbus TCP connection](assets/modbus-prog-opta.png)
157161
![Modbus TCP IP setup](assets/modbus-ip-opta.png)
@@ -174,11 +178,11 @@ Then right-click on the **Ethernet** tab, click on **Add** and select the _Gener
174178

175179
![Modbus Device Configuration 1](assets/modbus-device.png)
176180

177-
On the `Generic Modbus_1` device settings, enter the Server IP, the Portenta Machine Control One.
181+
On the `Generic Modbus_1` device settings, enter the Server IP, the one from the Portenta Machine Control.
178182

179183
![Modbus Device Configuration 2](assets/modbus-device-2.png)
180184

181-
Right-click on the device and add the FC-04 Modbus function that will let us read the server input registers.
185+
Right-click on the device and add the **FC-04 Modbus** function that will let us read the server input registers.
182186

183187
![Modbus Device Configuration 3](assets/modbus-device-3.png)
184188

@@ -213,11 +217,11 @@ void setup()
213217
```
214218
![Network settings for Modbus TCP](assets/ip-setup-opta.png)
215219

216-
Finally, define the Opta™ outputs behavior in function of the temperature read from the Portenta Machine Control. For this, we go to the **resources tab > Relay Outputs** and we give a variable name to each relay, in this case, call them `relay_1`, 2, 3 and 4 respectively.
220+
Finally, define the Opta™ outputs behavior in function of the temperature read from the Portenta Machine Control. For this, go to the **resources tab > Relay Outputs** and give a variable name to each relay, in this case, call them `relay_1`, 2, 3 and 4 respectively.
217221

218222
![Outputs definitions](assets/outputs-opta.png)
219223

220-
The same with the LED outputs, LED1, 2, 3 and 4.
224+
The same with the LED outputs, `LED1`, 2, 3 and 4.
221225

222226
![LEDs definitions](assets/led-opta.png)
223227

@@ -227,7 +231,7 @@ Now, go to the main code in the Project tab. Create a variable by right-clicking
227231

228232
In the code editor, match the local variable with the shared one sent by the Portenta Machine Control.
229233

230-
And once stored locally, design the logic to control the outputs as you want. In this case, four different temperature levels will be set to control each output with the temperature rise respectively. Copy and paste the following script into the **main code** section.
234+
Once stored locally, design the logic to control the outputs as you want. In this case, four different temperature levels will be set to control each output with the temperature rise respectively. Copy and paste the following script into the **main code** section.
231235

232236
```
233237
temp_local:= temp_reg;

0 commit comments

Comments
 (0)