LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Set the file path of get image method

I have a program that takes multiple IV curves of some nano-devices and saves each set of the IV curve data into a CSV file. I also have a graph on the main screen that gives me a visual representation of the data after each IV curve is taken.

 

My program automatically names each IV curve with a different file path and at the end of the program execution I could have 50-60 IV curves.  What i'm trying to do is have LabVIEW export an image file of the graph on my front panel and save it with the save file path as the CSV file.

 

Currently i'm using "Invoke Node -> Export Image" method, which is working fine and doing exactly what I want because i can tell it what file path to save to....however it is just a black and white image.

 

There is another method that I found here: http://digital.ni.com/public.nsf/allkb/5AE4ADCBB65A6D8F86256FBF007A1AC1

That talks about a "Invoke Node -> Get Image Method" which physically captures the colorful chart on the front panel.  However I cannot figure out a way to tell it the file path to save to.  So when I run my program, after each IV curve, it takes the image from the front panel and then on the next IV curve, it interrupts my program to ask me to overwrite the previous file because it's using the same name.

 

Is there a way to tell the Get Image Method to save to a specific file path?

0 Kudos
Message 1 of 5
(3,200 Views)

Did you try wiring a file path constant or control into the function you are using to actually write the image to a file?

0 Kudos
Message 2 of 5
(3,191 Views)

ErichR,

 

Try below code to give file path, otherwise post your VI.

 

image.jpg

0 Kudos
Message 3 of 5
(3,188 Views)

Hi Puneet_K,

 

Thanks for the code....I didn't know you could wire the output of the image data to a write VI.  It makes sense in theory and i thought it would work....but it's not actually writing the PNG. I even tried BMP and JPEG but no results.

 

I'm posting an image of my code with the before and after.  The before uses export image and it works, the after uses the get image and it doesn't create the file.

Download All
0 Kudos
Message 4 of 5
(3,176 Views)

Actually Before uses Get image.  After uses Export Image.

 

Which one doesn't work?

 

They both work for me.

 

What directory path are you trying to write it to?  Any chance you have the file open in another program thus locking the file when you try to run it?

 


@ErichR wrote:

I didn't know you could wire the output of the image data to a write VI.


The document you posted in the original method shows it writing it to a file.  The only problem with the image is that they didn't show a file path constant or control, so without it, it will launch a File Dialog.

0 Kudos
Message 5 of 5
(3,161 Views)