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
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?
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?