Recent

Author Topic: TCP to RS232 converter with Lazarus?  (Read 11223 times)

Jurassic Pork

  • Hero Member
  • *****
  • Posts: 1290
Re: TCP to RS232 converter with Lazarus?
« Reply #15 on: March 04, 2016, 01:32:50 am »
hello,
for tcp server, you can have a look to the nxnetworktest project (which uses synapse) from nxpascal project :
1 - download last synapse stable version  and install lazarus synapse package (laz_synapse).
2 - from here download zip . Extract nxnetworktest (demos/fpc/nxnetworktest)
3 - add nxnetwork.pas (src/nxnetwork.pas ) in the folder
4 - add nxnetwork.pas to the project and laz_synapse as required package
5 - if you are under linux add -dUseCThreads to compiler options.

Friendly, J.P


« Last Edit: March 04, 2016, 01:34:40 am by Jurassic Pork »
Jurassic computer : Sinclair ZX81 - Zilog Z80A à 3,25 MHz - RAM 1 Ko - ROM 8 Ko

Jurassic Pork

  • Hero Member
  • *****
  • Posts: 1290
Re: TCP to RS232 converter with Lazarus?
« Reply #16 on: March 04, 2016, 02:58:35 am »
using a TLazserial component in the Networktest project i can do this :
 listen the comport /dev/ttyUSB1 receiving GPS RMC NMEA frames .
when i have received a whole frame, send the frame to the TCP server.

Friendly, J.P
Jurassic computer : Sinclair ZX81 - Zilog Z80A à 3,25 MHz - RAM 1 Ko - ROM 8 Ko

mig-31

  • Sr. Member
  • ****
  • Posts: 308
Re: TCP to RS232 converter with Lazarus?
« Reply #17 on: March 04, 2016, 09:45:51 am »
@BosseB

Do it how to explain it Jurassic Pork.

1. Install lazarus Synapse package(library).
2. To establish connection and read data from serial device (RS232,RS485/422) use Synaser from Synapse (there is a example on wiki how to use it on Linux http://wiki.lazarus.freepascal.org/Hardware_Access) or TLazSerial.
3. Create a TCP/IP server using Synapse (you can found example(demo) in the package directory) or LNet (example of TCP/IP server also in package directory).
4. Share data from serial device to TCP/IP server inside you application.

It is really simple nothing hard.
Lazarus 4.0 - OpenSuse Leap 15.4, Mageia 8, CentOS 7

serbod

  • Full Member
  • ***
  • Posts: 146
Re: TCP to RS232 converter with Lazarus?
« Reply #18 on: March 04, 2016, 01:50:57 pm »
Sorry for troubles with installing DataPort under Linux and lack of documentation.

https://github.com/serbod/dataport - updated

 

TinyPortal © 2005-2018