05-29-2001 02:31 AM
05-29-2001 05:03 PM
05-29-2001 10:31 PM
02-17-2010 02:52 AM
Hello,
I encountered a problem when using this VI. After many hours of running the VI, the value on the device changes. This happens once every 20-40 hours or so. I used this VI to read three different digital indicators and the problem occurs sporadically on one of them. Does anyone have any idea of where this problem is coming from. Did somebody else encountered this problem?
Thank you, Ron
02-17-2010 10:59 PM
What are you physically trying to measure with these indicators? What do you mean by the value on the device changes? Is it a value that you are expecting remain constant? Give some examples of readings that you get that are good, and what they look like when they change.
02-18-2010 12:45 AM
The value on the device decreases instantaneously by about 1mm (from a range of 12mm). I am very confident it is not a physical change since it also occurs when noting is placed under the indicator.
02-18-2010 04:04 AM - edited 02-18-2010 04:07 AM
Your problem might be caused by the very simple reading code without any sync to the device and no type of error checking.
Now you are sending a "?\r\n" wait 1000ms and read the characters received in that second. But what will happen if the device sometimes need 1001ms (ore more) to send a value?
One or more characters will be left in the buffer and will be read in the next loop.
Simple: flush the read buffer before sending the read command.
More sophisticated code will use timeouts and check the response (easy if you have start and stop patterns in your answer, or a constant number of characters)
02-21-2010 12:51 AM
I tried what you suggested (my implementation is shown in the picture inseted) and the error persisted. Any suggestion for changes that might help? The problem occurs in all three devices.
02-21-2010 01:24 AM
Are you sure you aren't getting physical changes? 1 mm isn't that much. What is the resolution of the readings coming from the gage? Vibration could easily cause some joints in your indicator holding mechanism to start sagging. Perhaps it is a mechanical issue inside the gage itself.
I really doubt anything about LabVIEW could cause it to receive what is otherwise a perfectly valid reading through the serial port (you have parity set), but also be wrong. If there was an issue with losing bytes in the buffer, or some sort of electrical noise corrupting the bits and causing it to fail the parity check, you'd see some data that would look a lot more wrong than a 1mm error.
02-22-2010 03:50 AM
Can you give an example of the bad values compared to good ones? Could it be a simple case of missing a character in the return string?
You should use a termination character to determine when the read is complete and set the timeout of the read to 1000 ms. This will at least give you an error message or a warning if the communication is not complete.
Shane.