LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Read strings of different length from TCP/IP

Hi everybody,

I'm quite new in data communication with TCP/IP in Labview.

I'm trying to read hexadecimal strings from a laser scanner. I would like to acquire one string for loop from TCP Read, send it to onother while loop by means of a queue and then decompose, decode it and save it in a file.  Every string begins with 'sSN LMDscandata' and after that there is a variable number of bytes before the next acquisition. How could I acquire correctly my string if in the TCP Read block it is possible to set only a constant number of bytes?

 

I would appreciate it if you could help me as soon as possible..

Thank you very much in advance,

Lorenzo

 

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

Does the scanner put any other information in there for how long the packet of data is?

 

All good communication schemes would be some know bytes in there that describe how long the message is going to be.

0 Kudos
Message 2 of 4
(3,087 Views)

After several tests I've discovered that the laser scanner package should be 3800 bytes long for each 270 degree scan.

 

Thank you!

0 Kudos
Message 3 of 4
(3,022 Views)

@lorenzo26 wrote:

After several tests I've discovered that the laser scanner package should be 3800 bytes long for each 270 degree scan.

 

Thank you!


That's kind of "iffy" IMHO.  You should really get the manual for the equipment and see what it really is.  Of course, the manual could say that each message is exactly 3800 bytes long.  😉

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 4 of 4
(3,001 Views)