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 OutputVI located in theC:\Exercises\LabVIEW Basics Idirectory. The front panel is already built.Figure 1 Voltage Outputdisplays the current voltage output.
1.B) Block Diagram
- Display and examine the block diagram.
Figure 2 The
Wait Until Next ms Multiplefunction located on theFunctions>>All Functions>>Time & Dialogpalette causes theFor Loopto execute every 500 ms.The
SelectVI located on theFunctions>>Arithmetic & Comparison>>Express Comparisonpalette 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.
- Modify the block diagram as shown in Figure 3.
Figure 3 Place the
DAQ AssistantExpress VI, located on theFunctions>>Outputpalette, in theFor Loop. Complete the following steps to configure this Express VI to generate an analog output voltage.- Select
Analog Output>>Voltagefor the measurement to make. - Select
Dev1>>ao0for the physical channel and click theFinishbutton. - In the
Analog Output Voltage Task Configurationdialog box that appears, configure theTask TimingtoGenerate 1 Sample. Change the output range minimum to0and maximum to10. - Click the
OKbutton to close theAnalog Output Voltage Task Configurationdialog 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.0and maximum to10.0.
1.D) Block Diagram
- Display the block diagram for the
VoltmeterVI and double-click theDAQ AssistantExpress VI to open theAnalog Input Voltage Task Configurationdialog box. - Right-click
Voltagein theChannel Listsection and selectChange Physical Channel. Selectai1for the channel because you wired the DAQ signal accessory to output a voltage onAnalog Out CH0and acquire the voltage fromAnalog In CH1. - Select
No Scalefrom theCustom Scalingpull-down menu. - Change the voltage range to
0to10. - Click the
OKbutton to close the dialog box. - Display the front panel and run the
VoltmeterVI. - To acquire and display the voltage output, run the
Voltage OutputVI. The Voltage Output VI outputs the voltage in 0.5 V increments from 0 to 9.5 V. When theFor Loopexecutes its last iteration, the VI outputs 0 V to reset the analog output channel.Figure 4 - Close both VIs.
No comments:
Post a Comment