From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

refresh a graph programmatically

Hi

 

I'm trying to capture a screenshot af XY graph and print it to a PNG file.  I'm using Write PNG file to print the image which I grab using theget image invoke node.

 

My VI is split inot three frames.  

 

Frame 1 - display VI on the graph

Frame 2 - Modify the two cursor red limit lines using the propert nodes & modify the y axis scale in the ssame fashion.

Frame 3 - Grab the image

 

The works fine when I have the VI open but when I run it as a subvi the limit lines and y scale modification does not happen, see attached.  It appear the VI has to be openand the disply refreshing.  Does anyone know if there is any way to refresh the display programmaticlaly?

Download All
0 Kudos
Message 1 of 4
(2,465 Views)

PS

 

I neglected to mention that I'm also updating the caption programatically and strangely enough it updates but the scale and cursor do not!

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

LV does not update the front panel unless it is open.  If you ever compare the performance of a complex VI with the subVIs opened and closed you will quickly see that there is a very good reason for this.  That said, there are a few instances (this particular one comes up several times) where it would be useful.  Someday it would be nice to have a VI property to force FP udpates even when closed which you could use once in a blue moon in cases like this.

 

When I can't redesign my program to avoid this issue I tend to set the subVI to open when called and to run transparently.  This updates the FP and gives the desired result.  Sometimes the taskbar flashes, but I am used to it.  Perhaps there is a cleaner solution these days, I haven't tried it in a while.

Message 3 of 4
(2,450 Views)

Disaster!

 

I was hoping there was a simple solution.  Thanks Darin, it'd be nice to get away from a flashing task bar, especially when it goes to a customer but it seems to be the best solution so far!

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