LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Read varying data length

I am looking to use a TCP connection but I have been unable to successfully reproduce a 'bytes at port' reader for the TCP line before a Read function. 

0 Kudos
Message 1 of 4
(1,215 Views)

Conventionally, the sender send 4 bytes first, indicating the size of the following message. Else just keep reading and parse as needed.

 

Do you have control over the sender code?

0 Kudos
Message 2 of 4
(1,212 Views)

I know that the data i am reading comes in the format * 0,0,0,0 (minimum length) or * -10000,-10000,-10000,-10000 (maximum length)

0 Kudos
Message 3 of 4
(1,198 Views)

Does the message end with a Carriage Return and/or a Line Feed?  If it ends with the CR LF, you can set the TCP Read to use CRLF mode and it will then read up to that byte combination.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 4 of 4
(1,172 Views)