LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Frame Color Property node, not updating until the VI is stopped?

I am trying to change the frame color of a graph in a VI I am working on, but I get very inconsistent results with the property node, and most of the time it will only actually update the color after stopping the VI. I have included a quick example to show what is going on, and wondering if there is a simple fix to this. Thanks. 

0 Kudos
Message 1 of 6
(3,168 Views)

Did you realize you were "force-feeding" your While Loop, asking it to display far faster than the background code trying to update the graph can work, and at the same time, you are asking it, on every iteration, to change the Frame Color, which surely needs to be done once, preferably before you start overloading the Display.  If you must do the same unnecessary changing of the Frame Color Property for each point, try putting a 1 msec Wait inside the loop to allow other processes a few cycles of CPU time.

 

Bob Schor

0 Kudos
Message 2 of 6
(3,153 Views)

Actually, when I first ran your VI (in 2017), it was updating the background of the X axis.  I had to change your constant to a control so that I could change the color since the yellow constant and yellow background meant nothing was going to appear different.

 

It was also running as fast as possible.  So I put a wait in.  It seemed to change the color of the whole frame after a few iterations.  Then after stopping and restarting, it started to behave just like you said, not updating until after the VI stopped.

 

Very weird.

0 Kudos
Message 3 of 6
(3,151 Views)

I was just trying to give a quick example. Here is an example that is much closer to how it is actually being used in my VI. It will still only update the frame color once the VI is stopped.

0 Kudos
Message 4 of 6
(3,147 Views)

So if you want a flashing Color indicator, don't color the Chart or Graph Frame.  Drop a Boolean LED Indicator and color that!  The Graph/Chart is a complicated gadget that NI gives us and integrates itself somehow into the Front Panel.  It has properties to allow you to customize it (once, at the beginning), but since its raison d'etre is plotting data, it has been optimized to ... plot data, not serve as a Flashing Boolean.

Flashing Boolean.png

 

Bob Schor

0 Kudos
Message 5 of 6
(3,112 Views)

I'm also seeing weird behavior on the chart color update.  I can force parts of it to update the color when interacting with it (highlighting numbers on the axis).  Can also force certain parts to update by placing a transparent decoration over it.  I assume this is forcing LabVIEW to redraw the indicator and apply the new color.

 

One workaround that seems to solve this is to follow a color change event with a quick cycle of the "visible?" property node.  Set "visible?"=FALSE then "visible?=TRUE" after the color property node.  This will force LabVIEW to redraw the whole indicator with the new color.

Message 6 of 6
(3,106 Views)