12-05-2018 06:01 PM
Hello,
My labview program uses twenty checkboxes to allow the user to select a variety of plots from a single waveform graph.
I initialize the twenty plot names using the code shown below. Everything works ok until the program writes something to the graph, after which, the last two plots are removed from the list of plots.
Does anyone have an example of initializing and writing to waveform graph plots?
Thanks,
Stephen
12-05-2018 08:33 PM
...Everything works ok until the program writes something to the graph...
How have you confirmed that you are writing all 20 signals to the graph? If you only write 18, then it will remove the final 2, as they aren't initialized.
As an aside, if you are using an Auto-index tunnel on the for loop, you don't need to (and probably shouldn't) specify the N terminal as it could lead to unexpected and hard-to-trace bugs.
12-05-2018 10:01 PM
Attach an actual VI, not a picture, that we can run to see the behavior you are describing.
12-06-2018 07:31 AM
Hello Nathan-M,
The number of signals written to the graph is determined by which check boxes are selected. For my test, I only selected one checkbox.
The image in the last post shows how I initialized the waveform graph with all the plot names. As you can see, I used the build array function to initialize the waveform graph. I set the first dimension to the number of plots and the second dimension to the size of the x axis. I am not sure why the initialization works. I am missing some basic understanding of the waveform graph. What is the right way to initialize a waveform graph that has multiple plots?
Thanks for the info on the indexing.
Stephen
12-06-2018 07:41 AM
Hello,
That would be difficult since the labview program is rather large. Also, I wrote this program for company I work for and I would feel a little uneasy with posting it.
I think the main thing is my understanding of how the waveform graph works.
Thanks,
Stephen
12-06-2018 07:56 AM
@shall123 wrote:
Hello,
That would be difficult since the LabVIEW program is rather large. Also, I wrote this program for company I work for and I would feel a little uneasy with posting it.
I think the main thing is my understanding of how the waveform graph works.
Thanks,
Stephen
You showed a relatively simple picture of your code without an issue. Just attach the VI of what your picture shows. If there is anything proprietary, then strip that out before posting. Often just simplifying the problem will allow you to discover what is going on.
12-06-2018 08:15 AM
"How have you confirmed that you are writing all 20 signals to the graph? If you only write 18, then it will remove the final 2, as they aren't initialized. "
Does that mean you have to have data in a specific plot before you can set its plot attributes, i.e. visibility, plot names and etc? If so then I need to do the following:
1. Initialize all plots to have zero data.
2. Assign plot names to each plot
3. Assign legends only to the plots have been selected by the checkbox.
4. When the data is ready to be plotted, insert the data into the correct plot and then set the visibility to true.
Does that sound correct?
12-06-2018 08:22 AM
That sounds correct to me. As I recall, LabVIEW doesn't allocate memory space for attributes like plot names and styles to be able to set them until it know it has data to plot for them.