LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

COMRDTERM

Hi,
   I had a small question on ComRdTerm(RS232).
Suppose data is streaming from a eyetracker connected to the computer via a serial port as
1.0  2.0  180  35
1.1  2.1  150  40
....
...
(Above numbers have been made up).
 
Since ComRdterm terminated on encountering a termination character would it terminate at the end of each line in the above case.
Or will it avoid the Linefeed(LF) character and display all the lines in the data
 
Would u advice me to use ComRd in such case?
 
Kunal Chaniary
 
 
0 Kudos
Message 1 of 2
(3,265 Views)

ComRdTerm reads and returns the characters received on the serial port and discards the termination byte. As you can see in the online help, a CR + LF combination is discarded too.

However, the function ends even for timeout, so you must set the appropriate timeout with SetComTime and always check RS232Err value after reading so you can detect and handle correctly a timeout during read.

Given these details, ComRdTerm is a powerful function to use if your messages end regularly with a fixed character (which is not supposed to be used elsewere in the message, of course! In this latter case ComRdTerm would be tricked out: that's why you usually cannot use ComRdTerm on binary data transmission, but if your instrument transmits plain text as you have reported you should have no problem).



Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
0 Kudos
Message 2 of 2
(3,257 Views)