Summary: To read a temperature once every second for one minute.
![]() Figure 1 |
thermometer, located on the
Controls>>Numeric Indicators palette, on
the front panel. This provides a visual indication of
the temperature reading.
numeric indicator, located on the
Controls>>Numeric Indicators palette, on
the front panel. Label this indicator Seconds
Elapsed. Right-click the indicator and select
Representation>>I32 from the shortcut
menu.
![]() Figure 2 |
| - |
Place a For Loop, located on the
Functions>>All Functions>>Structures palette, on
the block diagram. Right-click the Loop
Count terminal in the upper left corner of the
For Loop and select Create
Constant from the shortcut menu. Type
60 in the constant to set the For
Loop to repeat 60 times.
| |
| - |
Thermometer VI on the block
diagram. Select Functions>>All Functions>>Select a
VI and navigate to C:\Exercises\LabVIEW
Basics I\Thermometer.vito place the VI. This VI
reads the temperature from the DAQ device. Right-click
the Temp Scale input and select
Create>>Constant from the shortcut
menu. Use a False constant for Fahrenheit
or a True constant for Celsius. Note:
If
you do not have a DAQ device with a temperature sensor
on Channel 0, use the
(Demo) Thermometer VI
instead.
| |
| - |
Place the Wait Until Next ms Multiple
function, located on the Functions>>All
Functions>>Time & Dialog palette, on the
block diagram. Right-click the input and select
Create>>Constant from the shortcut
menu. Enter a value of 1000 to set the wait
to every second. | |
| - |
Increment function, located
on the Functions>>Arithmetic &
Comparison>>Express Numeric palette, on the
block diagram. This function adds one to the
iteration terminal output.
|
Timed Temperature.vi in the
C:\Exercises\LabVIEW Basics I directory.
While Loop and stops when you click a stop
button on the front panel.
General While Loop.vi in the
C:\Exercises\LabVIEW Basics I directory.
General While Loop VI to stop when
the stop button is clicked or when the While
Loop reaches a number of iterations specified by a
front panel control.
File>>Save As to save the VI as
Combo While-For Loop.vi in the
C:\Exercises\LabVIEW Basics I directory.
Comments, questions, feedback, criticisms?
"A full introductory course on programming with LabVIEW."