10-18-2019 04:50 PM
I'm trying to build an array of two rows. Each row is generated from continuously sampling a physical channel. The rows will then be plotted on a single graph. I can't figure out how to build up the array while maintaining the 2-row n-column shape. This is what I've tried.
I also tried using the Delete from Array vi to try to delete the third row. This seems to only delete data from the elements but does not delete the row itself. I've attached my VI. Does anybody know how to plot two sets of sampled data to a single graph? I'm ok with the data being plotted after the while loop is stopped.
10-18-2019 04:59 PM
You need to learn a little more LabVIEW. I'm assuming you are doing this "on your own", and don't understand the difference between a Graph (where you have either sets of X-Y pairs or sets of Y data assumed to be equally-spaced, and you plot all those points at once) vs. a Chart (where you always have equally-spaced sets of data, and you append these data as though you are plotting data continuously on a Chart Recorder, or on an oscilloscope).
When dealing with DAQmx, where you get chunks of data from multiple channels every time DAQmx Read fires, you almost always use Charts, as the data are continually coming in and you want to see all (or as much as fits) of the data, not just the latest sample.
You can learn more about this by going to the beginning of the Forum and looking at the Tutorial offered there. Look at Graphs and Charts. Or go to LabVIEW Help and look up Graphs and Charts. Or look at the DAQmx Examples (Help, Find Examples) that ship with LabVIEW. Better for you to find it yourself (you'll learn, retain it better, and will enjoy a sense of accomplishment) than for us to simply say "Do this ...".
Bob Schor
10-18-2019 05:48 PM
2 things:
1) If you use a build array node and want to avoid adding a new dimension, there's a right-click option on it named "concatenate inputs". If you activate this it will stay as a 2D array instead of becoming 3D. However, you need to know that if your array dimensions don't match it'll put in a bunch of zeroes to pad it out.
2) You might do better to use one of the DAQmx polymorphic selections that outputs a waveform instead of a 2D array. You can then use the "Append waveforms" VI to attach them to each other.