Lesson 9
Accessing Files in LabVIEW
Describe the basic concept of file I/O and apply the
appropriate File I/O functions to a given scenario.
A. Accessing Files from LabVIEW
B. High-Level and Low-Level File I/O Functions
C. Comparing File Formats
1
LESSON 9 Accessing Files in LabVIEW
A. Accessing Files from
LabVIEW
Identify the steps for writing and reading files from a
LabVIEW application.
2
A. Accessing Files from LabVIEW
Typical File I/O Operations
Open/ Read
Close Check for
Create/ and/or
File Errors
Replace File Write to File
3
A. Accessing Files from LabVIEW
File I/O Palette for File Operation
Functions
4
LESSON 9 Accessing Files in LabVIEW
B. High-Level and Low-Level
File I/O Functions
Identify when to use high-level and low-level File I/O
functions.
5
B. High-Level and Low-Level File I/O Functions
High-Level File I/O
Open/ Read
Close Check for
Create/ and/or
Replace File Write to File File Errors
6
LESSON 9 Accessing Files in LabVIEW
Exercise 9-1
Exploring High-Level File I/O
Observe how a high-level file I/O VI writes to a spreadsheet-readable file.
7
LESSON 9 Accessing Files in LabVIEW
Exercise 9-1
Exploring High-Level File I/O
How would you include more columns of data in the log file?
8
B. High-Level and Low-Level File I/O Functions
Low-Level File I/O
Open/ Read
Close Check for
Create/ and/or
Replace File Write to File File Errors
9
B. High-Level and Low-Level File I/O Functions
File Refnums
Identify unique file I/O sessions.
refnum
10
B. High-Level and Low-Level File I/O Functions
Streaming Data to Disk
11
B. High-Level and Low-Level File I/O Functions
String Functions
Convert data types to text
12
LESSON 9 Accessing Files in LabVIEW
Exercise 9-2
Temperature Monitor VI—Logging Data
Modify a VI to create an ASCII file using disk streaming.
13
LESSON 9 Accessing Files in LabVIEW
Exercise 9-2
Temperature Monitor VI—Logging Data
What would happen if you used the Open/Create/Replace File and Close File
functions inside the While Loop?
14
LESSON 9 Accessing Files in LabVIEW
C. Comparing File Formats
Recognize different options for logging data to disk.
15
C. Comparing File Formats
Common Log File Formats
TDMS
ASCII/
LVM
Binary
16
C. Comparing File Formats
Comparing File Formats
ASCII Binary TDMS LVM
Easily
Exchangeable
Small disk
footprint
Random
read/write
access
Inherent
attributes
High-speed
streaming
LESSON 9 Accessing Files in LabVIEW
Activity 9-1
Lesson Review
Refer to the participant guide to answer questions about what you have learned in
this lesson and then discuss the answers as a group.
18
Lesson Review
1. After opening a file, which output does the
Open/Create/Replace File I/O function
return?
a. File path
b. File name
c. Refnum out
d. Task out
19
Lesson Review
1. After opening a file, which output does the
Open/Create/Replace File I/O function
return?
a. File path
b. File name
c. Refnum out
d. Task out
20
Lesson Review
2. Which file format is best in an application
that requires high-speed streaming?
a. ASCII
b. Binary
c. TDMS
d. LVM
21
Lesson Review
2. Which file format is best in an application
that requires high-speed streaming?
a. ASCII
b. Binary
c. TDMS
d. LVM
22