Waveforms: JCB 30304 Data Acquisition System
Waveforms: JCB 30304 Data Acquisition System
CHAPTER 6
WAVEFORMS
CHAPTER 6 WAVEFORMS
Waveform Dynamic
types data
Signal
Generation /
Processing
4Fourier
analysis
“The great aim of education is not knowledge but action” ~Herbert Spencer
INTRODUCTION
6
Wiring to Charts
Single-Plot Chart
Multiple-Plot Chart
7
Modifying Chart Properties
• Change the
appearance
• Set the format and
precision of the axis
• Choose the plot type
• Edit the scales
• Document the chart
8
Customizing Charts and Graphs
Right-click and select Visible Items to view the following
items:
• Plot Legend Graph Palette
• Digital Display
• Scrollbar Zoom
Subpalette
• X and Y Scale
• Graph Palette
• Scale Legend Scale Legend
9
Graphs
• Selected from the Graph subpalette
• Waveform Graph – Plot an array of numbers against their indices
• XY Graph – Plot one array against another
Plot Legend
(point and line
styles)
Graph Palette
Scale Legend
10
Single-Plot Waveform Graphs
Uniform X axis
Initial X = 0.0
Delta X = 1.0
Uniform X axis
you specify point
spacing
11
Multiple-Plot Waveform Graphs
Each row is a
separate plot:
Initial X = 0
Delta X = 1
Each row is a
separate plot:
Bundle specifies
point spacing of
the X axis
12
XY Graphs
• Non-uniform X axis
• Separate X and Y arrays
define data points
13
Chart and Graph Use Summary
Use the Context Help window with charts and graphs
14
Summary
• The waveform chart is a special numeric indicator that displays one
or more plots. The waveform chart has the following three update
modes:
–A strip chart shows running data continuously scrolling from left to
right across the chart.
–A scope chart shows one item of data, such as a pulse or wave,
scrolling partway across the chart from left to the right.
–A sweep works similarly to a scope except it shows the old data on
the right and the new data on the left separated by a vertical line.
• Waveform graphs and XY graphs display data from arrays.
• Right-click a waveform chart or graph or its components to set
attributes of the chart and its plots.
15
Exercise
Read the Qur’an It will show u how simple life can be.
Signal Generation
“Never give up on a dream just because of the time it will take to accomplish it. The time will pass anyway.” — Earl Nightingale
Strings and File I/O
25
Strings
• A string is a sequence of displayable or - characters (ASCII)
• Many uses — displaying messages, instrument control, file I/O
• String control/indicator is in the Controls»String subpalette
26
String Display Modes
Normal display \ code display
Hex display
Password display
27
String Functions
String Length
Concatenate Strings
(spaces here)
28
String Functions
String Subset
Match Pattern
29
Converting Numerics to Strings: Build String
30
Converting Strings to Numerics:
Scan From String
31
Edit Format String
Scan From String Function
32
File Input and Output
33
High-level File I/O VIs
• Write to Spreadsheet File
• Read from Spreadsheet File
• Write Characters to File
• Read Characters from File
• Read Lines from File
34
File I/O Programming Model -
Intermediate
Open/ Read
Close Check for
Create/ and/or
File Errors
Replace File Write to File
35
Write to File Example
36
Reading Data from a File
• Open/Create/Replace opens the file
• Read File reads the specified number of bytes from the file
• Close File closes the file
• Simple Error Handler checks for errors
37
Formatting a Spreadsheet String
• Spreadsheets are popular tools for data handling and analysis
• There are many formats for spreadsheet data. One of the most
popular is tab-delimited:
– Columns are separated by a tab character
– Rows are separated by an end-of-line
character
A spreadsheet yields:
38
Creating a Spreadsheet File
39
Write LabVIEW Measurement File
40
Summary
• Strings group sequences of ASCII characters. Use the string control
and indicator located on the Controls»String & Path palette to
simulate text entry boxes and labels.
• Use the String functions located on the Functions»String palette to
edit and manipulate strings on the block diagram.
• Use the Format Into String function and the Build String Express VI to
convert a numeric to a string.
• Use the Scan From String function to convert a string to a numeric.
• Right-click the Format Into String or Scan From String function and
select Edit Format String or Edit Scan String from the shortcut menu
to create or edit a format string.
41
Summary, cont.
• Use the File I/O VIs and functions located on the Functions»File I/O
palette to handle all aspects of file I/O.
• When writing to a file, you open, create, or replace a file, write the
data, and close the file. Similarly, when you read from a file, you open
an existing file, read the data, and close the file.
• To access a file through a dialog box, do not wire file path in the
Open/Create/Replace File VI.
• To write data to a spreadsheet file, you must format the string as a
spreadsheet string, which is a string that includes delimiters, such as
tabs. Use the Format Into File function to format string, numeric, path,
and Boolean data as text and write the text to a file
42
What’s Your
THANK YOU Message?