02-15-2011 04:43 PM
Does anyone have some insight into how to correctly save a .png file that I grabbed from an IMAQ image? I've been trying to use IMAQ write file 2.vi, but it doesn't seem to be able to create a file. My code works fine if I pass it an existing .png file to write to, but it chokes once I tell it to save the image to a non-existing file. I'm not very familiar with the IMAQ file I/O, but I assumed (wrongly) that it would work the same as the normal Open/Close file vi's that you can give write/replace/create permission to. I attached my vi (sorry it's kind of a mess at this point). Any suggestions? Thanks,
John
02-16-2011 12:56 PM
drummerguy-
We have encountered this problem before. Typically the solution is checking the permissions.
-The most common reason is if you don't have 'write' privileges in the folder you are trying to write to.
*If are unsure about this, you can check by trying to create a new file manually through windows explorer in the directory that LabVIEW is trying to write a file to. If you can create a file there, but LabVIEW cannot, then we can try something else.
-Another possible reason is if you have any illegal characters in your filename such as "%, /, \"
*A good filename would be something like "C:\test\test.png" for PNG files. If you are writing to a specific file type, could you try to write to a different type (JPEG, PNG, TIFF, BMP) and see if you get the same results?
I would try these things first and see it your problem persists. I hope this works for you
02-16-2011 12:59 PM
Thanks for the response. I was actually able to find the problem on my own - I had mistakenly used a file path to array conversion sub vi to turn the directory into a string. Switching to a file path to string conversion subvi fixed the problem.
02-16-2011 01:01 PM
Awesome!! Im glad you got it all taken care of