|
|
楼主 |
发表于 2009-3-11 14:18:05
|
显示全部楼层
Problem:
When I try to do a VISA read or a VISA write, I get VISA error -1073807339: VISA: (Hex 0xBFFF0015) Timeout expired before operation completed. How can I fix this error?
Solution:
Use the following steps to debug this or other serial timeout errors:
- Verify that all the serial settings are correct (for example, baud rate, data bits, and stop bits). The device and the serial port must have the same settings.
- Try increasing the VISA session timeout value. This error often occurs when you are reading or writing large amounts of data and it takes longer than the default timeout to send or receive the data.
- 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 Settings»Number of Bytes at Serial Port
- 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. |
|