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
- 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.
133
133
134
134

135
135
136
136
### Analog Voltage Input Mode
137
137
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`.
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
+

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
+

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
+

0 commit comments