LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Transmit Data via TCP

I'm not clear on how to transmit binary data via TCP in LabView.  The TCP VIs all take string inputs.  I need to send three 32-bit words via TCP.  The first 32 bits is Mete Data, the second 32 will be an address and the final 32 bits will be a value to write (if a write is the task).  I'd like to be able to take hex values and transmit them in this format, but not sure how to make that happen.
0 Kudos
Message 1 of 6
(3,368 Views)

Hi SirMut,

You can simply transform your binary Data to string and send it via TCP.

Mike

0 Kudos
Message 2 of 6
(3,366 Views)
I tried that.  When I try to transmit zero for example, I receive 48 on the other end which is the ASCII representation for zero.  My receiver is expecting binary data.  The ASCII translation throws things off.
0 Kudos
Message 3 of 6
(3,361 Views)
Hi SirMut
 
i attach an image. Like shown there you can tranform your data to string and get it back on the received side, because you know the format of the received data.
 
Mike
0 Kudos
Message 4 of 6
(3,358 Views)
If you want to build the hex data yourself, you can use the Byte Array to String primitive, which takes an array of U8 and returns the relevant string.

___________________
Try to take over the world!
0 Kudos
Message 5 of 6
(3,354 Views)
That last one works well since the receive side is not a LabView platform, but rather C based.  Thanks.
0 Kudos
Message 6 of 6
(3,345 Views)