Summary: In this exercise, the objective is to build a VI that uses the DevSim instrument driver VIs to acquire and plot voltages. Complete the following steps to build a VI that acquires a DC voltage measurement from the NI Instrument Simulator once every second and plots it in a waveform chart until you click a button. As each value is acquired, the VI compares it with the previous minimum and maximum values. The VI calculates and displays the minimum and maximum values continuously on the front panel.
File>>New, then select
Template>>Frameworks>>Single Loop Application
to open the Single Loop Application template
VI.
![]() Figure 1 |
Controls>>All Controls>>I/O palette, on the
front panel.
![]() Figure 2 |
Add Shift
Register from the shortcut menu.
NI DEVSIM Initialize
VI, located on the
Functions>>Input>>Instrument Drivers>>NI Device
Simulator palette, on the block diagram. This VI
opens communication between LabVIEW and the NI
Instrument Simulator.
ID Query input and
select Create>>Constant from the
shortcut menu. Use the Operating tool
to change the constant to a False
value.
Reset
input.
NI DEVSIM Multimeter
Configuration VI, located on the
Functions>>Input>>Instrument Drivers>>NI Device
Simulator>>Configuration palette, on the block
diagram. This VI configures the range of voltage
measurements that the NI Instrument Simulator
generates. The default is 0.0 to 10.0 V DC.
NI DEVSIM Measure DC
Voltage VI, located on the
Functions>>Input>>Instrument Drivers>>NI Device
Simulator>>Data palette, on the block
diagram. This VI returns a simulated voltage measurement
from the NI Instrument Simulator.
NI DEVSIM Close
VI, located on the
Functions>>Input>>Instrument Drivers>>NI Device
Simulator palette, on the block diagram. This VI
ends communication between LabVIEW and the NI Instrument
Simulator.
Max & Min
function, located on the Functions>>All
Functions>>Comparison palette, on the block
diagram. Use two of these functions to check the current
voltage against the minimum and maximum values stored in
the shift registers.
Place the Simple Error Handler
VI, located on the Functions>>All
Functions>>Time & Dialog palette, on the block
diagram. This VI displays a dialog box if an error
occurs and displays the error information.
Place the Unbundle by Name
function, located on the Functions>>All
Functions>>Cluster palette, on the block
diagram. This function accepts status from the error
cluster.
Place the Or function,
located on the Functions>>Arithmetic &
Comparison>>Express Boolean palette, on the block
diagram. This function controls when the While Loop
ends. If there is an error or you click the
Stop button, the While Loop stops.
Set the wait for the Time Delay
Express VI to 1 second.
Voltage Monitor.vi in the
C:\Exercises\LabVIEW Basics I directory.
Comments, questions, feedback, criticisms?
"A full introductory course on programming with LabVIEW."