LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Graph an Array, but not every row of it?

Solved!
Go to solution

I'm trying to graph an array of data so that several waveforms show up on my waveform graph. The array has 500 rows but I don't want to plot every one, only the first row, 20th, 40th, 60th, ..., 500th row. I was thinking of using a for loop to extract the rows I need using the "array subset" VI, but I am not sure how to configure the inputs. Also, if there is a better way, can anyone let me know? Thanks!

0 Kudos
Message 1 of 13
(4,294 Views)

I don't have LabVIEW in front of me, but look at the context help (ctrl+h) for waveforms. It will have something about plotting multiple on one graph. I'm guessing you will want to use index array. You can expand the VI and physically wire (20, 40, 60 etc) or you can use a for loop and have your counter be 20 * i. Wire that 20*i up to the index input for index array. Wire your array up to the array input for index array. Then use autoindexing on the other side of your for loop which will build an array of rows 20,40,60 etc. This is the array you will wire to your waveform. Sorry if this was a bit confusing, I'm sure someone can code an example up for you real quick. 

Message 2 of 13
(4,291 Views)
Solution
Accepted by topic author gjacob

Got some LabVIEW access. Something like this? For scalability you will probably want to replace the 500 constant with a get array size function. That way if your array size changes, you will insure you will still get all the data without modifying code

 

 

 

 

Message 3 of 13
(4,273 Views)

If you have the Professional version of LV I would take advantage of the Decimate VI.

 

19435i98622764BEAABD68

Message 4 of 13
(4,269 Views)

You can try many ways. Try with this simple way. Only change the input.

 

19437i761514DF817F3FCF

 

 

Regards

0 Kudos
Message 5 of 13
(4,264 Views)

 


@Darin.K wrote:

If you have the Professional version of LV I would take advantage of the Decimate VI.

 

19435i98622764BEAABD68


Nice.  I tried to use the Decimate 1D Array vi, then realized it was for 1D arrays and that clever transposing trick never occured to me.  I didn''t know the Decimate vi you used existed until just now.

 

--
Tim Elsey
Certified LabVIEW Architect
0 Kudos
Message 6 of 13
(4,245 Views)

Well, I have been trying all of these different ways suggested but none of them really gave the display I was expecting. I am not sure if the problem is with the data or with the program, so I will keep looking at it.

0 Kudos
Message 7 of 13
(4,229 Views)

is your issue with the delta t of the waveform? That can cause your data to be "smushed" or too spread out.

0 Kudos
Message 8 of 13
(4,225 Views)

I don't think the data was smushed or spread out, it was just way too dense to be the number of plots that I had desired to do. I think the problem may have been transposing the array one too many times. Unfortunately it takes about 5 mins to generate the data again so after one small change it takes a while to test it.

0 Kudos
Message 9 of 13
(4,211 Views)

It looks like it is working well now 🙂 Thanks for the help!

0 Kudos
Message 10 of 13
(4,203 Views)