LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Modifying graph using property nodes

Solved!
Go to solution

I've been struggling with this problem for a while now. I have a simple waveform graph that I want to adjust the horizontal scale of and then make a .png file from it. The vi is attached. This vi is part of a much larger vi. When I run the top-level vi the horizontal scale adjustment doesn't work. The .png file I get shows the unscaled graph. However, if I open this vi and then run the top-level vi it does work - the .png file shows the correctly scaled graph. Also, if I just run this vi by itself it works correctly.

 

I'm guessing there is some timing issue and the .png file is created before the scaling takes place but I don't see how.

 

Does anyone have any ideas as to why the scaling does not happen if the vi is not open when it is run?

0 Kudos
Message 1 of 7
(3,128 Views)
Solution
Accepted by topic author Collin M

If the VI's front panel is not open, the property nodes may not do anything because they execute in the UI thread.  This is consistent with the behavior you report with it working when the VI is open.

 

Can you try opening the front panel but placing it offscreen (so the user does not see it) and then set the graph properties?

 

Lynn 

Message 2 of 7
(3,114 Views)
How should I do this? I tried setting the "Show front panel when called" checkbox in vi properties but the original behavior remains. I also tried adding a property node to the vi to open the front panel when called but that also did not change the original behavior.
0 Kudos
Message 3 of 7
(3,102 Views)

Can you put together a simple VI which calls this VI and shows the problem? 

 

Lynn 

0 Kudos
Message 4 of 7
(3,092 Views)
I can duplicate the problem using this top-level vi along with the first vi I posted.
0 Kudos
Message 5 of 7
(3,083 Views)

I just tried it at my computer.  I had to set the subvi VI Properties - Window Appearance to Customize - Show front panel when called and Close afterwards...

 

After I did this, the subvi pops up for an instant then closes.  The resulting file shows the graph expanded to the new scale.

 

So it works here after setting the subvi properties.  Are you sure you are setting the appearance correctly?  Does the subvi pop up for a brief moment when you run the main?

 

- tbob

Inventor of the WORM Global
0 Kudos
Message 6 of 7
(3,054 Views)

Ok, I seem to have it working now. I originally also had the vi minimized and that may have been my issue.

 

Thanks for the quick responses!

0 Kudos
Message 7 of 7
(3,049 Views)