Jump to content

USB to Serial adapter problem


agonified

Recommended Posts

Hi again everyone,

I've got this adapter to connect a serial device to the computer. I set port in Labview so that it terminates reading when a terminating character is sent by the device. When I use onboard serial port, it works flawlessly but that USB to serial port(rs-232) adapter does not terminate even device sends a terminating character.

I first configure port to accept terminating characer and wire the output 'VISA resource name' to the write&read VI. When I use onboard port, reading is terminated immediately after device sends a terminating character. But when I use USB to serial port, it waits 'timeout' milliseconds(set during configure serial port) and then terminates without an error even if device responds correctly. If the device is not connected, it waits 'timeout' milliseconds and terminates with 'VISA: (Hex 0xBFFF0015) Timeout expired before operation completed' error. What the heck is happening here guys? How can I correct this? Did it happed to you before? That would be great if you could look at the code attached.

I will actually connect two devices but my motherboard has only one port. That's why I need that secondary port. One other solution might be converting onboard serial port to rs-485 protocol with a converter such as this one and connect devices with a single port for daisy-chain communication style which my devices already support. My question about that issue is will that converter work in the way I want? Does it really converts protocol to rs-485 or should I obtain a PCI rs-485 port?

Any help is greatly appreciated,

Hakan

Link to comment

Hi Hakan

Try moving the "VISA Flush IO Buffer" so it happens before you perform the the "VISA write".

What might be happening is that you flush the expected result before trying to read it.

Timing issues could explain the differenence between how the code performs on the internal and external RS232 port.

-Mikkel :)

Link to comment

QUOTE(Mikkel @ Aug 8 2007, 06:44 AM)

Hi Hakan

Try moving the "VISA Flush IO Buffer" so it happens before you perform the the "VISA write".

What might be happening is that you flush the expected result before trying to read it.

Timing issues could explain the differenence between how the code performs on the internal and external RS232 port.

-Mikkel :)

I just noticed this Mikkel thanks for pointing out. I feel so noob. :) However, I am pretty sure that problem is not flushing out the buffer cause at the end of the serial cable, there is another computer which is showing me hyperterminal right now. I can't respond in few milliseconds right? :) Thanks a lot though. It was such a big foolish design mistake...

Link to comment

QUOTE(agonified @ Aug 8 2007, 08:21 AM)

I've got this adapter to connect a serial device to the computer. I set port in Labview so that it terminates reading when a terminating character is sent by the device. When I use onboard serial port, it works flawlessly but that USB to serial port(rs-232) adapter does not terminate even device sends a terminating character..........Any help is greatly appreciated,Hakan

In my experience the Belkin F5U409 USB to serial adapters can be a huge time waster. The F5U409 is very simiilar to the F5U109. Their drivers are unstable and don't work under XP despite claims to the contrary. and it certainly won't work under 64bit Vista (unlike NI and Keyspan devices). I've had a Belkin simply lock up an XP PC just by plugging it in. Under W2K there have been several cases of the Belkin driver causing a <script>BSOD.

For a while I was pursuing the option of using some well respected brands of USB-serial converters such as Keyspan and National Instruments. Those devices are certainly better designed (hardware and software wise) and more thoroughly supported than the Belkin brand, however there are shortcomings of even those devices which have been well documented here by Keyspan and here by NI. Not all aspects of the RS-232 protocol are implemented in the USB drivers. At least NI and Keyspan are honest enough to tell you that.

Some of our applications at work require low latency serial communications, something which the USB-serial devices aren't able to achieve. The amount of time (i.e. $) required to validate the operation of Keyspan and NI USB-serial adapters for use with all applications we currently use the adapters for (w.r.t latency, timing and synchronisation), would be better spent on purchasing a more adequate solution, that by design will perform as good as a standard serial port.

It was for this reason that we purchased dedicated Serial cards for our testing to provide additional COM ports on the desktop PCs. For a laptop, I'd recomend buying serial ports that plug into the expansion slot (Cardbus, PCMCIA, eXpressCard etc whatever bus you have [1]) . This way you get a dedicated UART per COM port, so you are NOT at the mercy of a poorly written USB device driver running under a jittery operating system coupled with the additional latency of being routed through an on-board USB hub. If for whatever reason you must go with a USB to serial converter I did all the reasearch and can only recomend two brands. Either NI, or Keyspan. Do youself a favour spend the extra couple of hundred $ and save yourself many times that when it works first time ! I've been there and done that enough times to know better !!

regards

Peter

[1] The Solution - use the laptop's extension port to add more serial ports. So how do you directly access the bus on a laptop? Laptops allow you to access their bus via one of the three following extension card ports (depending on the age of the laptop)

  1. PCMCIA port (aka PC Card). This is the oldest technology, and is equivalent to the old ISA ports on desktop PCs. The bus speed is more than adequate for supporting an additional 2 to 4 serial ports via a PCMCIA serial card
  2. CardBus port. This is equivalent to the PCI extension sockets on desktop PCs
  3. ExpressCard. This option is now available on the latest laptops and is equivalent to the PCI Express extension sockets on desktop PCs.

You can plug 1 into 2 (you can't however plug 2 into 1). You also can't plug 1 or 2 into 3. This means that we will need to purchase one of two possible types of serial cards for our laptops (when needed of course). Either a PCMCIA serial card, or an ExpressCard serial card. <script> A decent brand 2 port PCMCIA serial card costs between A$350-$500. In comparison, a decent brand 2 port USB-serial adapter costs between $160 and $500.

Link to comment

Another vote against USB based serial ports---

Had an application with serial I/O to a motion controller which ran most of the time on a USB-serial port (can't recall the brand). It would mysteriously crash on timing errors every now and then. Previously same application had run pretty reliably on a NI PCMCIA serial card in my laptop.

I had my client buy a new computer with built in serial port, and things were all light and happiness again. Far cheaper for them to buy a new computer than to pay me to beat my head on the wall over the old one-- Even taking the optimistic assumption I could have eventually got the USB-serial port to work.

Louis

Link to comment

Join the conversation

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

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
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.