Skip to content

Commit bce566f

Browse files
committed
outputs
1 parent de70b55 commit bce566f

File tree

8 files changed

+58
-6
lines changed

8 files changed

+58
-6
lines changed
493 KB
Loading
648 KB
Loading
692 KB
Loading
690 KB
Loading
1.18 MB
Loading
715 KB
Loading

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

Lines changed: 58 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ Insert the following variable with it respective _type_ to store the input volta
151151
| :------: | :------: |
152152
| V_IN1 | REAL |
153153

154-
![Insert a local variable](assets/local-var-2.png)
154+
![Set up local variable](assets/local-var-2.png)
155155

156156
- 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.
157157

@@ -177,13 +177,13 @@ Now you can easily read this input current in your program. For example in a **S
177177

178178
![Insert a local variable](assets/local-var.png)
179179

180-
Insert the following variable with it respective _type_ to store the input voltage:
180+
Insert the following variable with it respective _type_ to store the input current:
181181

182182
| **Name** | **Type** |
183183
| :------: | :------: |
184184
| I_IN1 | REAL |
185185

186-
![Insert a local variable](assets/local-var-3.png)
186+
![Set up local variable](assets/local-var-3.png)
187187

188188
- 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.
189189

@@ -199,19 +199,71 @@ I_IN1 := IN1*25.0/65535.0;
199199

200200
### Analog RTD Input Mode
201201

202-
To set up an input in RTD mode for termperature measurement, navigate to **Programmable Channels** under your desired expansion in the left **Resources** menu. Define a variable name, `IN1` in this case and set the **IOType** to `Input - RTD 3 Wires` or `Input - RTD 2 Wires` .
202+
To set up an input in RTD mode for termperature measurement, navigate to **Programmable Channels** under your desired expansion in the left **Resources** menu. Define a variable name, `IN1` in this case and set the **IOType** to `Input - RTD 2 Wires` or `Input - RTD 3 Wires` .
203+
204+
![Current Input Configuration](assets/plc-ide-13.png)
205+
206+
***Channels I1 and I2 support 3 Wires RTD and 2 Wires RTD, all other channels only support 2 Wires RTD. If a 3 Wires RTD is defined, you need to set a current in mA for it, see your RTD datasheet.***
207+
208+
Now you can easily read this input resistance in your program. For example in a **Structured Language** program using a **PT100** sensor:
209+
210+
- 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.
211+
212+
![Insert a local variable](assets/local-var.png)
213+
214+
Insert the following variables with their respective _type_ and _attribute_:
215+
216+
| **Name** | **Type** | **Init value** | **Attribute** |
217+
| :------: | :------: | :------------: | :-----------: |
218+
| T_IN1 | REAL | - | - |
219+
| a | REAL | 0.0039083 | CONSTANT |
220+
| b | REAL | -0.0000005775 | CONSTANT |
221+
222+
![Set up local variable](assets/local-var-4.png)
203223

204-
![Current Input Configuration](assets/plc-ide-11.png)
224+
***__a__ and __b__ are PT100 constants.***
205225

206-
***Channels I1 and I2 support 3 Wires RTD and 2 Wires RTD, all other channels only support 2 Wires RTD.***
226+
- 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.
227+
228+
```
229+
T_IN1 := (-(1.0 / 100.0) * (50.0 * a - 10*sqrt(b * IN1 + 25.0 * pow(a, 2.0) - 100.0 * b))) / b;
230+
```
231+
232+
***The analog channel in RTD mode can measure up to 1 MΩ and to convert the resistive value of it into temperature, the above quadratic equation is needed.***
233+
234+
- Upload the program to your Opta and enable the **Live Debug Mode** to see the temperature readings updating in real-time.
235+
236+
![RTD Input Demo](assets/rtd-demo.png)
207237

208238
## Programmable Outputs
209239

240+
The Opta™ Analog Expansion has **8x analog programmable outputs** accessible through terminals `I1` to `I6` and `O1` to `O2` that can be used as:
241+
242+
| **Mode** | **Specification** |
243+
|:------------------------------:|:-----------------------------------------:|
244+
| Analog output voltage | 0...11 V |
245+
| Analog output current | 0...25 mA |
246+
247+
***Due to power dissipation limitations, it is recommended to have up to 2 channels set at output at the same time. At 25°C of ambient temperature, all the 8x channels set as outputs have been tested at the same time while outputting more than 24 mA at 10 V each (>0.24W per channel).***
248+
210249
### Analog Voltage Output Mode
211250

251+
212252
### Analog Current Output Mode
213253

214254
### PWM Output
255+
The Analog Expansion has 4x PWM output channels **(P1...P4)**. They are software configurable and for them to work you must provide the **V<sub>PWM</sub>** pin with the desired voltage.
256+
257+
| **V<sub>PWM</sub> Voltage** | **Details** |
258+
|:------------------------------:|:---------------------:|
259+
| Channels | P1, P2, P3, P4 |
260+
| Source voltage supported | 8...24 VDC + 20% |
261+
| Period | Programmable |
262+
| Duty-cycle | Programmable (0-100%) |
263+
| Max current draw (per channel) | 100 mA |
264+
| Max frequency | 10kHz |
265+
266+
![Example of wiring to use the PWM outputs using Opta power voltage as **V<sub>PWM</sub>** as voltage reference](assets/pwm-setup.png)
215267

216268
### Expansion Status LEDs
217269

0 commit comments

Comments
 (0)