LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Flickering grpah, Listbox selection

Solved!
Go to solution

Hello Everyone,

 

I'll be quick with this one; I'm using a Listbox to set active plots on a graph. The flickering starts when selecting 2 or more names. I've tried placing decorations on the graph and timers to slow down the loops, no luck there... The flickering graph is always every other one. I would like to have the flickering to stop somehow.

 

To see a scenario, probe at "14" and select the names "Bob 2-4" ("Bob 3" flickers). 

 

 
 

 

0 Kudos
Message 1 of 6
(1,681 Views)

What happens if you don't go through the process of writing to the property nodes for visibility on every iteration even when the list doesn't change?

 

This should be in an event structure for the change of the list box.  Or at least a case structure where you compare the old values of the list box to the new values.

 

The shift register on your little for loop should be blue, not orange.

And it would have been even simpler if you just took the wire from the i terminal and indexed that out.  No shift register, no increment, no initialization constant!

 

 

0 Kudos
Message 2 of 6
(1,637 Views)
Solution
Accepted by topic author LawnMower3000

Listen to RavensFan's advice. The actual flickering is caused by the fact that you are showing and then hiding plots. It becomes more obvious if you lower the loop time and if you would put a wait between the second and third for loop (the ones that write to Plot.Visible).

 

Learn about events, then try again.

One solution (no, try it yourself first):

Spoiler
Annotation 2020-09-01 090938.png
Certified LabVIEW Architect
0 Kudos
Message 3 of 6
(1,623 Views)

Here is where I have it in the larger picture:

LawnMower3000_2-1598998213870.png

The Listbox is called in the event structure and then queues it to the state ("Listbox"), after done with ActivePlots the state goes back to "monitoring". It doesn't make sense on how it skips while auto-indexing from the "Sensor Box" local variable. (RavensFan, thanks for the help. I see your post all of the place with assisting people's troubles.)

 

 

Message 4 of 6
(1,587 Views)

Thanks Thols,

 

This works! I don't see how my code was skipping because if you look at my post above, you can see I incorporate a event structure. It simply sets the active plots and removes the de-active ones. Thanks again, Thols! 

0 Kudos
Message 5 of 6
(1,586 Views)

@LawnMower3000 wrote:

Thanks Thols,

 

This works! I don't see how my code was skipping because if you look at my post above, you can see I incorporate a event structure. It simply sets the active plots and removes the de-active ones. Thanks again, Thols! 


Glad you got it working.

 

Nothing is being skipped, but if by skipping you mean flickering, then that is because you first activate all plots then deactivate some. Its like turning a lamp on and then off, you will see it flilckering even if the on/off is done quickly.

Certified LabVIEW Architect
Message 6 of 6
(1,549 Views)