07-07-2017 10:56 AM
What I'm trying to do is control the number of digital display for a waveform graph. I have a control that changes the number of plots for the graph, but when I add an element a new digital display for it doesn't appear. If I lower the number of inputs the digital displays disappear, but they never add any extras.
So for example in the picture below I started with 3 inputs. I then changed it to 5 and the legend updated automatically like it should, but there are still only 3 digital displays instead of 5. I currently have a property node that has a true constant linked to Digital Display(s) Visible. I've tried changing the number of inputs before I start running and while I'm running, but neither works. I'm currently using LabVIEW 2013. Thanks for any help or ideas, I really appreciate it.
Solved! Go to Solution.
07-07-2017 11:03 AM - edited 07-07-2017 11:05 AM
You don't have a graph, you have a chart (big difference!). Changing the size of the legend does not define the number of plots. Wire e.g. a cluster with 5 elements to the chart terminal and your digital display will probably appear.
Charts accept a variety of datatypes. What datatype are you currently wiring to the terminal?
(It always helps of you would attach a simplified version of your VI so we have more specific information)
Of course you can always use a plain array indicator for the digital display and change the number of visible elements programmatically.
07-07-2017 12:25 PM
I'm using an indicator to control both the size of the legend as well as an index to show the correct amount of plots. I'm using a DAQ assistant to output every channel available, and index out the ones I don't need. Using a cluster might work, but I need to be able to dynamically change the number of inputs between runs.
The dynamic data from the DAQ assistant is converted to a 1D array of waveform, which is stored in an array with a shift register. That array is then wired to the chart to plot. I'm attaching the portion of the VI that graphs, the top part of the while loop is the part that controls the temperature graph. Once I get that working I can fix the bottom part the same way.
07-07-2017 01:39 PM - edited 07-07-2017 01:39 PM
You are constantly resizing array with a bewildering amount of code and datatype (array, waveforms, dynamic) and the compiler cannot determine the number of plots at compile time. If you want to go that route, create your own legend and digital display (e.g. as a 1D array of clusters).
There are plenty of things wrong with this code:
(These are just general comments. I have not analyzed the sanity of all these crazy array operations.)
07-08-2017 09:22 AM
07-08-2017 10:45 AM
Thanks to both of you for the assistance. I'm pretty new to LabVIEW and I realize my code is very messy, most of this was experimenting until I found something that worked. The vi I posted was only a portion of what I'm using, the local variables and outer case structure have nothing to do with the chart but make a lot more sense in the other loops I didn't include. I'll make sure to implement the rest of your suggestions, thanks again for the advice.