[fpc-pascal] Using Serial in a TCP/RS232 gateway, how to set buffer sizes?

Marc Santhoff M.Santhoff at web.de
Thu Sep 7 19:39:02 CEST 2017

On Do, 2017-09-07 at 13:32 +0200, Bo Berglund wrote:
> On Wed, 06 Sep 2017 23:21:17 +0200, Marc Santhoff
> <M.Santhoff at web.de> wrote:
> >Could that be some sort of timeout?
> >
> >You're setting
> >
> >  FTcpComm.ReadTimeout := 30;
> >
> >but I have no idea what order of magnitude this 30 is. Maybe streching
> >the timeout a little bit can help?
> >
> >I had several cases of timeout problems using RS232 over TCP.
> No, the Tcp/IP part is not involved at all here. When the transfer to
> the server starts there is no response expected until all data have
> been transferred.
> The problem is that the Win7 application sends RS232 data out a serial
> port and another application (my relayer) is using another serial port
> which is connected by wire to the first serial port.
> This relaying application seems to lose incoming data, which are sent
> at a speed of 38400 baud.
> Before the data arrives to the TCP/IP part they have been corrupted.

What structure does the Windows side have, ist your application running
on the same machine as the remote control program for the data system or
is there a second computer attached using cables?

> The test on location proves that the case where the relayer is not
> involved (wire goes from Win7 application directly to the data system)
> is working fine.
> But I cannot use that because I am in Sweden and the data system is in
> Texas...

The most important part is to see where exactly data is vanishing. Which
I don't at the moment. There is only one small part of the transmission
path involved, running from the RS232 out of the windows app to the
relaying app, as I understand. And this only happens in the direction
from the win app to the remote system. Did I get that right?

Marc Santhoff <M.Santhoff at web.de>

More information about the fpc-pascal mailing list