LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

text data to a picture

Hi,

I programing a VI to obtain a image from a web page (or FTP server), I´m using "DataSocket Read" to catch the image as a string data, then I´ve to save this string in a file text, (*.jpg) and then open it to obtain the image and put it ina a "Picture Indicator". The question is: How can I modify my VI (attached) to eliminate "Frame 1" (See the VI) because I don´t want to use a temp file to save the image? 

atte
Ray Cassani
Raymundo Cassani
0 Kudos
Message 1 of 18
(4,160 Views)
Can you post ur vi for lv 8? or a screen shot of your block diagram?
Message 2 of 18
(4,152 Views)
Use a "string to byte array" function.Then  a reshape array function to convert it to 2d array.Then an array to image.
Message 3 of 18
(4,148 Views)
Hi Ray,
afaik it is only possible if you write your own tool, to read the raw data of an jpg file or you find a third party tool. There is another thread were someone want the same. http://forums.ni.com/ni/board/message?board.id=170&message.id=323786#M323786
 
Maybe it helps.
Mike
 
 
Message 4 of 18
(4,147 Views)


muks wrote:
Can you post ur vi for lv 8? or a screen shot of your block diagram?



Why are you asking for an LV8 copy?  Because that's the latest version you have?  It's not very polite to ask the poster to post an older version of a VI just so you can see it.
0 Kudos
Message 5 of 18
(4,105 Views)

Why are you asking for an LV8 copy?  Because that's the latest version you have?


Yup that is the version which i am currently having.
Message 6 of 18
(4,072 Views)


Ravens Fan wrote:

It's not very polite to ask the poster to post an older version of a VI just so you can see it.


Why not?
 
Ray, I would have to agree with Mike that you would probably need an implementation of the JPEG decompression algorithm to do this on a binary stream. NI's VI calls a DLL function to do this, but you don't know what the function prototype is and even if you did it's quite possible that the function accepts a path and reads the file internally.
 
What's the problem with the temp file method?

___________________
Try to take over the world!
Message 7 of 18
(4,058 Views)

While it's nice if he wants to look at the VI to help out in the discussion, if he doesn't have that version, there's not much he can do to help.  Considering that most people who are posting "I need help with this" are new LabVIEW users, which is why they are using the latest version,  i.e. they just purchased it and just learned it, why complicate the whole thread asking the new person to figure out how to do a save backwards to an earlier version.

I think it's a legitimate request if the person says, "hey, that VI sounds like what I need but I don't have that version, can you please save it back for me".  But saying "save it back just so I can look at it" creates a lot of trouble for a new person just for Muk's convenience.

If a person isn't able to keep up with the latest LabVIEW version, (and I believe LV8.0 is now about 3 years old), it is unfortunately going to limit a person's ability to follow the forum and participate as time progresses.

It would be nice if the file format of VI's was more consistent between versions so that anyone can open them, even though they might be broken because they incorporate a new feature that didn't exist then.  I think NI has gotten better with this with 8.5 now going back to 8.0.  Hopefully that trend will continue.  Even Microsoft has somehow managed to keep the file format consistent for Excel and Word for about a decade (until they just broke it with those stupid xlsx and docx formats.Smiley Mad)



Message Edited by Ravens Fan on 07-14-2008 01:25 PM
0 Kudos
Message 8 of 18
(4,050 Views)


Ravens Fan wrote:

While it's nice if he wants to look at the VI to help out in the discussion, if he doesn't have that version, there's not much he can do to help...

I think it's a legitimate request if the person says, "hey, that VI sounds like what I need but I don't have that version, can you please save it back for me". 


I think both reasons are legitimate, although I can see how a user with a problem might become more confused if they're asked to do another thing. That said, I don't think it's that terrible - most users can manage, and if not, ask how to do it. I would say it should be a judgement call made on a case by case basis.
 
muks, the code itself isn't that interesting. I can't save it at the moment, but the key component is downloading something using Datasocket, which is done by entering the URL with "[text]" appended to it into the DS Read function. You get back the binary data represented as a string. You should find an example if you search for "datasocket download".

___________________
Try to take over the world!
Message 9 of 18
(4,038 Views)

But saying "save it back just so I can look at it" creates a lot of trouble for a new person just for Muk's convenience.

I  am not demanding someone to post it for 8.0.I am neither against use of  8.5.But that is the version i am having and i am  trying to learn ,help and contribute in this forum.I suppose i am not doing something wrong.Do you mean to say  whosoever is using 8.0 shouldnt  know the current affairs?  i am only trying to help.
Message 10 of 18
(4,016 Views)