07-17-2007 11:53 PM
07-18-2007 07:53 AM
Hi,
I would suggest you to try out setting the Timeout before the Visa Write Function. See the attached Serial.jpeg file for the same. Hope this will help u.
Please let me know, if the solution works out for u.
Regards,
Alifiya
07-18-2007 08:01 AM
07-20-2007 04:11 AM
Hi Alif and Centerbolt,
Thank you for your kind reply. Attached are the variations i made for the Timeout Property Node function. But i do get the same result. If i set to more than 300msec i get a steady value but lags a little behind, but if i put timeout to 200 msec, i get a faster data and sometimes randomly wobbles. By the way, i would like to add that whichever time 200 or 400msec, i get an Error message, -1073807339!
It looks like you are sending a command to the compass and then reading the reply.
>>>Yes. I am sending a command to the sensor and actually reading the reply.
Does the compass documentation spec how long it will take it to reply?
>>> There is no spec on how long it will take to reply in its documentation. But i sent an inquiry to the maker.
Does the compass have a mode where it streams data?
>>> Yes. If i send the command "go", it will just give all the compass data continuously.
Thanks a lot.
07-20-2007 06:52 AM
Hi,
You can try using the following steps to debug serial timeout errors(Error code 1073807339):
3. If you are experiencing this error for a VISA Read, verify that you are not trying to read too many bytes. Read only 1 byte at a time while debugging.
Note: If you do not get the error now, increment the number of bytes you read until you get the timeout error again. This tells you how many bytes that command sends back.
You can also use a Property Node to read the Number of Bytes at the Serial Port. Right-click the Property Node and select Select VISA Class»I/O Session»Serial Instr. Then right-click the Property Node and select Properties»Serial Setttings»Number of Bytes at Serial Port.
4. If you still receive the error while reading only 1 byte, verify the command to make sure it has been written correctly.
Note: Verify that you have terminated the command string correctly. A new line or carriage return is often required at the end of a command. A good way to test this in LabVIEW is to right-click the command string control on the front panel and change the display to '\' Codes Display mode. In this mode, a carriage return is \r, a line feed is \n, and an end of line is \r\n. Verify that the command being sent to the serial device has the termination character that the device requires.
Hope this will Help u.
Regards,
Alif
07-20-2007 07:06 AM
07-20-2007 07:29 AM
07-20-2007 07:38 AM
Dennis,
I would like to comment on the solution u suggested. As per ur suggestion (There is a function called VISA Bytes at Serial Port. This returns the number of bytes in the buffer. You can place this function in a while loop and when the number of available bytes is greater than zero, exit that loop, passing the number of bytes to another loop through a shift register. In the second loop, you do a VISA Read of that number of bytes and then another VISA Bytes at Serial Port. With this loop, you exit when the nunmber of available bytes is zero. Wire the result of the VISA Read to a concatanate string function that is wired to a different shift register. ), he would exit the while loop even the correct/desired no. of bytes r not recieved at the port. I mean at times there will be a case of garbled communication, where the no of bytes recieved will be > 0 but less than/ greater than the desired no. of bytes. This will result in garbage data.
Regards,
Alif
07-20-2007 07:46 AM
07-20-2007 08:01 AM