LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Export simplified image failed in subvi

Solved!
Go to solution
I have a subvi which suppose to plot and export the xy-graph programmly. However, it could only generate blank images (.emf). As I tried many times, I found out that if I kept the subvi open, no issue at all. But even with minimizing the subvi, only blank pictures. I wonder why? Is there any way to export the graph in subvi?
0 Kudos
Message 1 of 18
(5,507 Views)
Ishi, it would be great if you could attach a simplified code of what you're trying to do.
0 Kudos
Message 2 of 18
(5,502 Views)

Here's what I made as a little example. In my case (Labview 8.5), it won't export image when sub-vi is closed. However it does work when the sub is opened no matter minimized or not, which is contradictory to my real program (only blank images saved if minimized).

 

Lei 

Download All
0 Kudos
Message 3 of 18
(5,497 Views)

LV does not update graphics for FP's that are not open (and I am glad since the wasted CPU would account for global warming in itself).

 

Try using an "invoke node" get image method to force LV to update the image.

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 4 of 18
(5,491 Views)
Solution
Accepted by topic author lshi
I guess the front panel needs to be loaded to draw the images correctly. Either you could open the front panel just before exporting the image, or use the Get Image property and store it as a jpeg or bmp.
0 Kudos
Message 5 of 18
(5,489 Views)

NitinD wrote:
I guess the front panel needs to be loaded to draw the images correctly. Either you could open the front panel just before exporting the image, or use the Get Image property and store it as a jpeg or bmp.

 

The Invoke node Get image is usually enough to get LV to update the FP. Everything else can stay the same.

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 6 of 18
(5,485 Views)

No, I tried just insert the Get Image node, but it would not work. Write to image file does work.

 

 

Lei 

0 Kudos
Message 7 of 18
(5,470 Views)
You are using the Get Image property incorrectly. The Image Data contains the image data of the graph. You could wire this data to Write to JPEG File.vi or Write to BMP File.vi. Or as I said earlier, instead of using Get Image, use the Export property, but ensure that before writing to the graph, you are actually opening the front panel through invoke node and closing it once you're done with the Exporting.
Message 8 of 18
(5,463 Views)

Yes, I know write to image file (jpeg/bmp) does work. The subvi I posted was a trial for what Ben had suggested, cause I do prefer the emf file (large, simple, not like a snap shot). How to open the front panel through invoke node w/o actually seeing it? Open/close subvi will slow the program, won't it?

 

Thanks,

 

Lei 

0 Kudos
Message 9 of 18
(5,458 Views)

Try wiring the returned image from the Invoke node Get immage method to a cluster and unbundle one of the values and wire same to the edge of you seq frame.

 

Why soething that silly?

 

LabVIEW is smart enough to know that nothing is being done with the data from the invoke node so it will skip that operation. By wiring from the invoke node you will trick LV into actually doing the "get image".

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 10 of 18
(5,451 Views)