LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

save image of front panel to JPEG programatically

I am running Labview 5.1.1 and I want to save the image of my front panel to a JPEG.  The front panel contains 3 charts and a cluster of test data.  It is a front panel of a subVI that I send the data to from my main VI and recreate the graphs in the subVI using history data attribute node.  I then use the print at completion setting to print the front panel.  However now I also want to save this image.

0 Kudos
Message 1 of 18
(4,818 Views)

Hi BME,

 

standard answer would be to use a invoke node "Get FP image" followed by one of the image write functions...

 

As you are still using LV5.1 (atleast LV6.1 is available license-free in Germany) , you should look for those items. I'm not sure as they might be added in later LV versions...

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 2 of 18
(4,803 Views)
Ok, I got that part but how how do I open the reference to that subVI from my main VI and how to get a file path into the subVI to write that new jpeg file to?
0 Kudos
Message 3 of 18
(4,801 Views)

Hi BME,

 

"how do I open the reference to that subVI"

 - using "Open VI reference" makes that part really easy Smiley Wink

 

"how to get a file path into the subVI"

- Do you know how to make connections between vis in general? If not you should take the free online courses on NI's website in the academics section!

Otherwise you make a path control in the subvi, connect it to a terminal of the connector pane and wire the path in the main vi...

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 4 of 18
(4,791 Views)
Would you perform this open and invoke and write to jpeg in the main VI or subVI?  Also would you do it after the subVI executes so it can form those charts on the front panel?
0 Kudos
Message 5 of 18
(4,789 Views)

Hi BME,

 

I would put the invoke node into the subvi, no need to get a reference the "hard" way (that's really easy in the subvi). Then it is also easier to have a proper dataflow (timing!)  to save the correct image with all plots/graphs/whatever you want to save...

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 6 of 18
(4,787 Views)
So that means I need to add an file path input to the subVI.  Then in the subVI I can add that code but why would I need to open a reference if I am already in the VI that I want to invoke?
0 Kudos
Message 7 of 18
(4,786 Views)

BME genuis wrote:
So that means I need to add an file path input to the subVI.  Then in the subVI I can add that code but why would I need to open a reference if I am already in the VI that I want to invoke?

To invoke a method you need an invoke node which in turn requires a reference so that it knows what object to act on.

 

Before we go any farther, have you verified that you have found the "invoke Node" in LV 5.1?

 

I seem to remember those coming in to LV about LV 6.0... but I may be wrong.

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 8 of 18
(4,774 Views)
Yep, 5.1.1 definitly has the invoke nodes!
0 Kudos
Message 9 of 18
(4,770 Views)
So we have confirmed that there is the invoke nodes in 5.1.1.  Now, how do I go about doing this programmatically?
0 Kudos
Message 10 of 18
(4,698 Views)