LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How does one send a file via UDP?

I need to send a binary file via UDP. The file has 99 32-bit binary words of data. How do I input the data to the UDP write command? I don't want to send the data sequentially..I would like to send all 99 words in a single UDP transmission. TIA.Smiley Sad
-jlivermore
0 Kudos
Message 1 of 6
(2,837 Views)
You need to convert the 99 32-bit values into 396 8-bit values.  Cast that to a string and feed it into the UDP write.  Do the opposite on  the UDP read end.
Message 2 of 6
(2,827 Views)
Something to be careful of is that while UDP is fast, it is not secure. You can lose packets and there is no way for the sender or receiver to know it was lost. Because UDP doesn't have a "connection" like TCP does, the sender doesn't know if the data is going anywhere and the receivers have no way of knowing if anything is being sent.

Picture a radio station. A guy working the night shift hopes there is someone somewhere listening to his broadcast, but he doesn't know. Likewise, if you turn on a radio and hear nothing but static, you may be listening to a frequency where there are no stations broadcasting, or the station transmitter might be off the air, or there might be interference keeping you from hearing the signal, but again you don't know which.

Mike...

Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
Message 3 of 6
(2,824 Views)

Thanks, Mike. I am using UDP only because I am new to labVIEW and it is easier for me, at this point, to use it than TCP/IP. Once I get everything working in UDP, I will switch to TCP/IP. Thanks for the feedback.

-jlivermore

0 Kudos
Message 4 of 6
(2,798 Views)

Thanks, Ravens Fan.

-jlivermore

0 Kudos
Message 5 of 6
(2,796 Views)
You might want to check the TCP examples, I believe there is one that transfers files.

Mike...

Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 6 of 6
(2,776 Views)