04-24-2017 08:54 AM
Hello there!
I am using Labview 2013 to take and save images for my measurements. However, the colorscale of the saved image is not the same as shown on display, see below. Is there a way to save the image as shown without rescaling the scale?
Thanks for your kind help in advance!
04-24-2017 10:21 AM
How are you saving the image?
Blog for (mostly LabVIEW) programmers: Tips And Tricks
04-24-2017 10:33 AM
Hi there! I use the 'IMAQ write file 2' VI to save the image in PNG format.
Cheers,
Raul
04-24-2017 10:46 AM
Well, I don't know IMAQ, but if you use three things, you get around it.
You need a REFERENCE to the graph.
You need an INVOKE NODE on that ref, set to GET IMAGE.
And you need an IMAGE TO PNG FILE.
You'll have to supply a file path, but this will get it done.
Blog for (mostly LabVIEW) programmers: Tips And Tricks
04-25-2017 07:25 AM
Hi Steve,
Thanks for your advice. but I can't get the invoke note to work, it says the selected method is invalid. There is no other method available to get the image. Do you have any idea what could be possibly wrong? Thanks.
04-25-2017 07:48 AM
Data Flow is what is wrong.
You need to make sure that the delete image is run AFTER the save image.
04-25-2017 08:04 AM
Thanks. I tried not run the IMQ dispose VI, but still the method is invalid.
04-25-2017 08:07 AM
dkfire is exactly right. That might be what's wrong with your original plan, as well.
Take a look at this:
And ask yourself this question:
Which happens first: the image getting to the INVOKE NODE, or the image getting to the DELETE function?
If you answer that with anything except "I Don't Know", then you're wrong.
The INVOKE node has a duplicate image reference coming OUT of it - use that to insure that INVOKE happens BEFORE the DELETE.
Blog for (mostly LabVIEW) programmers: Tips And Tricks
04-25-2017 08:09 AM
To use the INVOKE node, you have to have a CONTROL REFERENCE to the actual graph. I don't know IMAQ, but it's possible it's not allowable on an IMAQ reference. Try using a reference to the actual display indicator.
Blog for (mostly LabVIEW) programmers: Tips And Tricks
04-25-2017 09:04 AM
Or simply remove that invoke node.
You don't need it, as you allready have a reference to a image in IMAQ.
You just need to make sure that you call the dispose vi AFTER the save image vi.