LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Can I plot data to an array of chart references?

Solved!
Go to solution
I have an application where the customer has requested 12 plots on one screen.  The data for these plots is in an array.  It would save me a lot of time if I could make an array of controls and then wire the data to them using a for structure.  I have tried doing this with an array of references to my charts, but there does not seem to be a way to add data to a chart using a reference.  This seems a little strange since you can do so much using a reference, I would imagine you can use it to append data to the chart.  I feel like I have checked the list of properties and methods pretty thoroughly, but maybe I have misunderstood something.
0 Kudos
Message 1 of 5
(3,537 Views)
Do you mean something like this?  (see attached).  I have created an array of references and pass them through a for loop.
Message 2 of 5
(3,526 Views)

Provided all of the chart are of the same type*, you can use the "Value" property node as you requested. just let the For loop index through the array of references and pass the ref to the property node >>> value.

 

Ben

 

* all elements in an array can differ only in value and not in their properties. When you build an array of references in LV it will up-cast the array type to a common type.

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 3 of 5
(3,525 Views)
Solution
Accepted by j_osh_o
If you are adding new values to the plots (ie. you have an array of 12 elements for the 12 charts), you could do this.  I use the invoke node with strategically chosen Chart labels.  If your labels aren't chosen strategically, just create an array with their respective labels.
Message 4 of 5
(3,520 Views)
Thanks for the suggestions!  I can see know that the property "value" was what I wanted.  I learned that you can use "history" if you want to build your own array and write it to the reference, but this is a bit painful.  I can use the previous posters suggestion to iterate through the charts on the VI, but instead of Chart 1,2,3 etc. I can use an enum so I can give them unique names.
0 Kudos
Message 5 of 5
(3,513 Views)