LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Automatically saving panel image to file after test

Hi,

 

I am trying to have LabView save the front panel image to file automatically at the end of a test without prompting for file name or location. I had success with saving the panel front image after the tests, but a dialog box would come up and ask for a file name and location. What I've attempted to do is use user input from the beginning of the program to use as the file name and have the directory be constant. I have followed various examples I've seen on the internet, but have had no luck in actually saving the image to file automatically. 

 

Could you take a look at my screenshot of the end of my program? The two pink wires coming into the screen are from an User Input dialogue prompt.

 

Thanks for your help,

 

Dylan

 

Screenshot

0 Kudos
Message 1 of 6
(2,766 Views)

Have you put a probe on the wire coming out of the Build Path primative? Make sure it's returning a valid path. If Build Path fails, it won't and you will still get that dialog. Often times, a misplaced or incorrect '/' or '\' can cause this sort of problem. As good coding practice, you should also use the "get system directory" instead of hardcoding C:\ . Sometimes C:\ won't be the system root directory on some computers. That function will allow you to always grab the root.

0 Kudos
Message 2 of 6
(2,757 Views)

It looks like your code should work. Here are potential reasons for why it won't:

 

  1. The image type enum causes another case to execute, and there you didn't wire the path in. BTW, I would suggest just using PNG all the time.
  2. The dialog actually comes from somewhere else, not from the picture VI. You can probably check for that by setting a breakpoint before the VI. If the dialog only comes up after you unpause the VI, then it's probably from there.
  3. The strings you are providing are creating an illegal file name and the Build Path primitive outputs Not a Path, causing the picture VI to prompt you for a path.

 

If these don't help you find the reason, you should upload the VI itself, or at least add an indicator of the path and show us what the path going into the VI is.


___________________
Try to take over the world!
0 Kudos
Message 3 of 6
(2,755 Views)

Thank you for your assistance. I've made a few changes as per your suggestions, but have not had any luck in having the image automatically save to file. 

 

I've attached the VI, if you would have a moment to take a look at it. 

 

Thank you,

 

Dylan

0 Kudos
Message 4 of 6
(2,714 Views)

Did you make sure the dialog actually comes from there as I suggested?

 

Also, what's the path going into the VI? Can you add probes on all the wires there and get a screenshot?


___________________
Try to take over the world!
0 Kudos
Message 5 of 6
(2,704 Views)

dschmitt,

 

I was able to download your VI. I just copied and pasted the SAVE FP portion and stuck constants for the string inputs (user). I had no problems at all. Note* you will want to add ".png" to your concatenate string or else you will get an unrecognized file format.

 

Make sure that your "vi path" is populated with the local address of your vi. I would recommend just using the "vi server reference" under application control, but either should work.

 

I noticed you took your case structure out. Are you getting the exact same issue? or is it something different?

 

I was sure that tst's comment (#1) was what you were experiencing, but since you removed your case structure and it's still not working, I'm curious.

 

-Chazzzmd

0 Kudos
Message 6 of 6
(2,696 Views)