Serial Port Timing

  • Thread starter Thread starter Steve J
  • Start date Start date
S

Steve J

I have an application that is flawed in that it has a fixed time period (30
seconds) to transfer a file over an RS-232 port at a pre-determined baud
rate (19,200). This was never identified as a problem with Win2K, but with
certain computers (namely laptops) running WinXP, the file transfer time
will exceed the fixed time period consistently, causing the transfer to fail
due to an application timeout. The funny thing is that I can work around
this problem by plugging in a USB device; just about any USB device (jump
drive, mouse, PDA, etc.) will do. A file that will transfer in 28 seconds
with a USB device plugged in will be about 2 seconds short of transferring
(32 seconds estimated time) when the device is unplugged.

What causes this deviation? Are there other scenarios (different
hardware/software configurations) that might be worse? Whay don't I see the
same thing with Win2K? Any suggestions on a workaround for this problem
(other than leave the device plugged in)?

Thanks.
 
Steve said:
I have an application that is flawed in that it has a fixed time period (30
seconds) to transfer a file over an RS-232 port at a pre-determined baud
rate (19,200). This was never identified as a problem with Win2K, but with
certain computers (namely laptops) running WinXP, the file transfer time
will exceed the fixed time period consistently, causing the transfer to fail
due to an application timeout. The funny thing is that I can work around
this problem by plugging in a USB device; just about any USB device (jump
drive, mouse, PDA, etc.) will do. A file that will transfer in 28 seconds
with a USB device plugged in will be about 2 seconds short of transferring
(32 seconds estimated time) when the device is unplugged.

What causes this deviation? Are there other scenarios (different
hardware/software configurations) that might be worse? Whay don't I see the
same thing with Win2K? Any suggestions on a workaround for this problem
(other than leave the device plugged in)?

Thanks.

Maybe if something more is known about the laptop, someone might
be able to come up with an idea for the discrepancty. One thing
to keep in mind that baud rates and timings are governed by the
computer clock and the tolerance is plus/minus 10%.
 
The same thing happens on multiple brands of laptops, but I haven't been
able to duplicate on any WinXP desktops. I didn't mention that the
application is a DOS application that is executed with normal priority.
 
Interesting, of course many brands may have the same chipset on board so
that could be relevant. USB is a derivative of the normal serial port system
so I suspect there is some common hardware involved here, and maybe the need
to save space with laptops has introduced some conflicts that result in one
or two lost RS232 packets so that some have to be re-sent.

IOW maybe adding the USB device causes some timing function to be made
faster, or even perhaps slower reducing packet loss.

How far is one machine from the other, how good is the cable and is this
"Sending" function part of a larger program or could you simply use
something else to send files?

In my experience 19,200 can be a "Funny" baud rate, it's high enough that
cable faults can be a big problem, as can electrical interference. Having
shielded cable that's grounded at both ends can cause hum loops, often the
shield should only be connected at one end. Desktops are usually grounded,
laptops by their nature are not. If the shield is intended to be grounded at
the computer end then you may be losing shielding and losing packets (which
then have to be re-sent) simply
because it's a "Laptop", brand immaterial.

I've done a bit with GE, Fagor and other CNC machines in a factory (Noisy)
electrical environment and cabling can play a major role, and of course when
doing diagnostics the cable is often the one thing that's inaccessible or
difficult to "Swap out" for testing.

I actually wrote a MS BASIC V7.0 communications program for testing / file
transfer some years back and you'd be surprised what crap bad cables can
cause :)

Not sure if this would help or not but you might try setting up a desktop
and connect the LAN port on both desktop and laptop, which might "Ground"
the laptop and alter the symptoms, if it does than the USB issue might
simply be a red herring, covering the real problem that would likely be
cabling. If the same connectors simply swap ends with the cable might work
also.

I apologize in advance if this is completely off the mark but it does sound
like some issues I've had that result in a slap on the forehead when you
finally pin them down :)

Charlie
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top