LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Chart in Sub Vi is empty

Hi,
 
I created a Sub VI that creates a chart, formats it and exports the chart to JPG format. Now when I call the Sub Vi this doesn't work. I am only getting an empty chart displayed in the JPG format. It only works if I have the Sub Vi open at the same time I am running the main program. This is not a permanent solution since I need to compile the program as stand alone.
Anyone an idea or work around?
 
I somehow this it muse be some of refresh method of the pane or chart object.
 
I am using LV 8.2.1
 
Holger
0 Kudos
Message 1 of 8
(3,594 Views)
I think you are on the right track.  How have you coded this VI?  Are you using some method to get the front panel image of a chart that is embedded in the VI?  I think what is happening is that if the sub-VI's panel is not open, there is no reason for Labview to redraw its front panel.  So if you use a method in the SubVI to get the front panel image, you get nothing.  I think you will have to use VI server to show the front panel of the VI, execute the method, then close it.  Or pass a reference to a chart that is in a VI with an open front panel and have it work on that.
Message 2 of 8
(3,586 Views)

I think the (poor Smiley Wink ) Ravens Fan has the right idea.

Try using a an Invoke node >>> Get image for the chart AFTER the data is presented to get the chart image to update.

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 3 of 8
(3,569 Views)

Thanks for the reply.
I also haven't found any method to update the chart, so I guess the only option is to reference the chart object in the main Vi.
(which isn't very elegant)

Anyway I attached the Vi, maybe someone has another idea.

It is strange though that you can't update the chart with a method or property.

Holger

 

0 Kudos
Message 4 of 8
(3,556 Views)
Ouups, I have figured it out.
Under the VI properties I had the front panel hidden. I changed it and it works.
 
Thanks for your help....
0 Kudos
Message 5 of 8
(3,548 Views)


@Ben wrote:

I think the (poor Smiley Wink ) Ravens Fan has the right idea.



Hey, we're only a half game back of you guys right now.  Smiley Happy

-Bill

Message 6 of 8
(3,530 Views)

You can set it to show the FP when called, but make the FP 100% transparent.

Some comments:

  1. You don't need to write all these font, etc. properties. They are saved with the VI and only need to be set when things change.
  2. Initiaizing to default will clear the history also, so you don't need to do that twice.
  3. Overall, your code is way too chopped up with local variables and sequences.
  4. Since everything is quite linear and execution order is defined by the error cluster, all you need is a flat diagram (see attached draft).
  5. You should avoid manipulating paths as strings, it breaks OS independence. Your cluster should have a path constant instead of a string.
Message 7 of 8
(3,527 Views)

Nice!!

0 Kudos
Message 8 of 8
(3,516 Views)