From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how can I map an image (JPEG) from the SQL database image string

I saved the image into SQL database, see attachment (SaveImage2SQLDB.rar), while I have some trouble to retrieve the image. I also attached the vi which I used to convert the string to image. The string already has a value I obtained from the database. Can anyone tell me the reason why it didn't work.

Thanks in advance.

Jane

 

LabVIEW 2012, VDM 2012

 

Download All
0 Kudos
Message 1 of 6
(3,212 Views)

Hi Jane,

 

What exactly isn't happening correctly?  The conversion or the retrieval? 

 

This discussion forum may be of some use: http://forums.ni.com/t5/LabVIEW/image-from-compressed-string/m-p/2207894

Matt S.
Industrial Communications Product Support Engineer
National Instruments
0 Kudos
Message 2 of 6
(3,185 Views)

I used unflatten string function to try to get the image, but there is an error code. Can you open and run my attached <convertstring2image.vi>? The input HEX string is the one I retrieved from the SQL database.

0 Kudos
Message 3 of 6
(3,173 Views)

Hi Jane,

 

I'm not sure why your error is occurring, but I found an example on how to do what you're attempting to accomplish, please this link: http://forums.ni.com/t5/LabVIEW/imaq-string-to-image/td-p/1100298

 

Thanks!

Matt S.
Industrial Communications Product Support Engineer
National Instruments
0 Kudos
Message 4 of 6
(3,156 Views)

To save the image to the SQL database <image> type data, I have to change the string format. In the save image vi, you can find this. The example you mentioned actually didn't convert the string.

Thanks,

Jane

0 Kudos
Message 5 of 6
(3,145 Views)
I don't have IMAQ right now but it looks like you convert to a string and then do some other conversion with a subVI that you call flatten to string. Its not the same as the LabVIEW of that name. I would suggest you look again at the first link you were given and directly convert the image with the real flatten to string and back to image with the unflatten function.
0 Kudos
Message 6 of 6
(3,140 Views)