LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

[Visa/RS232] reading data stream of uncertain length

Solved!
Go to solution

@GMAch wrote:

The device just sends for each measurement a string that is ended by a carriage return, with a rate that I can set.



Well that's important information!

 

You don't need to know how many bytes are coming, just set a larger number of bytes to read, larger than the longest message you ever expect to get.  Make sure the serial configure VI is set to use the termination character and that it uses the carriage return  (hex 0D, decimal 13).  The VISA read will terminate as soon as it sees the carriage return.

0 Kudos
Message 11 of 13
(558 Views)

That doesn't work because he sets one carriage return after each measurement, and the stream is the data from multiple measurements. I can only use it to separate the data from the different measurements.

0 Kudos
Message 12 of 13
(552 Views)

Who is he?

 

You should send the data separated by commas or tabs, and the end of the message packet be terminated by the carriage return.

0 Kudos
Message 13 of 13
(549 Views)