10-16-2019 05:07 PM
I'm trying to plot sampled data from two analog channels on the same plot. I'm reading in the data inside a while loop. Then I feed the data into an auto-indexing tunnel. When I connect the tunnel to a graph outside of the the while loop, I will get an error that the dimension of the data source (the tunnel) and the dimension of the sink (the graph) are mismatched. If I connect the graph inside the while loop, there is no error; however, the graph doesn't accumulate the data. I think it's just plotting the data for the current loop iteration and refreshes with each iteration. I've attached what I have so far. Can someone help with this this?
10-16-2019 05:47 PM
When data goes through an auto indexing tunnel it gains an extra dimension, so your 2D array is turning into a 3D array. You can change the tunnel to concatenate so that each loop's data gets tacked on to the previous loop's data. In the end, you want an array with 2 rows, so you might have to add some "transpose 2D array" functions in there to get the dimensions to look right.
10-16-2019 09:29 PM
Expanding on some of Gregory's excellent points:
Bob Schor
10-17-2019 06:53 AM
I would replace your graph with a chart. A chart has history built into it. Then you can just put the chart inside of the While loop.
10-17-2019 01:34 PM
I found out that my version of LabVIEW, 8.5.1, does not have the concatenate array tunnel when it is right clicked. Instead I built an array of my data using a concatenating build array and shift registers. This fixed the non-matching dimension error. However, now when I plot it outside the while loop with a graph, it displays six plots. I've attached a picture of an array indicator attached to the same shift register as the graph. It has n columns and 6 rows. I don't understand how it is getting 6 rows. I assume I am building the array incorrectly but I don't know how to fix it. I've attached my vi as well
I also tried adding a chart inside the while loop. It did plot correctly, but the data will scroll of screen after I hit the stop button.