LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How do you get multiple plots on a graph? LV 6.1

How do you get multiple plots on a graph? LV 6.1
 
I have an array of data wired to my graph, and I have streched the legend down for more plots but I still only get one.
 
What have I missed?
 
 
 
 
0 Kudos
Message 1 of 24
(3,374 Views)

Hi Vr6Fideli…,

create first a cluster of your data and then an array of the clusters. See the attached example. I hope this help.

Mike

0 Kudos
Message 2 of 24
(3,369 Views)
Unfortunately, that won't fit in with the way the user is gathering and displaying the data.

It seems that you are trying to plot a mean value for several signals at each iteration. To accomplish this with a waveform graph you will need to create a 2D array that gets accumulated at each iteration:



Note: I put the Transpose 2D Array function in the code since I don't remember if LabVIEW 6.1 had the "Transpose Array" option when you right-clicked on the graph.

Note2: You can also use a waveform chart. In this case you don't need the shift register, as the chart has a built-in buffer. In that case you only need to feed it a 1D array.


Message Edited by smercurio_fc on 04-23-2008 02:51 PM
0 Kudos
Message 3 of 24
(3,361 Views)
Hi Vr6,

I thiunk you missed to read the context help for the graph!

It clearly says: 1D array will give a single plot, 2D array will result in multiplot... So you need to build just a 2D array...

More notes:
Instead of splitting measurement values into 21 sub arrays by calling "index array" 21 times you can
- resize just one IndexArray to give 21 outputs (no need to give index values as it starts with 0 by default)
- (much better) use a for loop, wire 21 to the count terminal, put the mean operation in the loop, put one IndexArray after the loop to get 21 average values...
(make IndexArray even bigger to get all outputs)

Message Edited by GerdW on 04-23-2008 10:09 PM
Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 4 of 24
(3,352 Views)
Thank you for your response.
 
I have noticed it is a common problem on this board for people to "fix" problems with VI's people submit when they have nothing to do with the actual problem at hand. All that does is confuse the novice user (myself)
 
I know I could use a for loop, but then it becomes impossible for me to grab one of the wires a moments notice and make an indicator for it.
 
I am not comfortable enough with labview to be using for loops.  I just need to be able to put more than one plot on a simple graph.
 
I can't make heads or tails of any of these responses because they look nothing like my vi at all.
 
I am going to go try to make an array of clusters, that is the correct answer right???
0 Kudos
Message 5 of 24
(3,343 Views)
GerdW: Was the automatic resizing and index numbering of Index Array available in 6.1? Can't remember.

Vr6: I think you may be overstating the tendency of what people on this forum do to try to "fix" problems. You need to keep in mind that sometimes people offer alternate solutions which may not be apparent to the user as a possible alternate solution.

That said, I don't undestand your comment "I know I could use a for loop, but then it becomes impossible for me to grab one of the wires a moments notice and make an indicator for it." You can create an indicator on a wire at any time, regardless of the kind of loop you're using.

"I can't make heads or tails of any of these responses because they look nothing like my vi at all."

Speaking just for myself, I don't have 6.1, so I can't post an updated version of your VI in 6.1. What I presented was a smaller version of your VI with just the important bit. The random numbers are just me replacing the Mean function that you're using since I can't run your code (no hardware). You're already creating the array out of each Mean calculation. I was doing exactly the same thing with the building of the array from each random number generator.
All that you needed to do with your VI was to create the shift register as I showed in my example. and build the 2D array the way I was showing in the example. After all, as GerdW mentioned, the context help for the graph should indicate to use a 2D array to get multiple plots.

Do you have to use an array of clusters? No, unless you want timing data, which is what Mike's example shows. It does not appear that you're concerned about timing data based on the way you're collecting and displaying the data, which is why I suggested the simpler 2D array method.
0 Kudos
Message 6 of 24
(3,327 Views)
Here is a screenshot of your VI modified using my method:





Message Edited by smercurio_fc on 04-23-2008 04:03 PM
0 Kudos
Message 7 of 24
(3,320 Views)

Hi Vr6,

sorry for the confusion. Here are the example with the changes from smercurio and your vi. I can´t try your vi but the example works.
Use the "Transpose 2D Array" only before your indicator not for the input to the shift register.

Hope this helps.

Mike



Message Edited by MikeS81 on 04-23-2008 11:12 PM
Download All
0 Kudos
Message 8 of 24
(3,314 Views)

@MikeS81 wrote:

Use the "Transpose 2D Array" only before your indicator not for the input to the shift register.


Oops. Sorry about that. My wiring was faster than my brain, especially since I couldn't run the VI.

Thanks for catching that, Mike.


Message Edited by smercurio_fc on 04-23-2008 04:25 PM
0 Kudos
Message 9 of 24
(3,309 Views)
Hi smercurio,

you wrote: " GerdW: Was the automatic resizing and index numbering of Index Array available in 6.1? Can't remember."

Just tested it: it's available also in LV6.1Smiley Wink

@VR6: attached is a version showing how to use a loop and just 4 array functions to get the same outputs as before...
Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 10 of 24
(3,274 Views)