TCP Sink/Output data size
-
hardcobblefu
- Posts: 1
- Joined: Mon Aug 25, 2025 3:04 pm
TCP Sink/Output data size
I use TCP sink(mode=server) to send the sinewave data to a client(LabVIEW code) running on the same computer. I'm able to see some random data instead of Sinewave in LabVIEW. Has anyone used TCP connection successfully? What length of data(output data packet size) will be expected on client side in each run? Thanks!
-
bongsoon
- Posts: 1
- Joined: Thu Jul 10, 2025 12:57 am
Re: TCP Sink/Output data size
When using GNU Radio’s TCP Sink, the data sent is raw binary floats, not ASCII.hardcobblefu wrote: ↑Mon Aug 25, 2025 7:32 pm I use TCP sink(mode=server) to send the sinewave data to a client(LabVIEW Slice Master code) running on the same computer. I'm able to see some random data instead of Sinewave in LabVIEW. Has anyone used TCP connection successfully? What length of data(output data packet size) will be expected on client side in each run? Thanks!
LabVIEW will show “random data” unless you read it as the correct binary datatype.
✔ Expected behavior
TCP Sink outputs 32-bit float samples (unless you changed the item size).
So each sample = 4 bytes.
Packet size on the client side is not fixed — TCP is a stream, not a framed message. You may receive any number of bytes per read (1 byte, 200 bytes, 4096 bytes, etc.).
✔ What you must do in LabVIEW
Read raw TCP bytes.
Reconstruct them as float32 (single-precision).
Then plot the samples → you will finally see the sinewave.
✔ Why you see “random” data
Because LabVIEW is interpreting the binary float stream as text or the wrong numeric format.
If you want, I can give you a minimal LabVIEW TCP-read block diagram or a matching GNU Radio flowgraph snippet.