LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I transfer a file through a TCP connection?

Yes, the TCP Write only accepts string, but the important part is the Read From Binary File. It can output a string, regardless of the file:




Message Edited by smercurio_fc on 06-09-2008 02:58 PM
0 Kudos
Message 11 of 38
(2,044 Views)
Oh, I misunderstood you.  You know, I've used Read From Binary before, and always had to typecast back to my datatype and never put two and two together like that?
0 Kudos
Message 12 of 38
(2,040 Views)
thank you guys so much for your help, I really appreciate it!!!!
0 Kudos
Message 13 of 38
(2,033 Views)
Hi,
on the example you gave, what is the white symbol that the file path feeds into? It looks like it has a floppy disk on it? thanks
0 Kudos
Message 14 of 38
(2,030 Views)
I had copied that bit of code from the VI that I had posted earlier. That's the old Open_Create_Replace File VI. If you have context help on placing the cursor over the function would show you brief help on it:



It's been replaced by the Open/Create/Replace File function:




Message Edited by smercurio_fc on 06-09-2008 04:48 PM

Message Edited by smercurio_fc on 06-09-2008 04:49 PM
Download All
0 Kudos
Message 15 of 38
(2,019 Views)
So, once I have the picture converted to binary data and send that over the TCP connection, how do I turn the binary string back into a picture file?
0 Kudos
Message 16 of 38
(1,977 Views)
If you are just piping the raw data from the jpg straight to the TCP Write, do the opposite on the other end, pipe the raw data back into a binary file. Save it with JPG or whatever it was before and should open right up.
0 Kudos
Message 17 of 38
(1,973 Views)
When you do a Read from Binary File you're not doing any conversion. It reads the bytes of the file, which is the whole point. When you transfer them you're trasferring the bytes, which is the actual contents of the file. At the receiving end all you need to do is to Write to Binary File.
0 Kudos
Message 18 of 38
(1,972 Views)
If I am going to send a bunch of pictures one right after another (using a for loop), and I want to save them all to new, separate files on the other end, is there a way to tell the write  binary file function when the end of a picture is and when the start of a new one is? And can I do it with a loop?
0 Kudos
Message 19 of 38
(1,965 Views)
Or is that info in the binary data inherently?
0 Kudos
Message 20 of 38
(1,963 Views)