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/07.opta/opta-family/opta/tutorials/18.opta-analog-expansion-plc-ide/content.md
+28-25
Original file line number
Diff line number
Diff line change
@@ -17,16 +17,16 @@ software:
17
17
---
18
18
19
19
## 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.
21
21
22
22

23
23
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.
25
25
26
26
## Goals
27
27
28
28
- 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
30
30
- Leverage Arduino Pro products for real industrial applications
31
31
32
32
## Hardware and Software Requirements
@@ -36,12 +36,13 @@ We will go through every feature of the Analog Expansion and learn with a simple
- 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.
43
44
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.***
45
46
46
47
## Initial Configuration
47
48
@@ -63,9 +64,9 @@ The expansions must be powered externally in order to be detected and properly w
63
64
64
65
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/).
65
66
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™.
67
68
68
-

69
+

69
70
70
71
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.
71
72
@@ -84,14 +85,16 @@ Next, click the **Connect** button in the upper left corner and wait for the bas
84
85
85
86
***The Opta™ is pre-licensed, meaning no additional license purchase is required for use with the PLC IDE.***
86
87
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).
88
89
89
90
### Analog Expansion Setup
90
91
91
92
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.
92
93
93
94

94
95
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
+
95
98
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.
96
99
97
100

@@ -157,7 +160,7 @@ Insert the following variable with its respective _type_ to store the input volt
157
160
158
161

159
162
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.
161
164
162
165
```
163
166
V_IN1 := IN1*10.0/65535.0;
@@ -189,7 +192,7 @@ Insert the following variable with it respective _type_ to store the input curre
189
192
190
193

191
194
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.
193
196
194
197
```
195
198
I_IN1 := IN1*25.0/65535.0;
@@ -227,7 +230,7 @@ Insert the following variables with their respective _type_ and _attribute_:
227
230
228
231
***__a__ and __b__ are PT100 constants.***
229
232
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.
@@ -258,7 +261,7 @@ To set up an output in voltage mode, navigate to **Programmable Channels** under
258
261
259
262
Now you can easily control this output voltage in your program. For example in a **Structured Text** program:
260
263
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.
262
265
263
266
```
264
267
OUT1 := OUT1 + 10;
@@ -273,9 +276,9 @@ END_IF;
273
276
274
277
***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.***
275
278
276
-
-Modify the task speed by rightclicking 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.
- 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.
281
284
@@ -289,7 +292,7 @@ To set up an output in current mode, navigate to **Programmable Channels** under
289
292
290
293
Now you can easily control this output current in your program. For example in a **Structured Text** program:
291
294
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.
293
296
294
297
```
295
298
OUT1 := OUT1 + 10;
@@ -304,11 +307,11 @@ END_IF;
304
307
305
308
***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.***
306
309
307
-
-Modify the task speed by rightclicking 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.
- 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**.
312
315
313
316

314
317
@@ -332,7 +335,7 @@ To configure a PWM output, navigate to **PWM Outputs** under your desired expans
332
335
333
336
Now you can easily control this output PWM period and pulse in your program. For example in a **Structured Text** program:
334
337
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.
336
339
337
340

338
341
@@ -342,11 +345,11 @@ Insert the following variable with its respective _type_ and _attribute_:

346
349
347
350
***PERIOD and PULSE values are in microseconds.***
348
351
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.
350
353
351
354
```
352
355
P1_PERIOD := PERIOD; // 1000 us period = 1 kHz
@@ -360,9 +363,9 @@ END_IF;
360
363
361
364
***The PWM output voltage is defined by the voltage applied to __V<sub>PWM</sub>__ from 8 to 24 V.***
362
365
363
-
-Modify the task speed by rightclicking 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.
- 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**.
368
371
@@ -396,7 +399,7 @@ Now you can easily control the LED state by pressing the button with a simple pr
396
399
397
400
### Conclusion
398
401
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.
400
403
401
404
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.
0 commit comments