spaghetti_developer Posted August 24, 2009 Report Share Posted August 24, 2009 Hi All, I built a software that comunicate wiht electronic system by visa drivers: it work good if I use it with rs232-usb converter but, work bad if I use it direct with the rs232 pc port. Can anyone tell me why? Quote Link to comment
Eric Desbiens Posted August 24, 2009 Report Share Posted August 24, 2009 What is the error? Can you describe your problem with more details. Normally, with VISA, you should see no difference betweew USB-RS232 and other RS-232 port. Quote Link to comment
Clio75 Posted August 24, 2009 Report Share Posted August 24, 2009 I have also seen different behavior between USB-rs232 and RS232 in the computer. I only needed to clear the error between write and read. It don't make any sense, but This is my experience. Quote Link to comment
Shaun Hayward Posted August 24, 2009 Report Share Posted August 24, 2009 I have also seen different behavior between USB-rs232 and RS232 in the computer. I've also got to agree with Clio75 - we have had a lot of issues with various USB->RS232 adaptors (as have several of my customers). Internally, we now stick to a particular chipset that we have found to be the most reliable because overall its just less headache. (in our experience has been that the FTDI based adaptors seem to be the most reliable, although I'm not saying this is going to be the same for everyone!). One more thing, for what it's worth, in a previous life, when LabVIEW was not even part of my vocabulary I we also came across similar issues with a variety of hardware/software platforms - whenever someone had a problem with a COM port, the first question was "are you using a USB adaptor?" Shaun Quote Link to comment
pallen Posted August 24, 2009 Report Share Posted August 24, 2009 Hi All, I built a software that comunicate wiht electronic system by visa drivers: it work good if I use it with rs232-usb converter but, work bad if I use it direct with the rs232 pc port. Can anyone tell me why? Hi Spaghetti, I like the name. On most computers I've used, a USB to Serial device will be issued it's own Port. So if you've already got a Serial Port on your PC, your USB to Serial device will be operating on a different one. So, the same code won't work for both. You'll need to change the port to match which one your device is plugged into. Quote Link to comment
crossrulz Posted August 24, 2009 Report Share Posted August 24, 2009 I too have had problems with USB-to-serial adapters. If I remember correctly (I'm going back a few years), the main problem was that each time the adapter was plugged in it had a different COM port or the settings were totally different. I also had to "synchronize" the VISA drivers in MAX to what Windows had occasionally. Quote Link to comment
Clio75 Posted August 25, 2009 Report Share Posted August 25, 2009 each time the adapter was plugged in it had a different COM port or the settings were totally different. This happend if you are using diffrent USB port. At least on my computer the serial port is static mapped. so If I choose USB 1 it become com3, if I use USB2 it become com5. But If you have other application that takes these port it have to assign new port to that USB. I also had to "synchronize" the VISA drivers in MAX to what Windows had occasionally. This is better in LW 8.6 at least. But not perfect. In must cases the instrument gets up without start MAX. But I tried a new instrument yesterday, and this was not found before I restarted MAX and LW. Quote Link to comment
spaghetti_developer Posted August 26, 2009 Author Report Share Posted August 26, 2009 I'm sorry to All, I forgot to wrote the error code that application return back. So, it become more difficult for yuo to help me. This is the error that return from my application: Error -1073807253 occurred at VISA Read in COM_Port_Handler.vi->Serial_CORE_Engine.vi->Main.vi Possible reason(s): VISA: (Hex 0xBFFF006B) A framing error occurred during transfer. I opened a ticket with NI and an engineer answered me that this happen becouse there are noise on the line and I loose some information on the package. But, I don't understand why this happen for normal RS232 pc port and don't happen with FTDI USB converter. I use only one line and one software. For who want to try to read the ticket, this is the address: http://forums.ni.com/ni/board/message?board.id=7170&message.id=2065 but it is in italian. For the moment I resolved the problem cleaning it. P.S. Sorry to all for my bad eanglish. Quote Link to comment
ShaunR Posted August 26, 2009 Report Share Posted August 26, 2009 (edited) I'm sorry to All, I forgot to wrote the error code that application return back. So, it become more difficult for yuo to help me. This is the error that return from my application: Error -1073807253 occurred at VISA Read in COM_Port_Handler.vi->Serial_CORE_Engine.vi->Main.vi Possible reason(s): VISA: (Hex 0xBFFF006B) A framing error occurred during transfer. I opened a ticket with NI and an engineer answered me that this happen becouse there are noise on the line and I loose some information on the package. But, I don't understand why this happen for normal RS232 pc port and don't happen with FTDI USB converter. I use only one line and one software. For who want to try to read the ticket, this is the address: http://forums.ni.com...message.id=2065 but it is in italian. For the moment I resolved the problem cleaning it. P.S. Sorry to all for my bad eanglish. This usually occurs with an incorrect baud rate or a baud rate that is not one of the "standard" ones. Edited August 26, 2009 by ShaunR Quote Link to comment
Clio75 Posted August 27, 2009 Report Share Posted August 27, 2009 Maybe you don't readout all the data from the buffer ?? Then you also can have overflow. You may need to read the serial buffer more than once before its empty. I using a while loop and the "bytes at serial port" property to be sure that it's empty. See in the case If anyone have things to improve please let me know. This only works on serial interfaces. RS232.vi Quote Link to comment
vugie Posted August 27, 2009 Report Share Posted August 27, 2009 VISA: (Hex 0xBFFF006B) A framing error occurred during transfer. Onece I had an adapter with 2 and 3 pins swapped (Rx and Tx). I'm not 100% sure but as I remember same error appeared. Quote Link to comment
Rolf Kalbermatter Posted August 27, 2009 Report Share Posted August 27, 2009 Onece I had an adapter with 2 and 3 pins swapped (Rx and Tx). I'm not 100% sure but as I remember same error appeared. It could be also a hardware error on the build in port. Doesn't happen to often but it does occur. Maybe your port got soft damage from some EMC or lightning. Rolf Kalbermatter Quote Link to comment
spaghetti_developer Posted August 27, 2009 Author Report Share Posted August 27, 2009 Maybe you don't readout all the data from the buffer ?? Then you also can have overflow. You may need to read the serial buffer more than once before its empty. I using a while loop and the "bytes at serial port" property to be sure that it's empty. See in the case If anyone have things to improve please let me know. This only works on serial interfaces. You are right, maybe I don't readout all data from the buffer. So, why does this error occurs only when I use the pc rs232 and doesn't occur when I use usb-adapter? In my code for determinate how many bytes are on the buffer I use (as you) the "byte at ports node", after I read the buffer with "serial read function" and at the end I use the "flush receive buffer" for be sure that the buffer was all read and clean. Quote Link to comment
Eric Desbiens Posted August 27, 2009 Report Share Posted August 27, 2009 You are right, maybe I don't readout all data from the buffer. So, why does this error occurs only when I use the pc rs232 and doesn't occur when I use usb-adapter? If it's a timing issue, it can vary depends on the hardware. Look at this Knowledge Base document. Quote Link to comment
spaghetti_developer Posted August 28, 2009 Author Report Share Posted August 28, 2009 If it's a timing issue, it can vary depends on the hardware. Look at this Knowledge Base document. This is the solution. Thank you very much for your help. Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.