-
Open the Temperature Control VI
and save it as
Temperature Logger.viin theC:\Exercises\LabVIEW Basics Idirectory. You do not need to modify the front panel. -
Open and modify the block diagram as shown in Figure 1. Resize the
While Loopto add space at the top for the file I/O operations.Figure 1 
-
Place the Open/Create/Replace FileVI, located on theFunctions>>All Functions>>File I/Opalette, on the block diagram. Right-click thepromptinput, selectCreate Constantfrom the shortcut menu and typeEnter File Namein the constant. Right-click thefunctioninput, selectCreate Constantfrom the shortcut menu, and click the constant with theOperatingtool to selectcreate or replace. -
Place the Get Date/Time Stringfunction, located on theFunctions>>All Functions>>Time & Dialogpalette, on the block diagram. This function returns the time, in string format, when the temperature measurement was taken. Right-click thewant seconds?input, selectCreate>>Constantfrom the shortcut menu, and click the constant with the Operating tool to change the constant fromFalsetoTrue. TheTrueBoolean constant sets the function to include seconds in the string. -
Place the Build TextExpress VI, located on theFunctions>>Outputpalette, on the block diagram. This Express VI converts the inputs to one string. TheConfigure Build Textdialog box appears.-
Type
%tab%%temp%%end%in theText with Variables in Percentstext box to set up three variables; one for the tab constant, one for the temperature and one for the end of line constant. Because time uses theBeginning Textinput of theBuild TextExpress VI, it does not need a variable. -
Select
tempin theConfigure Variablessection. Select theNumberoption, and a format ofFormat fractional number. Thetabandendvariables do not need to be formatted. You can leave them in the default state. -
Click the
OKbutton to close the configuration dialog box. -
Right-click the
Build Text Express VIand selectView As Iconto conserve block diagram space.
-
Type
-
Place a Tab constantand anEnd of Line constant, located on theFunctions>>All Functions>>Stringpalette, on the block diagram. -
Place the Write Filefunction, located on theFunctions>>All Functions>>File I/Opalette, on the block diagram. This function writes to the file specified byrefnum. -
Place the Close Filefunction, located on theFunctions>>All Functions>>File I/Opalette, on the block diagram. This function closes the file. -
Place the Simple Error HandlerVI, located on theFunctions>>All Functions>>Time & Dialogpalette, on the block diagram. This VI checks the error cluster and displays a dialog box if an error occurs. - Complete the block diagram as shown in Figure 1.
-
- Save the VI. You will use this VI later in the course.












"A full introductory course on programming with LabVIEW."