Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2016-07

Transfer between RS232 and TCP/IP

14 messages · 5 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Bo Berglund

I have an application which talks to a data collection system via serial comm (RS232).

Now the instrumentation has switched to WiFi instead and I need to somehow make a "go-between" program that can channel data between a TCP port on the WiFi network and a regular serial port (on Windows) which the existing application can use.

The data into and out of the TCP port is exactly the same as the data previously trasnferred via RS232, in fact behind the scenes on the instrument there is still the serial channel but it s now hooked to WiFi.

Is there something in Lazarus/Fpc I can use to create such a glue program?

Bo Berglund Developer in Sweden

Reply by email

Unknown author
to Bo Berglund

this is a easy task

you can simple use my uuart component (
http://corpsman.de/index.php?doc=komponenten/uuart )

within the code there is a wrapper, that can handle TCP connections and Serial Connections ( the example program does this for modbus ).

All you have to do, is download Synapse (to support the RS232 Connection) and Download LNet to support the TCP Socket Connection ;)

Corpsman

Bo Berglund wrote 17 lines
I have an application which talks to a data collection system via serial comm (RS232). Now the instrumentation has switched to WiFi instead and I need to somehow make a "go-between" program that can channel data between a TCP port on the WiFi network and a regular serial port (on Windows) which the existing application can use. The data into and out of the TCP port is exactly the same as the data previously trasnferred via RS232, in fact behind the scenes on the instrument there is still the serial channel but it s now hooked to WiFi. Is there something in Lazarus/Fpc I can use to create such a glue program?

Reply by email

Unknown author
to Bo Berglund: I have an application which talks to a data collection system via serial comm (RS232).…
Bo Berglund wrote
Is there something in Lazarus/Fpc I can use to create such a glue program?

i suppose there is but why reinvent the wheel? we, in the old school BBS world, have had these things for years... consider writing a BBS or a game for a BBS... the fidonet guys developed for different platforms... those platforms had different serial hardware and comms methods... think DEC, PDP, Apple //c, commodore, IBM PCes and clones... the fidonet guys came up with the FOSSIL standard... the FOSSIL driver sits between the serial port and the software... this way the BBS and game writers can worry about their software and not get bogged down with having to learn serial comms for numerous platforms... there's a FOSSIL for this hardware and a FOSSIL for that hardware but the software doesn't care about the hardware as it only talks to the FOSSIL driver and the (what is now known as an) API is the same on the software side of the fence... what the FOSSIL driver talks to on the other side can be anything... it could be serial hardware, parallel hardware, TCP port or even something like wrapping the data within a telnet connection...

so FOSSIL... when OS/2 Warp Connect came out, there was a FOSSIL developed specifically to allow BBSes to ride on virtual serial ports... those virtual serial ports were one end of a telnet tunnel... now we had telnet capable BBSes using traditional BBS software like Maximus, Remote Access, QuickBBS and others that spoke FOSSIL... winwhatever came on stronger and many sysops went to winwhatever... it took a long time for any good virtual modem stuffs to come out... at least one developer for the winwhatever platform went a step further than others and has a network-to-virtual-serial-port driver known as NETSERIAL... this allows software that doesn't speak FOSSIL to ride on a virtual serial port... i don't remember if NETSERIAL is just a virtual serial port or if it also emulates a modem... he also has NETFOSS for a FOSSIL version...

i think NETSERIAL may be what you are after if you are running on a winwhatever NT-derived platform...

NOTE: No off-list assistance is given without prior approval. *Please keep mailing list traffic on the list* unless private contact is specifically requested and granted.

Reply by email

Koenraad Lelong
to Bo Berglund: I have an application which talks to a data collection system via serial comm (RS232).…

Op 22-07-16 om 18:34 schreef Bo Berglund:

Show quoted text 16 lines
I have an application which talks to a data collection system via serial comm (RS232). Now the instrumentation has switched to WiFi instead and I need to somehow make a "go-between" program that can channel data between a TCP port on the WiFi network and a regular serial port (on Windows) which the existing application can use. The data into and out of the TCP port is exactly the same as the data previously trasnferred via RS232, in fact behind the scenes on the instrument there is still the serial channel but it s now hooked to WiFi. Is there something in Lazarus/Fpc I can use to create such a glue program?

Hi Bo,

Maybe you can have has nothing to do with fpc or
lazarus, but could do what you want.

Koenraad.

Reply by email

Graeme Geldenhuys
to Unknown author: i suppose there is but why reinvent the wheel? we, in the old school BBS world, have had…
so FOSSIL... when OS/2 Warp Connect came out, there was a FOSSIL developed specifically to allow BBSes to ride on virtual serial ports... those virtual serial ports were one end of a telnet tunnel... now we had telnet capable BBSes using traditional BBS software like Maximus, Remote Access

Ah, all the good memories come flooding back. :-) I still have my various BBS setups archived somewhere on my hard drive.

Regards,
Graeme

Reply by email

Bo Berglund
to Koenraad Lelong: Op 22-07-16 om 18:34 schreef Bo Berglund: Maybe you can have has nothing to do with fpc…
Koenraad Lelong wrote
Maybe you can have has nothing to do with fpc or lazarus, but could do what you want.

Well,
I googled socat and got to totally overwhelmingly large pages with a zillion of possible arguments listed but no simple example like I am after.
And it seems like it is Linux centric, but my existing application is on Windows7...

Bo Berglund Developer in Sweden

Reply by email

Bo Berglund
to Bo Berglund: I have an application which talks to a data collection system via serial comm (RS232).…

On Fri, 22 Jul 2016 18:34:11 +0200, Bo Berglund
wrote:

I might add that I have already created a TCP to TCP mapping utility using the Indy10 component TMapTcpComm.
I use this in order to connect to a WiFi network via the Ethernet line from out of reach of the WiFi AP. A Raspberry Pi runs my MapPort program so I can access the WiFi device from my PC at thousands of km away by connecting to the RPi and let it forward to the WiFi device.

Now I want to make a similar thing, namely to do a RS232 to TCP mapping utility. But this time I want it to run on Windows rather than Linux.

Bo Berglund Developer in Sweden

Reply by email

Dimitrios Chr. Ioannidis
to Bo Berglund: I have an application which talks to a data collection system via serial comm (RS232).…
Bo Berglund wrote 15 lines
I have an application which talks to a data collection system via serial comm (RS232). Now the instrumentation has switched to WiFi instead and I need to somehow make a "go-between" program that can channel data between a TCP port on the WiFi network and a regular serial port (on Windows) which the existing application can use. The data into and out of the TCP port is exactly the same as the data previously trasnferred via RS232, in fact behind the scenes on the instrument there is still the serial channel but it s now hooked to WiFi. Is there something in Lazarus/Fpc I can use to create such a glue program?

Hi,

you can use IdMappedPortTCP from Indy 10 .

regards,

Dimitrios Chr. Ioannidis

Reply by email

Dimitrios Chr. Ioannidis
to Bo Berglund: On Fri, 22 Jul 2016 18:34:11 +0200, Bo Berglund I might add that I have already created a…
Bo Berglund wrote 13 lines
On Fri, 22 Jul 2016 18:34:11 +0200, Bo Berglund wrote: I might add that I have already created a TCP to TCP mapping utility using the Indy10 component TMapTcpComm. I use this in order to connect to a WiFi network via the Ethernet line from out of reach of the WiFi AP. A Raspberry Pi runs my MapPort program so I can access the WiFi device from my PC at thousands of km away by connecting to the RPi and let it forward to the WiFi device. Now I want to make a similar thing, namely to do a RS232 to TCP mapping utility. But this time I want it to run on Windows rather than Linux.

Ha ha, you posted 2 minutes earlier ....

regards,

Dimitrios Chr. Ioannidis

Reply by email

Dimitrios Chr. Ioannidis
to Bo Berglund: I have an application which talks to a data collection system via serial comm (RS232).…
Bo Berglund wrote 15 lines
I have an application which talks to a data collection system via serial comm (RS232). Now the instrumentation has switched to WiFi instead and I need to somehow make a "go-between" program that can channel data between a TCP port on the WiFi network and a regular serial port (on Windows) which the existing application can use. The data into and out of the TCP port is exactly the same as the data previously trasnferred via RS232, in fact behind the scenes on the instrument there is still the serial channel but it s now hooked to WiFi. Is there something in Lazarus/Fpc I can use to create such a glue program?

I used ser2net on debian wheezy to control a serial device connected to that box a while go.

You can try it ...

regards,

Dimitrios Chr. Ioannidis

Reply by email

Dimitrios Chr. Ioannidis
to Bo Berglund: On Fri, 22 Jul 2016 18:34:11 +0200, Bo Berglund I might add that I have already created a…
Bo Berglund wrote
Now I want to make a similar thing, namely to do a RS232 to TCP mapping utility. But this time I want it to run on Windows rather than Linux.

Ok, it's late and didn't read all your posts ....

For windows try

com2tcp

https://sourceforge.net/projects/com0com/files/com2tcp/1.3.0.0/com2tcp-1.3.0.0-386.zip/download

example : com2tcp --ignore-dsr \\.\COM25 192.168.50.66 3006

Reply by email

Dimitrios Chr. Ioannidis
to Dimitrios Chr. Ioannidis
Dimitrios Chr. Ioannidis wrote 15 lines
On 23/7/2016 2:05 πμ, Bo Berglund wrote: > Now I want to make a similar thing, namely to do a RS232 to TCP > mapping utility. But this time I want it to run on Windows rather than > Linux. Ok, it's late and didn't read all your posts .... For windows try com2tcp https://sourceforge.net/projects/com0com/files/com2tcp/1.3.0.0/com2tcp-1.3.0.0-386.zip/download example : com2tcp --ignore-dsr \\.\COM25 192.168.50.66 3006

Forgot that you need to map / create first the com25 with the com0com so :

https://sourceforge.net/projects/com0com/files/com0com/2.2.2.0/com0com-2.2.2.0-i386-fre.zip/download

example : com0com pair com3 - com25

and then run the com2tcp ...

It used to work on XP don't know for windows 7 ....

regards,

Dimitrios Chr. Ioannidis

Reply by email

Unknown author
to Graeme Geldenhuys: Ah, all the good memories come flooding back. :-) I still have my various BBS setups…
Graeme Geldenhuys wrote 8 lines
On 2016-07-22 19:06, wrote: > so FOSSIL... when OS/2 Warp Connect came out, there was a FOSSIL developed > specifically to allow BBSes to ride on virtual serial ports... those virtual > serial ports were one end of a telnet tunnel... now we had telnet capable BBSes > using traditional BBS software like Maximus, Remote Access Ah, all the good memories come flooding back. :-) I still have my various BBS setups archived somewhere on my hard drive.

hehehe... i'm still living those memories, brother... RA/FD/FE on eCS, mystic on vista, mystic on linux, synchronet on linux and then there's the several sysop editors, mail tossers, and mailers for several fidonet point systems :)

/OT

NOTE: No off-list assistance is given without prior approval. *Please keep mailing list traffic on the list* unless private contact is specifically requested and granted.

Reply by email

Bo Berglund
to Dimitrios Chr. Ioannidis: I used ser2net on debian wheezy to control a serial device connected to that box a while…
"Dimitrios Chr. Ioannidis" wrote 21 lines
On 22/7/2016 7:34 ??, Bo Berglund wrote: > I have an application which talks to a data collection system via > serial comm (RS232). > > Now the instrumentation has switched to WiFi instead and I need to > somehow make a "go-between" program that can channel data between a > TCP port on the WiFi network and a regular serial port (on Windows) > which the existing application can use. > > The data into and out of the TCP port is exactly the same as the data > previously trasnferred via RS232, in fact behind the scenes on the > instrument there is still the serial channel but it s now hooked to > WiFi. > > Is there something in Lazarus/Fpc I can use to create such a glue > program? I used ser2net on debian wheezy to control a serial device connected to that box a while go. You can try it ...

The problem is opposite.
I have a windows application which only understands RS232 and a device that used to be RS232 but now instead has a WiFi access point to connect to whereafter the same data stream is available via a TCP port on the device.
Cannot change the application so I need a utility that can channel binary data between the TCP port and a regular com port. Of course not having to bridge two regular hardware ports in order to do this (using a virual com port) would be good but not necessary.

Furthermore after checking out the suggestions posted I really would like to have more control, i.e. I want a source solution for Delphi or Lazarus (prefer Lazarus) on Windows.

Bo Berglund Developer in Sweden

Reply by email