LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

2D picture control doesn't refresh properly

Solved!
Go to solution

I have an application which displays a picture in a 2D picture indicator and draws a few rectangles and lines on top of the picture. 

 

The locations of these lines change throughout the day, and the application is designed to run minimized and then provide a quick-look at various status items when it is restored by the user.

 

While minimized however, the image does not appear to get updated, even though my code is updating it once per second. I can't actually tell what happens when it's minimized obviously, but the behavior persists for some time after the window is restored, and the state it is 'frozen' at is from the time it was minimized.

 

There are other digital indicators on the front panel getting updated in the same 1Hz loop, so I know it is just the 2D picture indicator that's not working--i.e., something with LabVIEW or system related is causing the image not to refresh while it's minimized, and more importantly, for some time after the application is restored.

 

Some things that will cause a successful refresh to the displayed image after I restore from the task bar to a stale display:

  • Minimize again, then restore again (of the LabVIEW window)
  • Probing the datapath on the BD for the final Draw Line output that connects to the indicator
  • Waiting for awhile (15 seconds? 30 seconds?)

 

I also tried setting the following property node with no effect: 

 

  • VI > Panel > Defer Panel Updates > Set to False

 

 

Another way to think about this would be to imagine a 2D picture control with an analog clock, where lines are drawn for minute and hour hands, and updated once per second.  This is not what I'm doing but the example is easy to understand.  When the application is restored from the taskbar, the clock appears frozen in time from the last time it was minimized.

 

Same behavior running this in LV 2012 and 2013... I am looking for any other property nodes or refresh methods to force a refresh at 1Hz, regardless if the display is visible.  The display should be immediately up-to-date when the application is restored by the user.

0 Kudos
Message 1 of 4
(2,603 Views)

You could try looking at the panel resize event (to recognize the restoring) and then force an update using one of the following methods (I have no idea if they will help):

 

  1. Set defer to T and only then to F.
  2. Set defer to T when minimizing.
  3. Set the FP window state to something else (hidden, minimized, etc.) and then to standard. This should ideally do the same thing you did with minimizing and restoring again.
  4. Use the window position property to place the window off the screen and then back in its original position.
  5. See if you can toggle the synch. updates property programmatically.
  6. Have a hidden control displayed over the picture control and then hide it.

___________________
Try to take over the world!
0 Kudos
Message 2 of 4
(2,600 Views)
Solution
Accepted by topic author m3nth

Hello m3nth,

 

I ran into something similar a while ago- at the time I believe I ended up using the (Value) property, which seems to force a redraw.

 

Regards,

Tom L.
0 Kudos
Message 3 of 4
(2,587 Views)

Thanks very much for the suggestions... I was using a local variable to write to the picture indicator and replaced that with a Value property node, which corrected the issue.

0 Kudos
Message 4 of 4
(2,562 Views)