LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Graphics from arrays

Solved!
Go to solution

Hi,
I have attached a picture of what I have tried. And the case is that starting from an array with values to graph and another array with the names of these values, I would want to graph them all. For later from the front panel to be able to choose which ones I want to visualize and which not. In the attached image is what I have tried and it does not work only know how to graph the 1 value with the first name but not the others.

0 Kudos
Message 1 of 10
(3,334 Views)

What you have posted here does not have enough data for us to help you. You need to post your code and give a better description of what you are trying to accomplish.

Tim
GHSP
0 Kudos
Message 2 of 10
(3,326 Views)

Thanks, I will try to explain it better but passing the entire code is complicated, since it is part of a project with 20 VI's.

0 Kudos
Message 3 of 10
(3,312 Views)

Well, now I attach a VI that is very similar to my problem, where I generate an array for the Plots Name and another array for the values related to each name and update the values in this example from 5 to 5 but that can be scaled to anyone.
When the VI is executed, instead of creating 5 Plots Name each with its value and to the next while loop update. What happens is that it changes the Plot Name and updates the values instead of creating 5 Plots Name with their corresponding values.

0 Kudos
Message 4 of 10
(3,302 Views)

Before you set the plot name, you need to add another element to that property node right above to set the active plot.

 

Here is a fixed version of your VI

Message 5 of 10
(3,293 Views)

I have done what you say, and if it generates the different Plot Name for me, but it only updates the value of the first after the first while loop that creates them. I attach the new version with the same name as the previous one.

 

0 Kudos
Message 6 of 10
(3,270 Views)

No.  I said put Active Plot BEFORE the Plot Name.

 

Look at the modified VI I attached.

 

There are couple things you need to note.

 

1.  I set up the waveform chart to have 5 samples of NaN at the very beginning before creating plot names.  That way it has 5 plots before you start changing the name.  Otherwise, you'll get an error for a plot that doesn't exist yet because it had not received data.

2.  No need to keep changing/overwriting the plot names every iteration.

3.  Don't add +1 to i for active plot.  The first plot is index 0.

4.  You don't need Array Size wired to N.  The auto-indexing tunnel already controls how many times the loop runs, once fore each element in the array.

5.  You create 5 random numbers, but wire them to the chart one at a time.  The chart treats that as a single plot, with 5 data points in a row.  Not 5 plots each with 1 data point.  So I had to do some array manipulation for the chart to understand the datapoints have different plots.

6.  Generating the plot name could be simplified (I didn't pay attention to that until now) with a Format into String  with a format string of "Name of value %d"  That will combine the concatenate strings and format decimal number into string into a single node.

 

Work with the VI I attached earlier.

0 Kudos
Message 7 of 10
(3,265 Views)

I think the VI that you have attached before is not the modified one, because it doesn't change anything from the one that I attached first.

 

Thanks for your help, it is evident that I am new to Labview. 

0 Kudos
Message 8 of 10
(3,258 Views)
Solution
Accepted by topic author FrAn_UPC

I'm sorry.  You're right, I must have attached the one from temp download folder and not the one I back saved.

 

Here is the modified.

Message 9 of 10
(3,228 Views)

Thank you very much, it has been of great help. I'll try to implement it in my main.vi

0 Kudos
Message 10 of 10
(3,218 Views)