7. Wykresy, stringi, pliki.pdf
(
1047 KB
)
Pobierz
Microsoft Word - PW 7. Wykresy, stringi, pliki.doc
prof. dr hab. Krzysztof Jemielniak
PRZYRZĄDY
WIRTUALNE
Część 7
Wykresy, stringi,
pliki
http://www.cim.pw.edu.pl/labview
k.jemielniak@wip.pw.edu.pl
http://www.cim.pw.edu.pl/kjemiel
ST 149, tel. 660 8656
Politechnika Warszawska, Wydział Inżynierii Produkcji, Instytut Technologii Maszyn
Warszawa 2003
PRZYRZĄDY
WIRTUALNE
Wykresy
(
Graphs
)
• Znajdują się na palecie
Controls>>All Controls>>Graphs
Przebiegi czasowe (
Waveform Chart
)–były
już omawiane
Wykresy zmiennych (
Waveform Graph
) w
funkcji ich indeksów (numeru próbki)
Wykresy XY (
XY Graph i Express XY Graph
) –
wykresy funkcji
Wykresy cyfrowe (
DigitalWaveformGraph
)
Politechnika Warszawska, Wydział Inżynierii Produkcji, Instytut Technologii Maszyn
VIs with graphs usually collect the data in an array and then plot the data to the graph.
The graphs located on the
Controls» All Controls» Graph
palette include the waveform graph and XY
graph. The waveform graph plots only single-valued functions, as in
y
= f(
x
), with points evenly distributed
along the x-axis, such as acquired time-varying waveforms. Express XY graphs display any set of points,
evenly sampled or not. Resize the plot legend to display multiple plots. Use multiple plots to save space on
the front panel and to make comparisons between plots. XY and waveform graphs automatically adapt to
multiple plots.
Single-Plot Waveform Graphs
The waveform graph accepts a single array of values and interprets the data as points on the graph and
increments the
x
index by one starting at
x
= 0. The graph also accepts a cluster of an initial
x
value, a .
x
, and
an array of
y
data. Refer to the Waveform Graph VI in the examples\general\graphs\gengraph.llb for
examples of the data types that single-plot waveform graphs accept.
Multiple-Plot Waveform Graphs
A multiplot waveform graph accepts a 2D array of values, where each row of the array is a single plot. The
graph interprets the data as points on the graph and increments the
x
index by one, starting at
x
= 0. Wire a
2D array data type to the graph, right-click the graph, and select
Transpose Array
from the shortcut menu to
handle each column of the array as a plot. Refer to the (Y) Multi Plot 1 graph in the Waveform Graph VI in
the examples\general\graphs\gengraph.llb for an example of a graph that accepts this data type.
A multiplot waveform graph also accepts a cluster of an
x
value, a x
value, and a 2D array of
y
data. The
graph interprets the
y
data as points on the graph and increments the
x
index by x, starting at
x
= 0. Refer to
the (Xo, x, Y) Multi Plot 3 graph in the Waveform Graph VI in the examples\general\graphs\gengraph.llb
for an example of a graph that accepts this data type.
A multiplot waveform graph accepts a cluster of an initial
x
value, a .
x
value, and an array that contains
clusters. Each cluster contains a point array that contains the
y
data. You use the Bundle function to bundle
the arrays into clusters, and you use the Build Array function to build the resulting clusters into an array. You
also can use the Build Cluster Array, which creates arrays of clusters that contain inputs you specify. Refer
to the (Xo, x, Y) Multi Plot 2 graph in the Waveform Graph VI in the
examples\general\graphs\gengraph.llb for an example of a graph that accepts this data type.
Single-Plot XY Graphs
The single-plot XY graph accepts a cluster that contains an
x
array and a
y
array. The XY graph also accepts
an array of points, where a point is a cluster that contains an
x
value and a
y
value. Refer to the XY Graph VI
in the examples\general\graph\gengraph.llb for an example of single-plot XY graph data types.
Multiplot XY Graphs
The multiplot XY graph accepts an array of plots, where a plot is a cluster that contains an
x
array and a
y
array. The multiplot XY graph also accepts an array of clusters of plots, where a plot is an array of points. A
point is a cluster that contains an
x
value and a
y
value. Refer to the XY Graph VI in the
examples\general\graph\gengraph.llb for an example of multiplot XY graph data types.
Wykresy jednej zmiennej
Na osi X indeksy 0..max (co 1), wartości Y są
ciągiem liczb bez związku z czasem
macierz 1D
Na osi X określona skala czasu (punkt
początkowy i przyrost), Y jest funkcją
czasu
Politechnika Warszawska, Wydział Inżynierii Produkcji, Instytut Technologii Maszyn
Wykresy wielu zmiennych
Każdy wiersz macierzy jest oddzielnym
zbiorem danych (X
0
=0,
∆
X=1) nie
związanych z czasem
Każdy wiersz macierzy jest oddzielną
funkcją czasu
Politechnika Warszawska, Wydział Inżynierii Produkcji, Instytut Technologii Maszyn
If a 1D array is wired to a waveform graph, the graph assumes it is one plot. When a 2D array is wired to a
waveform graph, the graph assumes
each row
in that array is a
separate
plot.
Use the
Build Array
function to create a 2D array input for multiplot graphs:
Example 1: A combination of two single-plot examples with Xo and Delta X defined (Ex 1 from previous
slide). The
Build Array
function creates a cluster array input to the waveform graph. The terminal is an
array of clusters, because each graph is a cluster.
Example 2: A combination of two single-plot examples without Xo and Delta X defined (Example 2 from
the previous slide). The
Build Array
function creates a 2D array input to the waveform graph. The terminal
is a 2D array of double-precision numbers.
Wykresy
(
Graphs
)
Kliknięcie prawym klawiszem na wykresie
umożliwia określenie wielu jego właściwości
Politechnika Warszawska, Wydział Inżynierii Produkcji, Instytut Technologii Maszyn
Wykresy XY
(
XYGraphs
)
•
Oś X nie jest jednostajna
•
Wartości na obu osiach sa
zawarte w oddzielnych
wektorach (macierzach 1D)
•
Są bardziej elastyczne niż
Waveform graph
Porównaj z budowaniem wykresu
dwóch zmiennych – tam było
budowanie macierzy, tu jest wiązanie
w klaster
Politechnika Warszawska, Wydział Inżynierii Produkcji, Instytut Technologii Maszyn
Generate two arrays, one for X values and other for Y values. Bundle arrays wire into the XY graph.
X array 1,2,3,4,5 and a Y array 0,1,0,1,0 will result in a graph with points ((1,0)(2,1)(3,0)(4,1)(5,0)).
Plik z chomika:
Przechowalnia5
Inne pliki z tego folderu:
1. Podstawy, panel czolowy.pdf
(1133 KB)
2. Diagram, funkcje palety narzedzi.pdf
(831 KB)
3. Tworzenie VI, subVI, debugging.pdf
(689 KB)
4. DAQ, petla while.pdf
(1055 KB)
5. Petla for, przebiegi czasowe, struktury, wzory.pdf
(913 KB)
Inne foldery tego chomika:
Automation Studio
automatyka
beckhoff
CAD electronics automation GAP
CAD electronics automation GAP(1)
Zgłoś jeśli
naruszono regulamin