LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

suddenly receiving timeout error from serial?

Yesterday my Vi was working great, and reading the data from the serial port. Today, I comeabck to the computer, it was not turned off or anything (the serial device was however but i do this every time i leave)  but now when i run the VI i get the 1073807339 error that says the read timed out. What happened? 

 


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

Got it fixed, was sending the wrong command line to the device \n instead of \r

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

I am having the same problem again and dont understand what is wrong. Attached is the program, and the device works fine with the basic serial read program that they gave me with it but in labview it keeps timing out. I closed off that other program and reset the serial connection but it is still timing out at the port when it did not do this the last time I ran it. Attached is the Vi, is there something wrong with it or what am i missing?

 

PS. I know it says TS\r\n which is wrong, but TS\r the supposed read start read command does not work and I was just fiddling with anything.

 

PPS. and now it works fine, I dont understand why it is so flaky, any ideas anyone?

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

Some wild guesses.

 

1. The only timing in the loop is the time it takes to read 22 characters and the time it takes to write to the file. As the file grows the file write time may tend to increase. You are only writing one point at a time so that should not happen too soon.  Accumulating some larger quantity of data and writing to file less frequently might help.

2. The default serial port setup has Termination Characters enabled. The default termination character is line feed (\n).  If your data ever includes a line feed, things might not work as you expect.  It should not produce a time out error, however.

3. Write to Spreadsheet File opens and closes the file every time it is called.  Not too efficient. It will pop up an error dialog if an error occurs.  You did not mention any file errors, so this may not be a factor.

4. Does the program which came with the device send any other commands in addition to TS?

 

Lynn

0 Kudos
Message 4 of 4
(995 Views)