Wrap It Up!You can create exciting visual displays of data using LabVIEW's charts and graphs. Charts append new data to old data, interactively plotting one point (or one set of points) at a time, so you can see a current value in context with previous values. Graphs, on the other hand, display a full block of data after it has been generated. Waveforms, a new data type we learned about, can be used with both charts and graphs. LabVIEW provides several kinds of graphs: waveform graphs, XY graphs, intensity graphs, 3D graphs, and digital waveform graphs. The waveform graph plots only single-valued points that are evenly distributed with respect to the independent variable, such as time-varying waveforms. In other words, a graph plots a Y array against a set timebase. The XY graph is a general-purpose, Cartesian graph that lets you plot multivalued functions such as circular shapes. It plots a Y array against an X array. Intensity plots are excellent for displaying patterned data because they can plot three variables of data against each other on a 2D display. Intensity charts and graphs use color to represent the third variable. They accept a 2D array of numbers, where each number is mapped to a color and the number's indices in the array specify location for the color on the graph or chart. In most other ways, intensity plots function like standard two-variable charts and graphs. 3D graphs (Windows only) are more sophisticated and perspective-oriented 3D graphs that allow you to plot (x, y, z) coordinates in 3D space. A variety of functions is provided in LabVIEW for manipulating and configuring 3D graphs. The digital waveform graph is a special type of graph used for plotting digital time-domain data. It is particularly useful for showing true/false states changing over time. The mixed signal graph can display almost any type of data accepted by other graphs. Just bundle the plots together into a cluster and wire them into the mixed signal graph. A multi-plot cursor is used on a mixed signal graph to show the timing relationships between multiple plots. You can configure the appearance of charts and graphs using the plot legend, the scale legend, and the graph palette. You can also change the scales to suit your data and bring up cursors to mark your plots. Both charts and graphs can draw multiple plots at a time. Data types can get tricky, so you may want to refer to the examples in this chapter or those that ship in the examples directory as templates while writing your own graphing VIs. Mechanical action of Boolean switches allows you to control how they behave when you click on them. You can set a switch to return to its default value after its new value has been read oncethat way, it's all ready to be used again. This type of action is called latch action. You can also specify if you want the mouse click to register when you press the mouse button or release it. The time stamp is a data type in LabVIEW that stores an absolute date/time value with very high precision (19 digits of precision each in both the whole second and fractions of a second). Use the subtract function to calculate relative time (as a DBL) from time stamps, or the add function to add relative time (as a DBL) to a time stamp. A waveform is a special LabVIEW data type that stores information about the initial time stamp and time interval between data in a series of data points. There is an entire Waveforms palette on the Functions palette that provides you with all sorts of functions to perform on waveforms. You can wire waveform data directly to a chart or graph to plot it. The dynamic data type is a very "smart" type of data that contains one or more waveforms. You can use dynamic data types with Express VIs. Dynamic data is simply one or more channels of waveform data, wrapped in a very smart wire. It makes it very easy for you to perform operations like merging signals into a single wire. |