Link to home
Start Free TrialLog in
Avatar of chrislock
chrislock

asked on

usb serial port buffer problem

Delphi 7 XP prof UC310 USB/RS232 converter

Hi

I dont think that this problem is related to Delphi as such, but the basic problem is that if I open a port whilst a continuous flow of data is being supplied to it (in this case, a weighing machine at 9600,n,7,1 - a repeated simple sequence of '  1.234  Kg CR+LF') sometimes the whole machine will reboot (I have tried two different machines, two different USB converters and two different Delphi components in my software ('comport and asyncpro').
There is a reboot due to data entering the PC  via the USB converter if the port is opened or closed whilst data is being input. This is an intermittent problem and it must be due to some kind of internal buffer overflow.
Note that this problem does not occur if the port is a standard PC serial port.
Any ideas?
Thanks.
ASKER CERTIFIED SOLUTION
Avatar of Peter Hart
Peter Hart
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of chrislock
chrislock

ASKER

Yes - I suppose your right, because the hardware on the standard serial port is not specifically controlled by the O/S and buffering can be done automatically. However, I'm surprised that a 9600 baud source causes problems!
Chris
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I've tried two different pc's and two different USB converters. Problem occurs when opening or closing port. I'm using a packet component, which also sometimes gets confused, and triggers with the data shifted slightly i.e. I'm triggering on CRLF at the end, but sometimes the string in the packet is shifted so that the spaces at the front appear after the CRLF - I've noticed this on Tcomport (free). Havent had time to look at source.
Chris
I've been using TComport for quite a while now but never seen this kind of problems. Did you check their forum at sourgeforge?
Can you reproduce this problem without the scale (write an app which simulates the scales behaviour)?
I am doing that and I will post details ASAP. Have got various other commitments at the moment!
since this is XP Pro, my guess is that there a need to stop/restart or unmount/mount the device.

Question...Is this a USB 1.0, 1.1, 2.0 emulation?
Thanks all - while I've been on holiday, the problem has resolved itself by fading out of importance and is now on the back burner, where I hope it will stay for a long time!
Chris
That's one way of 'solving' a problem :)