Jump to content
spaghetti_developer

Strange error using serial porta with visa drivers

Recommended Posts

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?

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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. :throwpc:

It don't make any sense, but This is my experience.

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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. :thumbup1:

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.

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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. frusty.gif

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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 by ShaunR

Share this post


Link to post
Share on other sites

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 :book: case

If anyone have things to improve please let me know.

This only works on serial interfaces.

RS232.vi

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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 book.gif 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.

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.