0% found this document useful (0 votes)
15 views20 pages

Data Acquition and Storage

Daq is used in every automation systems
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
15 views20 pages

Data Acquition and Storage

Daq is used in every automation systems
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 20

Data Acquisition & Storage

Program 1. Acquire temperature 1 Channel 10 Sample data and save in the text file.
Program 2. Acquire temperature 4 Channel N Sample data and save in the text file.
Program 3. Acquire temperature 1 Channel 1 Sample for 5 Second data and save in the text
file.
Program 4. Acquire temperature 1 Channel N Sample for 5 Second data and save in the text
file. With the following information.
Write a name.

Time and date.

Location.

Sampling rate.

Number of samples.

Measurement type.

Open/Create/Replace File Function


Opens an existing file, creates a new file, or replaces an existing file, programmatically or
interactively using a file dialog box. This function does not work for files inside an LLB.

0 open (default)—Opens an existing file. Error 7 occurs if the file cannot be found.
1 replace—Replaces an existing file by opening the file and setting its end of file to 0.
2 create—Creates a new file. Error 10 occurs if the file already exists.
3 open or create—Opens an existing file or creates a new file if one does not exist.
replace or create—Creates a new file or replaces a file if it exists. This VI replaces a file by
4
opening the file and setting its end of file to 0.
replace or create with confirmation—Creates a new file or replaces a file if it exists and
5 you give permission. This VI replaces a file by opening the file and setting its end of file to
0.

Write to binary file:

Writes binary data to a new file, appends data to an existing file, or replaces the contents of a
file. This function does not work for files inside an LLB.

Read from Binary File:

Reads binary data from a file and returns it in data. How the data is read depends on the format
of the specified file. This function does not work for files inside an LLB.

Close file:

Closes an open file specified by refnum and returns the path to the file associated with the
refnum.

Types of files:
Write delimited file:

Converts a 2D or 1D array of strings, signed integers, or double-precision numbers to a text


string and writes the string to a new byte stream file or appends the string to an existing file.
Wire data to the 2D data input or 1D data input to determine the polymorphic instance to use or
manually select the instance.

Program 5. Write a program for Delimited Spreadsheet VI.


Delimiter function:

Without delimiter blank space output is:


Program 6. Write a program for Delimited Spreadsheet VI.

Program 7. Write a program for read from spread sheet VI for string data.
The Write to Measurement File Express VI can write data to
a text-based measurement file (.lvm).
a binary measurement file with headers (.tdm),
a binary measurement file without headers (.tdms), or
to a Microsoft Excel file (.xlsx).

This text-based measurement file (.lvm) is a tab-delimited text file that you can
open using a spreadsheet or text-editing application.
The default delimiter is the tab character but can be configured to use a comma
to delimit fields in the text file.
(A delimiter is a character that marks the beginning or end of a unit of data. A
delimited field is a variable-length field where the field length is set based on the
field's contents. Commonly used delimiters in export files include the comma (,),
semicolon (;), and colon (:))
The .lvm file also includes header information about the data, such as the date
and time the data was generated. LabVIEW saves data with up to six digits of
precision in a text-based .lvm file, but higher precision can be achieved when
using a .tdm or .tdms binary measurement file.
Use the File Format option in the configuration dialog box of the Express VI to
specify your file type. The options are:
1.Text (LVM)- Sets the file format to a text-based measurement file (lym) and the
file extension in File Name to Ivm.
2.Binary (TDMS). Sets the file format to a binary measurement file (.tdms)
without an XML header and the file extension in File Name to .tdms
3.Binary with XML Header (TDM) - Sets the file format to a binary
measurement file (.tdm) and the file extension in File Name to .tdm
4.Microsoft Excel (XLSX) - Sets the file format to the Microsoft Excel file type
(.xlsx) which is an open XML file format. The file extension in File Name is set
to .xlsx
Use the Action option in the configuration dialog box of the Express VI to
configure file saving options.
Options include:
• Saving data to one file or a series of files (parsing your data and saving in
multiple files). Prompt the user for a filename once or each time the Express VI
executes
If a file already exists, you can select among the following options:
1.Rename the existing file.
2.Append a sequential number to the filename.
3.Overwrite the file.
4.Append the data to the existing file.
If you select the append option, you cannot write new data in a different format,
such as if the new data has a different header style or column style.
The Express VI writes the new data to the existing file in the original format.

1.The DAQ Assistant is a graphical interface for configuring measurement tasks,


channels, and scales. Using the DAQ Assistant, you can interactively build a
measurement channel or task for use in LabVIEW, Signal Express,
LabWindows/CVI, and Measurement Studio.
2. Launches the Instrument I/O Assistant, which you can use to communicate
with message-based instruments and graphically parse the response. The
Instrument I/O Assistant organizes instrument communication into ordered steps.
You can use the Instrument I/O Assistant to send a query to an instrument to verify
communication with that instrument. For example, you can communicate with an
instrument that uses a serial, Ethernet, or GPIB interface.
8.Write a program for store data using Write to measurement file express.
Program 9.Write a program for store data using write Numeric data in text file as
string.
Program 10.Write a program for store data sing non-disk streaming with low-
levels functions.

Program 11. Write a program for store data sing non-disk streaming with low-
levels functions.
Labview Data Directory:
1.You can use the default labview data directory to store the data files labview
generates, such as .lvm or .txt files.
2. Labview installs the labview data directory in the default file directory for
your operating system to help you organize and locate the data files labview
generates. 3.By default, the write labview measurement file express vi stores the
.lvm files it generates in this directory, and the read labview measurement file
express vi reads from this directory.
4.The default data directory constant and the application:default:data directory
property also return the labview data directory by default.

Select tools options and select paths from the category list to specify a different
default data directory. The default data directory differs from the default directory,
which is the directory you specify for new vis, custom controls, vi templates, or
other labview documents you create.
Create File and Folder Paths
Regardless of your desired file format, you often need to select a method for
creating filenames and destination directories.
To this point, you have used the File Dialog Express VI to specify a file name and
location.

The File Dialog Express VI allows


File Dialog Express VI user to specify the path to a file or
directory. You can also customize the
file dialog with prompts and options to
limit file types with specific file
extensions, such as txt for text files.

However, it is often desirable to programmatically create folders and file paths.


Hard coded paths are useful for quick prototypes but not recommended for
applications as directory structures might differ from one machine to another.
Typically, you want to specify a directory location that is relative to a known
location, such the project directory or the user's documents directory.
Use the Application Directory VI in conjunction with the
Build Path function to specify a path relative to the project
directory.

If you call this VI from the development environment and


the VI is loaded in a labview project file ( .lvproj ), this VI
returns the path to the folder containing the project file. If you
call this VI from a stand-alone application, this VI returns the
path to the folder containing the stand-alone application.

Use the Get System Directory VI in conjunction with the


Build Path function to specify a path relative to a system
directory such as the User Documents folder or the User
Desktop.

Use the Create Folder function to create a new folder.


However, if the folder already exists at the specified location,
the Create Folder function returns an error instead of
overwriting the folder. To avoid the error condition, check if
the folder exists to conditionally create the folder.

Program 12: Write a program to create a folder.

Go to >documents>see
13.Write a dynamic program to which create folder with as per date and time.
Program 14. Write a program to which create a file with a per date and time.
Program 15. write a program to store data in text file, with some following
information.
 Code write name
 Date and time
 Location
 4 channel & 4 sample data

You might also like