Skip to content

Commit 07d3356

Browse files
committed
Julian review partially addressed
1 parent b310c6a commit 07d3356

File tree

1 file changed

+28
-25
lines changed
  • content/hardware/07.opta/opta-family/opta/tutorials/18.opta-analog-expansion-plc-ide

1 file changed

+28
-25
lines changed

content/hardware/07.opta/opta-family/opta/tutorials/18.opta-analog-expansion-plc-ide/content.md

+28-25
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,16 @@ software:
1717
---
1818

1919
## Overview
20-
In this tutorial, you will learn how to use Opta™ Analog Expansion AFX00007 alongside an Opta™ controller.
20+
In this tutorial you will learn how to use Opta™ Analog Expansion AFX00007 alongside an Opta™ controller using the Arduino PLC IDE.
2121

2222
![Opta Analog Expansion Overview](assets/analog-current.png)
2323

24-
We will go through every feature of the Analog Expansion and learn with a simple example how to leverage it for industrial sensor sampling and output controlling.
24+
We will go through every feature of the Analog Expansion and learn with simple examples how to leverage it for industrial sensor sampling and output controlling.
2525

2626
## Goals
2727

2828
- Learn how to use Opta™ Analog Expansion with the PLC IDE
29-
- Learn how to enhance your Opta™ controller's capabilities using Opta™ expansions
29+
- Learn how to enhance your Opta™ controller's capabilities using Opta™ Analog Expansions
3030
- Leverage Arduino Pro products for real industrial applications
3131

3232
## Hardware and Software Requirements
@@ -36,12 +36,13 @@ We will go through every feature of the Analog Expansion and learn with a simple
3636
- [AFX00007 - Opta Ext A0602](https://store.arduino.cc/products/Opta-Ext-A0602) (x1)
3737
- 12-24 VDC/0.5 A power supply (x1)
3838
- [USB-C® cable](https://store-usa.arduino.cc/products/usb-cable2in1-type-c) (x1)
39+
- Stranded wire 4 mm<sup>2</sup> (12 AWG).
3940

4041
### Software
41-
- The [Arduino PLC IDE](https://www.arduino.cc/pro/software-plc-ide)
42-
- [Arduino_Opta_Blueprint](https://github.com/arduino-libraries/Arduino_Opta_Blueprint) library to update Expansion Firmware.
42+
- The [Arduino PLC IDE v1.0.7 or higher](https://www.arduino.cc/pro/software-plc-ide)
43+
- [Arduino_Opta_Blueprint v0.2.3 or higher](https://github.com/arduino-libraries/Arduino_Opta_Blueprint) library to update Expansion Firmware.
4344

44-
***The Analog Expansion firmware must be updated to the 0.1.5 version or higher.***
45+
***The Analog Expansion firmware must be updated to the 0.1.5 version or higher. To do it open the [Arduino IDE](https://www.arduino.cc/en/software), install the library [Arduino_Opta_Blueprint](https://github.com/arduino-libraries/Arduino_Opta_Blueprint) and open the example: Arduino_Opta_Blueprint -> UpdateExpansionFw.***
4546

4647
## Initial Configuration
4748

@@ -63,9 +64,9 @@ The expansions must be powered externally in order to be detected and properly w
6364

6465
After downloading the [PLC IDE](https://www.arduino.cc/en/software#arduino-plc-ide), follow the installation process from the following [guide](https://docs.arduino.cc/software/plc-ide/tutorials/plc-ide-setup-license/).
6566

66-
Open the PLC IDE and create a new project for the Opta™.
67+
Open the PLC IDE and create a new project for Opta™.
6768

68-
![New project for the Opta™](assets/plc-ide-1.png)
69+
![Creating a new project for Opta™](assets/plc-ide-1.png)
6970

7071
Connect the Opta controller to your PC using a USB-C® cable. Then, upload the runtime for Opta™ by selecting its Serial Port and clicking on the **Download** button.
7172

@@ -84,14 +85,16 @@ Next, click the **Connect** button in the upper left corner and wait for the bas
8485

8586
***The Opta™ is pre-licensed, meaning no additional license purchase is required for use with the PLC IDE.***
8687

87-
If the Opta™ status displays **No License**, click the **Activate PLC runtime** button to activate it. For more details, refer to this [guide](https://docs.arduino.cc/tutorials/portenta-machine-control/plc-ide-setup-license/#7-license-activation-with-pre-licensed-products-opta).
88+
If the Opta™ status displays **No License**, click the **Activate PLC runtime** button to activate it. The program will ask you to reset Opta but sometimes it could be also necessary to completely disconnect Opta from the computer and the external power and connect it again. For more details, refer to this [guide](https://docs.arduino.cc/tutorials/portenta-machine-control/plc-ide-setup-license/#7-license-activation-with-pre-licensed-products-opta).
8889

8990
### Analog Expansion Setup
9091

9192
To enable the Opta™ Analog Expansion features in the PLC IDE, navigate to the **Resources** tab and select **I/O Expansions** in the configuration tree. Then click **Scan** to allow the IDE to search for connected expansions.
9293

9394
![Scanning for expansions](assets/plc-ide-6.png)
9495

96+
***A popup warning may appear telling you that the configuration does not match, you can accept it and continue to the next step.***
97+
9598
Once the available expansion appears in the **Detected config** column, enable it by clicking on **Apply detect config**. Verify that the **Project config** column is updated.
9699

97100
![Adding the expansion to the environment](assets/plc-ide-7.png)
@@ -157,7 +160,7 @@ Insert the following variable with its respective _type_ to store the input volt
157160

158161
![Set up local variable](assets/local-var-2.png)
159162

160-
- In the main code editor add the following formula to convert the ADC raw reading to a voltage and store it in the `V_IN1` variable.
163+
- In the main code editor clear the default counter example and add the following formula to convert the ADC raw reading to a voltage and store it in the `V_IN1` variable.
161164

162165
```
163166
V_IN1 := IN1*10.0/65535.0;
@@ -189,7 +192,7 @@ Insert the following variable with it respective _type_ to store the input curre
189192

190193
![Set up local variable](assets/local-var-3.png)
191194

192-
- In the main code editor add the following formula to convert the ADC raw reading to a current and store it in the `I_IN1` variable.
195+
- In the main code editor clear the default counter example and add the following formula to convert the ADC raw reading to a current and store it in the `I_IN1` variable.
193196

194197
```
195198
I_IN1 := IN1*25.0/65535.0;
@@ -227,7 +230,7 @@ Insert the following variables with their respective _type_ and _attribute_:
227230

228231
***__a__ and __b__ are PT100 constants.***
229232

230-
- In the main code editor add the following formula to convert the input resistive reading to a temperature and store it in the `T_IN1` variable.
233+
- In the main code editor clear the default counter example and add the following formula to convert the input resistive reading to a temperature and store it in the `T_IN1` variable.
231234

232235
```
233236
T_IN1 := (-(1.0 / 100.0) * (50.0 * a - 10*sqrt(b * IN1 + 25.0 * pow(a, 2.0) - 100.0 * b))) / b;
@@ -258,7 +261,7 @@ To set up an output in voltage mode, navigate to **Programmable Channels** under
258261

259262
Now you can easily control this output voltage in your program. For example in a **Structured Text** program:
260263

261-
- In the main code editor use the following sketch to set the output voltage, it will increase from 0 to 11 V and then go back to 0 V.
264+
- In the main code editor clear the default counter example and use the following sketch to set the output voltage, it will increase from 0 to 11 V and then go back to 0 V.
262265

263266
```
264267
OUT1 := OUT1 + 10;
@@ -273,9 +276,9 @@ END_IF;
273276

274277
***The analog channel in voltage mode can generate up to 11 V and the DAC resolution is 13 bit, this is why we use the 8191 constant that corresponds to 2<sup>13</sup>-1.***
275278

276-
- Modify the task speed by right clicking in **Task > Fast** then click on **Task configuration** and set the Fast task period to 50 ms.
279+
- To make sure the runtime can comply with the Analog Expansion actions programmed, modify the task speed by right-clicking in **Task > Fast** then clicking on **Task configuration** and setting the Fast task period to 50 ms.
277280

278-
[Task speed configuration](assets/plc-ide-19.png)
281+
![Task speed configuration](assets/plc-ide-19.png)
279282

280283
- Upload the program to your Opta and enable the **Live Debug Mode** to see the output updating in real-time and use a voltmeter to measure the output.
281284

@@ -289,7 +292,7 @@ To set up an output in current mode, navigate to **Programmable Channels** under
289292

290293
Now you can easily control this output current in your program. For example in a **Structured Text** program:
291294

292-
- In the main code editor use the following sketch to set the output current, it will increase from 0 to 25 mA and then go back to 0 mA.
295+
- In the main code editor clear the default counter example and use the following sketch to set the output current, it will increase from 0 to 25 mA and then go back to 0 mA.
293296

294297
```
295298
OUT1 := OUT1 + 10;
@@ -304,11 +307,11 @@ END_IF;
304307

305308
***The analog channel in current mode can generate up to 25 mA and the DAC resolution is 13 bit, this is why we use the 8191 constant that corresponds to 2<sup>13</sup>-1.***
306309

307-
- Modify the task speed by right clicking in **Task > Fast** then click on **Task configuration** and set the Fast task period to 50 ms.
310+
- To make sure the runtime can comply with the Analog Expansion actions programmed, modify the task speed by right-clicking in **Task > Fast** then clicking on **Task configuration** and setting the Fast task period to 50 ms.
308311

309-
[Task speed configuration](assets/plc-ide-19.png)
312+
![Task speed configuration](assets/plc-ide-19.png)
310313

311-
- Upload the program to your Opta and enable the **Live Debug Mode** to see the output updating in real-time and use an ampmeter to measure the output on **O1**.
314+
- Upload the program to your Opta and enable the **Live Debug Mode** to see the output updating in real-time and use an ammeter to measure the output on **O1**.
312315

313316
![Current Output Demo](assets/analog-current.png)
314317

@@ -332,7 +335,7 @@ To configure a PWM output, navigate to **PWM Outputs** under your desired expans
332335

333336
Now you can easily control this output PWM period and pulse in your program. For example in a **Structured Text** program:
334337

335-
- Open your project main program navigating to the **Project** tab in the left panel, select **Main** in the project tree, and right-click on the **Local variables** window to insert a variable.
338+
- Open your project main program by navigating to the **Project** tab in the left panel, select **Main** in the project tree, and right-click on the **Local variables** window to insert a variable.
336339

337340
![Insert a local variable](assets/local-var.png)
338341

@@ -342,11 +345,11 @@ Insert the following variable with its respective _type_ and _attribute_:
342345
| :------: | :------: | :------------: | :-----------: |
343346
| PERIOD | INT | 1000 | CONSTANT |
344347

345-
![Set up local variable](assets/local-var-5.png)
348+
![Set up a local variable](assets/local-var-5.png)
346349

347350
***PERIOD and PULSE values are in microseconds.***
348351

349-
- In the main code editor use the following sketch to set the PWM signal period and pulse times.
352+
- In the main code editor clear the default counter example and use the following sketch to set the PWM signal period and pulse times.
350353

351354
```
352355
P1_PERIOD := PERIOD; // 1000 us period = 1 kHz
@@ -360,9 +363,9 @@ END_IF;
360363

361364
***The PWM output voltage is defined by the voltage applied to __V<sub>PWM</sub>__ from 8 to 24 V.***
362365

363-
- Modify the task speed by right clicking in **Task > Fast** then click on **Task configuration** and set the Fast task period to 50 ms.
366+
- To make sure the runtime can comply with the Analog Expansion actions programmed, modify the task speed by right-clicking in **Task > Fast** then clicking on **Task configuration** and setting the Fast task period to 50 ms.
364367

365-
[Task speed configuration](assets/plc-ide-19.png)
368+
![Task speed configuration](assets/plc-ide-19.png)
366369

367370
- Upload the program to your Opta and enable the **Live Debug Mode** to see the output updating in real-time and use an oscilloscope to measure the output on **P1**.
368371

@@ -396,7 +399,7 @@ Now you can easily control the LED state by pressing the button with a simple pr
396399

397400
### Conclusion
398401

399-
In this tutorial, you have learned how to use an Opta™ Analog Expansion by demonstrating the use of each product features.
402+
In this tutorial, you have learned how to use an Opta™ Analog Expansion with the PLC IDE by demonstrating the use of each product features.
400403

401404
As you can see, the configuration process is straightforward, and the results are as expected. This serves as an excellent starting point for adapting the techniques covered here to develop your professional solutions.
402405

0 commit comments

Comments
 (0)