virtual instrumentation

26
PRESENTATION ON INPUT/OUTPUT FILE IN labVIEW

Upload: mustapha-umar

Post on 26-Jun-2015

484 views

Category:

Engineering


0 download

DESCRIPTION

presentation

TRANSCRIPT

Page 1: Virtual instrumentation

PRESENTATION ON INPUT/OUTPUT FILE IN labVIEW

Page 2: Virtual instrumentation

OUTLINE Introduction Uses of File I/0 VIs and functions Division of File I/0 Vis Palettes Types of File I/O VIs File I/0 Formats How to Incorporate File I/O into a VI Conclusion

Page 3: Virtual instrumentation

IntroductionDefination: File I/O operations pass data to and from files. This operations can be located on  Functions>>All Functions>>File I/O palette.

Page 4: Virtual instrumentation

Uses of file I/O VIs and functions.

Page 5: Virtual instrumentation

File I/O VIs are used to handle all aspects of file I/O, which includes the following:

Opening and closing files Reading from or writing to files including

spreadsheets Managing files (moving, renaming, or changing file

characteristics) Managing configuration files (creating, modifying,

and reading) Changing file characteristics

Page 6: Virtual instrumentation

Write data to a text file: you can use the following functions to write data to a file (Functions>>Programming>>File I/O):

•Open/Create/Replace File •Write to Text File •Close File (release the memory)

The following codes write a “Hello” string to a file

Page 7: Virtual instrumentation

Division of the File I/O palette

Page 8: Virtual instrumentation

The File I/O palette is divided into four types of operations: 1) High-level2) Low-level 3) Advanced and 4) Express

1) High - Level File I/O VIs: The high-level File I/O Vis are located on the top row of the Functions>>All Functions>>File I/O palette and are used to perform common I/O operations.

Page 9: Virtual instrumentation
Page 10: Virtual instrumentation

The high-level VIs perform read or write operations

in addition to opening and closing the file.

If an error occurs, the high-level VIs display a dialog

box that describes the error.

You can choose to halt execution or to continue.

However, because high-level VIs encapsulate the

entire file operation into one VI, they are difficult to

customize to any use other than the one intended

Page 11: Virtual instrumentation

2) Low-Level and Advanced File I/O VIs and Functions:

The low-level File I/O VIs and functions are located on the

middle row of the Functions>>All Functions>>File

I/O palette and the Advanced File I/O functions are located

on the Functions>>All Functions>>File I/O>>Advanced

File Functions palette to control each file I/O operation

individually.

Page 12: Virtual instrumentation
Page 13: Virtual instrumentation

Use the principal low-level functions to create or open a file,

write data to or read data from the file, and close the file.

The low-level VIs and functions can handle most file I/O needs..

Use low-level VIs for more specific tasks.

Page 14: Virtual instrumentation

3) File I/O Express VIs: The Express VIs on the File I/O palette include

the Read LabVIEW Measurement File Express VI and the Write LabVIEW Measurement File Express VI.

Page 15: Virtual instrumentation

The LabVIEW measurement data file (.lvm) is a tab-delimited text file you can open with a spreadsheet application or a text-editing application. In addition to the data an Express VI  generates, the .lvm file includes information about the data, such as the date and time the data was generated.

Page 16: Virtual instrumentation

TYPES OF FILE I/O VIs

Page 17: Virtual instrumentation

There are two types of file I/O Vis that exist which include High Levels and Low Levels.

1) High Level: Performs common I/O operations all in one VI (i.e. opens, reads, and closes file).

These VIs can be accessed in the Functions Palette: • Functions Palette → File I/O

These VIs can perform operations from the following data types:

a. Characters to and from text files b. Lines from text files c. Arrays of single-precision numerics to and from

spreadsheet text files

Page 18: Virtual instrumentation

d. Arrays of single-precision numerics or signed 16-bit integers to and from binary files High-level VIs always need a file path input and if one is not assigned, an error message will appear prompting for the file path.

2) Low Levels: Performs only one I/O operation (i.e. reads file)

Page 19: Virtual instrumentation

FILE I/O FORMATS

Page 20: Virtual instrumentation

File I/O formats depend on the type of files being used .There are three (3) types of formats exist:

text binary and data log. Some basic guidelines for choosing a data type are: i. Text files are the most common and should be used

if the data will be used in programs such as Word and Excel.

ii. ii. Binary files are more efficient than text files with respect to disk space and speed and should be used if memory and speed is crucial.

Page 21: Virtual instrumentation

iii. Datalog files are the best way to store data if the data will only be accessed in LabVIEW and if the data structure is complex.

Page 22: Virtual instrumentation

How to incorporate file I/O’s into a VI.

Page 23: Virtual instrumentation

Access File I/O operations by: Functions Palette → All-Functions → File I/O In addition to the File I/O operations, the user will

need to identify the File Path so that the VI knows where the file can be accessed. Insert a File Path Control or Indicator by:

Controls Palette → All-Controls → String & Path → File Path Control or File Path Indicator

Page 24: Virtual instrumentation
Page 25: Virtual instrumentation

CONCLUSION:

The presentation describes the uses of file I/O Vis, division of file I/O palette, types as well as file I/O formats and lastly how to incorporate file I/O`s into a VI.

Page 26: Virtual instrumentation

THANKS FOR LISTENING

END OF

PRESENTATION