Recent

Author Topic: Where is documentation about serial AKA RS232  (Read 2154 times)

kensmith

  • New Member
  • *
  • Posts: 15
Where is documentation about serial AKA RS232
« on: January 24, 2022, 06:57:23 pm »
I need to use an RS232 port and do stuff with it.
Searching I find web pages that say things like

TLazSerial which doesn't seem to be the thing I want.
It seems to be based on a lower level thing that is likely closer to what I need.

I also found:
"Another serial unit is part of FreePascal since version 2.2.2: just put 'Serial' in the Uses list. However there does not seem to be any documentation other than the Serial.pp source file and some discussions."
I can't find that source file

I need to be able to send and receive and set the handshake lines high and low and detect the handshake inputs.    My main problem is that I can't find documentation or the source code for the actual units in question.

Any pointers?


Thaddy

  • Hero Member
  • *****
  • Posts: 14205
  • Probably until I exterminate Putin.
Re: Where is documentation about serial AKA RS232
« Reply #1 on: January 24, 2022, 07:13:42 pm »
There is an example in the wiki:
https://wiki.lazarus.freepascal.org/index.php/Hardware_Access

Are you running rs232 over USB? In that case the port numbers may be much higher, like COM12 instead of COM1.
Specialize a type, not a var.

MarkMLl

  • Hero Member
  • *****
  • Posts: 6676
Re: Where is documentation about serial AKA RS232
« Reply #2 on: January 24, 2022, 07:30:04 pm »
"Another serial unit is part of FreePascal since version 2.2.2: just put 'Serial' in the Uses list. However there does not seem to be any documentation other than the Serial.pp source file and some discussions."
I can't find that source file

It's in the RTL source tree. I was the last person to do maintenance on it, and use it heavily.

MarkMLl
MT+86 & Turbo Pascal v1 on CCP/M-86, multitasking with LAN & graphics in 128Kb.
Pet hate: people who boast about the size and sophistication of their computer.
GitHub repositories: https://github.com/MarkMLl?tab=repositories

winni

  • Hero Member
  • *****
  • Posts: 3197
Re: Where is documentation about serial AKA RS232
« Reply #3 on: January 24, 2022, 07:46:20 pm »

I can't find that source file


Hi

Get used to Lazarus.

Add Serial in the uses section.

Place the cursor on Serial

Type Alt-CursorUp

There you are.

Winni

MarkMLl

  • Hero Member
  • *****
  • Posts: 6676
Re: Where is documentation about serial AKA RS232
« Reply #4 on: January 24, 2022, 07:55:33 pm »
Thanks for that reminder Winni... even I use Lazarus as an IDE most of the time rather than vi and make.

One reason I was being cautious was that OP doesn't say what OS he's running, and I really don't want to guess where the RTL has ended up for (in particular) Windows.

The file itself is serial.pp, there's one version for unix (Linux/SunOS) and another for Windows. It's intentionally low-level, i.e. as near the OS as possible, and benefits from a good understanding of threads etc... I think I needed to monitor multiple ports and capture accurate timing when I worked on it.

MarkMLl
MT+86 & Turbo Pascal v1 on CCP/M-86, multitasking with LAN & graphics in 128Kb.
Pet hate: people who boast about the size and sophistication of their computer.
GitHub repositories: https://github.com/MarkMLl?tab=repositories

kensmith

  • New Member
  • *
  • Posts: 15
Re: Where is documentation about serial AKA RS232
« Reply #5 on: January 25, 2022, 07:29:54 pm »
There is an example in the wiki:
https://wiki.lazarus.freepascal.org/index.php/Hardware_Access

Are you running rs232 over USB? In that case the port numbers may be much higher, like COM12 instead of COM1.

This is going to be something that adapts to Windows or Linux.
The RS232 may or may not be via USB.
The idea is to make a thing that replaces some MSDOS stuff that is still in use.
This will be my 3rd lazarus program.  The first two have gone very nicely.  :)

kensmith

  • New Member
  • *
  • Posts: 15
Re: Where is documentation about serial AKA RS232[solved]
« Reply #6 on: January 25, 2022, 07:38:08 pm »
Get used to Lazarus.
That is going to take me some time.
Quote
Add Serial in the uses section.
This part I knew.
I started using Borland's Turbo Pascal at version 3.
I still have the manuals for version 5.5
Quote
Place the cursor on Serial

Type Alt-CursorUp
This was the part I didn't know

Quote
There you are.
Winni
Thanks ever so much   :) :) :) :) :) :)
« Last Edit: April 12, 2022, 01:07:01 am by kensmith »

winni

  • Hero Member
  • *****
  • Posts: 3197
Re: Where is documentation about serial AKA RS232
« Reply #7 on: January 25, 2022, 07:53:57 pm »
Hi!

A page about the Lazarus IDE Tools starting with the shortcuts.

https://wiki.freepascal.org/Lazarus_IDE_Tools

Winni

 

TinyPortal © 2005-2018