VI High 64 - Multiplot Displays on LabVIEW Waveform Charts and Waveform Graphs
We're in episode 2 of a 4-part series on Waveform Charts, Waveform Graphs, and XY Graphs in LabVIEW. Today we look at making multiplot displays with Waveform Charts and Graphs.
And keep up with us here: http://facebook.com/sixclear http://twitter.com/#!/sixclear http://gplus.to/Sixclear
(start transcription)
Hey! I am glad that you came back. Last episode, we saw that waveform charts accumulate data points and waveform graphs do not. Now, let’s focus on some permutations on using waveform charts and graphs, like displaying multiple plots and changing our timing.
A common thing we’ll be able to do is to display multiple plots. Maybe they are coming from different sensors, maybe a temperature and a pressure sensor, so how do I get both of those on the same chart? Well our context help is valuable in this case. I will hit control H, hover over my waveform chart and I have a little table here telling me what data to wire in, and then what the result is on the chart. As we have already seen, if I wire a scalar in I get a single plot, if I wire in a 1D array as we have done here then I also get a single plot. A WDT, or Waveform Data Type, would give me a single plot, and if I wire in a 2D array I will also get a multiplot display, or combine points with a bundle node. Let’s try that.
I will bring this waveform chart back inside the loop. Control B, wire this in here and I am going to change the timing. Make the time per iteration faster and the number of samples ten times greater. Let’s put another plot on the chart. I’ll move this out of the way for now, and to mock up some meaningful data I will grab a sine function. Using quick drop, control space bar, type in sine and then I will go grab from my numeric palette>>math constants: 2 pi. Multilpy 2 pi by the iteration number, divide it by the number of samples. To get this onto this chart we saw that we can put a bundle function right here. So I will use quick drop again, click and select the wire, control spacebar, bundle, control I, and we insert it right there. Drag this down to get multiple inputs to the bundle function. Wire this in and let’s run it. Now we’re only displaying ten points but I will come back here, back to zero, and there we go, we get a full hundred cycles of our sine wave, and on the same display we have that random number function, remembering that the random number function outputs between zero and one, whereas the sine obviously is one to negative one.
Now how do we do this to the waveform graph? Same as before, pop up our context help, hover over the waveform graph, and we get a corresponding table. If we wire in a 1D array, we get a single plot as we have already seen, a waveform data type another single plot, a 2D array gives us a multiplot. So let’s try that 2D array. Now how will I get a 2D array on both of these pieces of data? Well I already have one array and same method to go wire this to the border, get another array and to make a 2D array now out of these two 1D arrays, we use a build array. Build array function, put it down, make two inputs, delete this wire and combine these. Run it again, there we go, exactly the same display. Incidentally, you probably noticed on the waveform chart (because I read it out loud) that a 2D array would also create a multiplot for the waveform chart. Can we just use the same 2D array coming out of here? Well yes and no, because if I take it, grab it, and wire this 2D array in the waveform chart, run it again then I get a weird display. I put this at one, I can see that, well it is just really weird. What do you think has happened there? Really it is just swapping columns for rows. So I can fix this by transposing the 2D array going to the waveform chart. Quick drop again is my friend, click on the wire, control space bar, transpose 2D array, control I. There is my transpose function. Put this back to 99, run it, there we go. Actually, let’s make that one hundred because we have a hundred points.
One little last step here, now that we have two different plots let’s name them. I will come over here, drag my plot display here. I have different colors, I can change them of course if I like, including the style, the width, etc. I will keep plot zero the default except I will name it ‘Random Signal’, make plot one ‘Sine Wave’ and I can change this line width, something like that. A bunch of other options here for me as well.
So far, we have been essentially doing the same thing to waveform charts and graphs and explained how they are different, but have not really discussed when one is better to use than the other, and really that just comes down to the amount of data that you are receiving. If you are receiving a bunch of single scalar points, for instance: I have a software-timed loop reading two thermocouples and a pressure transducer, and each time I poll that loop I get a single value for each, well I would use a waveform chart, that’s easy. But if I am reading from an oscilloscope and each time I pull that oscilloscope I get a thousand points of data back, I probably want to use a waveform graph because I probably would not care to see the history of those thousand data points. I just want to see the current thousand pieces of data coming from that oscilloscope, especially if I am not using the graph to do any type of analysis, and it is just a qualitative display.
Well that finishes us up this time around. We still have more to talk about, like timing with waveform charts and graphs, and we’ll get to those XY graphs. Don’t worry!
(end transcription)




















