Thanks to Pnt
The program works well now. I noticed there was a VISA error code, -1073807253. Then I spent a lot of time to search for
possible resolutions. Fortunately, I found several suggestions regarding to the usage of LabVIEW VISA.
The suggestions are concluded as follow. They should be useful to people who encountered the same problem.
1. set a delay after the VISA configure serial port.
I think this may be the most possible reason for the random codes. The port has not completely configured before writing
and reading.
2. delay after write.(such as 100ms)
However, my program seems to work well without this delay.
3. Flush the I/O buffer everytime after read.
4. I also used a property node of Bytes at Port before VISA Read. Read the port only if the Bytes at Port is not 0.
5. Some people suggested set I/O buffer size.
It's weird My program doen't work if I set the receive buffer size.
I don't know which is necessary, and which is not. Because the program always works well on my own computer even I didn't
do the above changes. And I can't debug it one by one on another computer. Anyway, such a problem should be resolved
according the above suggestions.
Shijun
帖子被Shijun在
12-16-2007 11:11 PM时编辑过了