LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Programmatically change the number of plots drawn

Solved!
Go to solution

Hello!

 

I'm trying to display a measured resistance with a boxplot. For that i modified a boxplot.vi I found in these forums. I want to be able to change "time measured in minutes" and "measurements per minute", which means i got an array of variable size. Each loop-iteration (of the loop fetching the data from my measurement device) adds one row and each row is displayed as one box in the plot.

 

Problem is that i have to manually add every row by indexing it in the array and building it into the array that's wired to the xy graph. As far as i know there is no way of increasing the size of "build array" programmatically and a loop won't work since only the data of the newest iteration will be available.

 

I can use the maximum number of boxplots thats likly to be used and just display as many as needed, but that isnt very efficient or good programming style at all.

 

Is there any other way?

 

 

Here's the .vi I used and a snippet of my program.

 

Greetings, 

Auer

Download All
0 Kudos
Message 1 of 4
(2,619 Views)
Solution
Accepted by topic author Auer

Hi Auer,

 

Is there any other way?

Sure!

Use an autoindexing (FOR) loop to create your plots!

 

(Whenever you need to repeat the same operation several times you should use a loop. No need to copy and paste the same code 10 times like in your image!)

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 2 of 4
(2,614 Views)

Hello GerdW,

 

thanks for your suggestion, but I can't get it to work. I tried a few different things and I either get only one box plotted or the output array of the loop has too many dimensions. 

 

 

Would you mind giving me an example?

 

Thanks,

Auer

0 Kudos
Message 3 of 4
(2,565 Views)

Nevermind, I just got it. I also included the "build array" into my loop, which is why i always had too many dimensions.

 

Now that I see it, it's quite simple 😄

 

Greetings,

Auer

0 Kudos
Message 4 of 4
(2,562 Views)