Summary: In this exercise, the objective is to output an analog voltage using a DAQ device. Complete the following steps to finish a VI that outputs voltage from 0 to 9.5 V in 0.5 V steps.
EXERCISE 1
- Connect Analog Out CH0 to Analog In CH1 on the DAQ Signal Accessory.
1.A) Front Panel
- Open the
Voltage Output
VI located in theC:\Exercises\LabVIEW Basics I
directory. The front panel is already built.Figure 1 Voltage Output
displays the current voltage output.
1.B) Block Diagram
- Display and examine the block diagram.
Figure 2 - The
Wait Until Next ms Multiple
function located on theFunctions>>All Functions>>Time & Dialog
palette causes theFor Loop
to execute every 500 ms. - The
Select
VI located on theFunctions>>Arithmetic & Comparison>>Express Comparison
palette checks if the loop is in its last iteration. If the loop is in its last iteration, then the DAQ device outputs 0 volts. This is a good technique to reset the output voltage to a known level. It is always a good idea to reset the output voltage to something that will not damage a device that is connected to the DAQ device.
- The
- Modify the block diagram as shown in Figure 3.Place the
Figure 3 DAQ Assistant
Express VI, located on theFunctions>>Output
palette, in theFor Loop
. Complete the following steps to configure this Express VI to generate an analog output voltage.- Select
Analog Output>>Voltage
for the measurement to make. - Select
Dev1>>ao0
for the physical channel and click theFinish
button. - In the
Analog Output Voltage Task Configuration
dialog box that appears, configure theTask Timing
toGenerate 1 Sample
. Change the output range minimum to0
and maximum to10
. - Click the
OK
button to close theAnalog Output Voltage Task Configuration
dialog box. This saves the settings specified for the task in theDAQ Assistant Express VI
.
- Select
- Save the VI.
- Close the block diagram but leave the front panel open.
1.C) Front Panel
- Open the Voltmeter VI.
- Configure the meter scale minimum to
0.0
and maximum to10.0
.
1.D) Block Diagram
- Display the block diagram for the
Voltmeter
VI and double-click theDAQ Assistant
Express VI to open theAnalog Input Voltage Task Configuration
dialog box. - Right-click
Voltage
in theChannel List
section and selectChange Physical Channel
. Selectai1
for the channel because you wired the DAQ signal accessory to output a voltage onAnalog Out CH0
and acquire the voltage fromAnalog In CH1
. - Select
No Scale
from theCustom Scaling
pull-down menu. - Change the voltage range to
0
to10
. - Click the
OK
button to close the dialog box. - Display the front panel and run the
Voltmeter
VI. - To acquire and display the voltage output, run the
Voltage Output
VI. The Voltage Output VI outputs the voltage in 0.5 V increments from 0 to 9.5 V. When theFor Loop
executes its last iteration, the VI outputs 0 V to reset the analog output channel.Figure 4 - Close both VIs.
No comments:
Post a Comment