mingyuexin1984 发表于 2009-10-14 15:54:44

VISA读取—framing error解决办法

在利用VISA读取时发生错误:
Error -1073807253 “A framing error occurred during transfer. ”

解决办法之一是在VISA Configure Serial Port 之后加10至100ms的延时
详见:http://digital.ni.com/public.nsf/websearch/F3E0621CB71AA16786256F970000FC57?OpenDocument

cpubbs 发表于 2009-10-15 00:03:28

好东西,我贴过来!
原地址:http://digital.ni.com/public.nsf/websearch/F3E0621CB71AA16786256F970000FC57?OpenDocument


Error Code -1073807253 When Using VISA Read
Primary Software: LabVIEW Development Systems>>LabVIEW Full Development System
Primary Software Version: 1.0
Primary Software Fixed Version: N/A
Secondary Software: N/A
http://digital.ni.com/images/global/us/invis.gif
Problem:
I am outputting a sequence of characters from a third party device every 160ms and reading it serially using a VISA read. The device will continuously output the data whether the program is on or off. However, I get a framing Error -1073807253 when reading. Why?

Solution:
The fact that the hardware is emitting data every 160ms whether or not the program is running is the reason for the error. The port is probably not configured by the time it receives the first character so it reads a buffer with invalid information. By putting a delay (approximately 10-100 ms) after the VISA Configure Serial Port you allow the serial port enough time to configure itself. Then, by using a VISA Flush I/O Buffer VI, you can clear any invalid data in the buffer. Reading after this sequence should work correctly.

Your block diagram should appear as shown below:
http://digital.natinst.com/public.nsf/$CXIV/ATTACH-AEEE-7WMLNC/$FILE/VISA%20Error.png

cpubbs 发表于 2009-10-15 00:04:29

多谢兄弟共享!
页: [1]
查看完整版本: VISA读取—framing error解决办法