Skip to content

Commit c066135

Browse files
committed
Tutorial Started
1 parent d51a3ce commit c066135

File tree

1 file changed

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

1 file changed

+12
-29
lines changed

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

Lines changed: 12 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -17,31 +17,30 @@ software:
1717
---
1818

1919
## Overview
20-
In this tutorial, you will learn how to use Opta™ Digital Expansions AFX00005 and AFX00006 alongside an Opta™ controller.
20+
In this tutorial, you will learn how to use Opta™ Analog Expansion AFX00007 alongside an Opta™ controller.
2121

2222
![Final application showcase](assets/animation.gif)
2323

2424
We will create a demo application from scratch, in which we will read the voltage from an analog sensor and control the expansion relay outputs based on the voltage level measured.
2525

2626
## Goals
2727

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

3232
## Hardware and Software Requirements
3333

3434
### Hardware
3535
- [Opta™](https://store-usa.arduino.cc/collections/opta-family) (x1)
36-
- [AFX00005 - Opta Ext D1608E](https://store.arduino.cc/products/Opta-Ext-D1608E) (x1)
37-
- [AFX00006 - Opta Ext D1608S](https://store.arduino.cc/products/Opta-Ext-D1608S) (x1)
36+
- [AFX00007 - Opta Ext A0602](https://store.arduino.cc/products/Opta-Ext-A0602) (x1)
3837
- 12-24 VDC/0.5 A power supply (x1)
3938
- [USB-C® cable](https://store-usa.arduino.cc/products/usb-cable2in1-type-c) (x1)
4039

4140
### Software
4241
- The [Arduino PLC IDE](https://www.arduino.cc/pro/software-plc-ide)
4342

44-
## Instructions
43+
## Initial Configuration
4544

4645
### Snapping the Expansion
4746

@@ -55,18 +54,7 @@ Attach the expansions to the right side of your Opta™ controller. Ensure that
5554

5655
The expansions must be powered externally in order to be detected and properly work.
5756

58-
![Powering the expansions](assets/power-expansion.png)
59-
60-
### Solution Wiring
61-
62-
The following wiring setup will be used for the solution explained in this tutorial.
63-
64-
![Solution example wiring](assets/wiring-ext.png)
65-
66-
- In the **Opta™**, connect the power supply to the respective inputs on the screw terminals.
67-
- From the **Opta™** power screw terminals, wire the power to the Opta™ expansion.
68-
- Connect the sensor output to the **I1** input of the Opta™ expansion, specifically the variable tap of the potentiometer.
69-
- Power the sensor using its respective power source, which in this case is the power screw terminals of the expansion.
57+
![Powering the expansions](assets/power-expansion-2.png)
7058

7159
### Opta™ Micro PLC Setup
7260

@@ -95,16 +83,20 @@ Next, click the **Connect** button in the upper left corner and wait for the bas
9583

9684
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).
9785

98-
### Solution Setup
86+
### Analog Expansion Setup
9987

100-
To enable the Opta™ Digital 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.
88+
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.
10189

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

10492
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.
10593

10694
![Adding the expansion to the environment](assets/plc-ide-7.png)
10795

96+
## Programmable Inputs
97+
98+
99+
108100
To set up the sensor input for the potentiometer, navigate to **Programmable Inputs** under your desired expansion in the left resources menu. Define a **variable** name, **sensor** in this case, and set the **IOType** to **Analog**.
109101

110102
![Setting up the sensor input](assets/plc-ide-8.png)
@@ -135,51 +127,42 @@ Copy and paste the following sketch to the **Main code** text editor:
135127

136128
```
137129
VSTEP := VCC/8;
138-
139130
VIN := sensor*1.733E-3;
140-
141131
IF VIN >= VSTEP*1 THEN
142132
out_1 := TRUE;
143133
ELSE
144134
out_1 := FALSE;
145135
END_IF;
146-
147136
IF VIN >= VSTEP*2 THEN
148137
out_2 := TRUE;
149138
ELSE
150139
out_2 := FALSE;
151140
END_IF;
152-
153141
IF VIN >= VSTEP*3 THEN
154142
out_3 := TRUE;
155143
ELSE
156144
out_3 := FALSE;
157145
END_IF;
158-
159146
IF VIN >= VSTEP*4 THEN
160147
out_4 := TRUE;
161148
ELSE
162149
out_4 := FALSE;
163150
END_IF;
164-
165151
IF VIN >= VSTEP*5 THEN
166152
out_5 := TRUE;
167153
ELSE
168154
out_5 := FALSE;
169155
END_IF;
170-
171156
IF VIN >= VSTEP*6 THEN
172157
out_6 := TRUE;
173158
ELSE
174159
out_6 := FALSE;
175160
END_IF;
176-
177161
IF VIN >= VSTEP*7 THEN
178162
out_7 := TRUE;
179163
ELSE
180164
out_7 := FALSE;
181165
END_IF;
182-
183166
IF VIN >= VSTEP*8 THEN
184167
out_8 := TRUE;
185168
ELSE
@@ -214,4 +197,4 @@ Extend your knowledge about the Opta™ controller and the PLC IDE by following
214197
- [Arduino PLC IDE Setup & Device License Activation](https://docs.arduino.cc/tutorials/portenta-machine-control/plc-ide-setup-license/)
215198
- [Programming Introduction with Arduino PLC IDE](https://docs.arduino.cc/tutorials/portenta-machine-control/plc-programming-introduction/)
216199
- [Tank Level Monitoring with the Opta™](https://docs.arduino.cc/tutorials/opta/tank-level-app-note/)
217-
- [Modbus TCP with Portenta Machine Control & Opta™](https://docs.arduino.cc/tutorials/portenta-machine-control/pmc-opta-modbus-tcp/)
200+
- [Modbus TCP with Portenta Machine Control & Opta™](https://docs.arduino.cc/tutorials/portenta-machine-control/pmc-opta-modbus-tcp/)

0 commit comments

Comments
 (0)