Skip to content

Commit a355f88

Browse files
committed
analog voltage input
1 parent 1b1a3d0 commit a355f88

File tree

6 files changed

+33
-1
lines changed

6 files changed

+33
-1
lines changed
438 KB
Loading
193 KB
Loading
707 KB
Loading

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

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,12 +129,42 @@ For example in a **Ladder Diagram**:
129129

130130
![Ladder variables assigning](assets/digital-ld.gif)
131131

132-
- Upload the program to your Opta and enable the **Live Debug Mode** if you want to see the contacts and coils updating in real-time.
132+
- Upload the program to your Opta and enable the **Live Debug Mode** to see the contacts and coils updating in real-time.
133133

134134
![Digital Input Demo](assets/digital-in-demo.gif)
135135

136136
### Analog Voltage Input Mode
137137

138+
To set up an input in voltage mode, 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 - Voltage ADC`.
139+
140+
![Voltage Input Configuration](assets/plc-ide-9.png)
141+
142+
Now you can easily read this input voltage in your program. For example in a **Structured Language** program:
143+
144+
- 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.
145+
146+
![Insert a local variable](assets/local-var.png)
147+
148+
Insert the following variable with it respective _type_ to store the input voltage:
149+
150+
| **Name** | **Type** |
151+
| :------: | :------: |
152+
| V_IN1 | REAL |
153+
154+
![Insert a local variable](assets/local-var-2.png)
155+
156+
- 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.
157+
158+
```
159+
V_IN1 := IN1*10.0/65536.0;
160+
```
161+
162+
***The analog channel in voltage mode can measure up to 10 VDC and the ADC resolution is 16 bit, this is why we use the 65536 constant that corresponds to 2<sup>16</sup>.***
163+
164+
- Upload the program to your Opta and enable the **Live Debug Mode** to see the analog readings updating in real-time.
165+
166+
![Analog Voltage Input Demo](assets/voltage-in-ani.gif)
167+
138168
### Analog Current Input Mode
139169

140170
### Analog RTD Input Mode
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../../hardware/07.opta/opta-family/opta/tutorials/18.opta-analog-expansion-plc-ide/
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../../hardware/07.opta/opta-family/opta/tutorials/18.opta-analog-expansion-plc-ide/

0 commit comments

Comments
 (0)