LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

tcp read message

Hi Everybody
I have a problem with LabVIEW "TCP Read". I have developed a TCP server, that needs to process data message that arrive from a C++ appliacion, not developed my me. This application, sends a message with a defined format. That is:
byte 1: type of message
bytes 2 and 3: value of variable1 (unsigned int)
bytes 4 and 5: value of variable2 (unsigned int)

The problem is I don't know how to "extract" bytes 2 and 3, and bytes 4 and 5 to create an unsigned int variable. Does anyone know how to do it??

Thank you very much in advance!!
0 Kudos
Message 1 of 4
(2,855 Views)
Hello Esther,

TCP Read Returns a string as output, assumning that the person who did the "other end" of you TCP/IP comunication used a binary coded string, the following approach would work (Check annex).

Hope this helps,
Paulo
Message 2 of 4
(2,848 Views)

Esther.Lopez wrote:...This application sends a message with a defined format. That is:
byte 1: type of message
bytes 2 and 3: value of variable1 (unsigned int)
bytes 4 and 5: value of variable2 (unsigned int)

I suppose that you retrieve the message either as a string, or as a byte array. The attached vi shows how to convert to an appropriate format.

CC
Chilly Charly    (aka CC)
Message 3 of 4
(2,845 Views)
Thank you very much!! Both messages have been very usefull for me.
Message 4 of 4
(2,829 Views)