Blackbyte Posted October 23, 2008 Report Share Posted October 23, 2008 Hello everybody... I'm working on a project in LabVIEW right now. The main idea is to send (large) files, of any sort, with a UDP multicast to multiple devices. I thought the main idea was quite simple but I can't seem to get it right. The main idea I tried to manage is to convert a file to a large string and to send that string in small pieces to the receivers over a multicast address. Apparently I don't seem to manage this at all... Does anyone know how I should read in a file (could be anything, from .iso to .jpg, .zip,...) and prepare it for the UDP multicast? Once I can manage this, I'm going to start worrying about the loss of packets because of UDP... It would be great to get thru this because it would reduce the networkload when many computers need the same large file from a server. Thanks in advance! Kind regards. Quote Link to comment
LAVA 1.0 Content Posted October 23, 2008 Report Share Posted October 23, 2008 QUOTE (Blackbyte @ Oct 22 2008, 09:41 AM) Hello everybody...I'm working on a project in LabVIEW right now. The main idea is to send (large) files, of any sort, with a UDP multicast to multiple devices. I thought the main idea was quite simple but I can't seem to get it right. The main idea I tried to manage is to convert a file to a large string and to send that string in small pieces to the receivers over a multicast address. Apparently I don't seem to manage this at all... Does anyone know how I should read in a file (could be anything, from .iso to .jpg, .zip,...) and prepare it for the UDP multicast? Once I can manage this, I'm going to start worrying about the loss of packets because of UDP... It would be great to get thru this because it would reduce the networkload when many computers need the same large file from a server. Thanks in advance! Kind regards. Could you show us your current code that you use to read the file into LabVIEW and split it up. It will be easier to provide feedback if we can see what you are doing now. Typically a binary file read should work for any file type. Quote Link to comment
Yair Posted October 23, 2008 Report Share Posted October 23, 2008 Cross posted to the NI forums. It's considered polite to link to cross posted threads to avoid having people do duplicate work. Quote Link to comment
Blackbyte Posted October 26, 2008 Author Report Share Posted October 26, 2008 QUOTE (LV_FPGA_SE @ Oct 22 2008, 06:07 PM) Could you show us your current code that you use to read the file into LabVIEW and split it up. It will be easier to provide feedback if we can see what you are doing now. Typically a binary file read should work for any file type. Untill now I've managed to convert the file into a large datastring. But when I want to make a new file with this datastring, the new file becomes unreadable. (I've tested it with docx, jpg and zip files). You can find this process in the attached VI file... Since I'm not common to work with reading and writing files I don't seem to find the problem... (Maybe I forgot somekind of parameter) Thanks for the replies! Quote Link to comment
Rolf Kalbermatter Posted December 1, 2008 Report Share Posted December 1, 2008 QUOTE (Blackbyte @ Oct 25 2008, 09:12 AM) Untill now I've managed to convert the file into a large datastring. But when I want to make a new file with this datastring, the new file becomes unreadable.(I've tested it with docx, jpg and zip files). You can find this process in the attached VI file... Since I'm not common to work with reading and writing files I don't seem to find the problem... (Maybe I forgot somekind of parameter) Thanks for the replies! Most probably you need to set the "prepend array or string size?" on the Write To Binary File to false as it is by default true. What this does is prepending a 32bit integer indicating the number of array elements (bytes in the case of a string) that follows and that is very useful if you stream multiple blocks to a file but not necessary for a single block and in the case of fixed file formats even catastrophic to do. Rolf Kalbermatter Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.