LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Issues with initializing waveform graphs having multiple plots

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

 

PlotInit.png

0 Kudos
Message 1 of 8
(3,501 Views)

 


...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.

Nathan Murphy
NI C Series Modules Product Manager with an expired CLA
0 Kudos
Message 2 of 8
(3,479 Views)

Attach an actual VI, not a picture, that we can run to see the behavior you are describing.

0 Kudos
Message 3 of 8
(3,470 Views)

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

 

 

0 Kudos
Message 4 of 8
(3,454 Views)

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

0 Kudos
Message 5 of 8
(3,449 Views)

@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.

0 Kudos
Message 6 of 8
(3,444 Views)

"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?

0 Kudos
Message 7 of 8
(3,440 Views)

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.

0 Kudos
Message 8 of 8
(3,436 Views)