Lvcore1 coursemanual english

Page 140

Lesson 5

Creating and Leveraging Data Structures

Na tio No na t fo l In r D str ist um rib en uti ts on

Use a plot array instead of a 2D array if the number of elements in each plot is different. For example, when you sample data from several channels using different time amounts from each channel, use this data structure instead of a 2D array because each row of a 2D array must have the same number of elements. The number of elements in the interior arrays of an array of clusters can vary. Refer to the (Y) Multi Plot 2 graph in the Waveform Graph VI in the labview\examples\general\graphs\gengraph.llb for an example of a graph that accepts this data type. The waveform graph accepts a cluster of an initial x value, a delta x value, and an array that contains clusters. Each cluster contains a 1D 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. Refer to Clusters for more information about clusters and the Bundle function. You also can use the Build Cluster Array function, which creates arrays of clusters that contain the inputs you specify. Refer to the (Xo = 10, dX = 2, Y) Multi Plot 3 graph in the Waveform Graph VI in the labview\examples\general\graphs\gengraph.llb for an example of a graph that accepts this data type. The waveform graph accepts an array of clusters of an x value, a delta x value, and an array of y data. This is the most general of the multiple-plot waveform graph data types because you can indicate a unique starting point and increment for the x-scale of each plot. Refer to the (Xo = 10, dX = 2, Y) Multi Plot 1 graph in the Waveform Graph VI in the labview\examples\general\ graphs\gengraph.llb for an example of a graph that accepts this data type. The waveform graph also accepts the dynamic data type, which is for use with Express VIs. In addition to the data associated with a signal, the dynamic data type includes attributes that provide information about the signal, such as the name of the signal or the date and time the data was acquired. Attributes specify how the signal appears on the waveform graph. When the dynamic data type includes multiple channels, the graph displays a plot for each channel and automatically formats the plot legend and x-scale time stamp.

Single Plot XY Graphs

The XY graph accepts three data types for single-plot XY graphs. The XY graph accepts a cluster that contains an x array and a y array. Refer to the (X and Y arrays) Single Plot graph in the XY Graph VI in the labview\examples\general\graphs\gengraph.llb for an example of a graph that accepts this data type. 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 (Array of Pts) Single Plot graph in the XY Graph VI in the labview\examples\general\graphs\gengraph.llb for an example of a graph that accepts this data type. The XY graph also accepts an array of complex data, in which the real part is plotted on the x-axis and the imaginary part is plotted on the y-axis. Refer to Clusters for more information about clusters.

5-12 | ni.com


Issuu converts static files into: digital portfolios, online yearbooks, online catalogs, digital photo albums and more. Sign up and create your flipbook.