LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Serial Read with Timeout ignoring timeout value

I am modifying a program that I have used for the last couple of years to read and write serial data to an instrument.  In troubleshooting this code, I have found that the Serial Read with Timeout.vi behaves strangely.  I have written a short test program that demonstrates this behavior.  In the test program, I clear the serial port of any data, send an "S" command to stop the transmitter, the send an "Echo ON" command to tell the transmitter to echo commands received back to the PC.  The response to the Echo command should be 34 bytes consisting of the echoed command followed by the value of the Echo parameter (on or off) and a prompt (>).  When I run this program, I get the echoed command (10 bytes).  The timeout value is set to 5 seconds, but Serial Read with Timeout completes almost instantaneously.  I thought that perhaps the timeout value wasn't getting set properly, so I added a property node to read the value and it is correct after the read.  The rest of the string that should have been read appears when I clear the serial port on a subsequent run of this program.  There are no errors reported.  I get "Warning 1073676294" as error out, but this apparently is generated by a previous call to Serial Read with Timeout.
0 Kudos
Message 1 of 2
(2,656 Views)
I can't open your VI becasue I don't have 8.0 but it sounds like you may have the VISA Configure Serial Port input of Enable Termination Char unwired or set to True. and the the instrument is sending this. The default termination character is LF (x0A) so if your instrument is sending this, the read will terminate immediately upon reception. It doesn't matter how many bytes you tell it read. Try setting the Enable Termination Char to false.
0 Kudos
Message 2 of 2
(2,653 Views)