Recent

Author Topic: New to fpc, want to use serial unit on macOS  (Read 4465 times)

octetta

  • Newbie
  • Posts: 4
    • Octetta
New to fpc, want to use serial unit on macOS
« on: February 24, 2018, 05:33:31 pm »
Hello all,

I'm just getting started with fpc and wanted to use the "built-in" serial unit as mentioned in:

http://wiki.lazarus.freepascal.org/Hardware_Access#FPC_built_in_Serial_unit

...and it seems this isn't part of the 3.0.4 macOS release.

I tried to build the example code as on the link I mentioned and got the following message:

st.pas(11,6) Fatal: Can't find unit serial used by TestSerialPortCom

Is this an oversight? Is it possible to install the associated units?

Thanks for any pointers!

-joe

Any help is greatly appreciated.

Phil

  • Hero Member
  • *****
  • Posts: 2737
Re: New to fpc, want to use serial unit on macOS
« Reply #1 on: February 24, 2018, 05:43:07 pm »
Thanks for any pointers!

What were you hoping to connect? Macs don't have serial ports.

Thaddy

  • Hero Member
  • *****
  • Posts: 14159
  • Probably until I exterminate Putin.
Re: New to fpc, want to use serial unit on macOS
« Reply #2 on: February 24, 2018, 05:59:20 pm »
Thanks for any pointers!

What were you hoping to connect? Macs don't have serial ports.
Correction: Macs are perfectly capable to connect to serial interfaces. They just do not have a serial port in hardware. Conversion cables are available and the driver(s) is part of the kernel.
Specialize a type, not a var.

Phil

  • Hero Member
  • *****
  • Posts: 2737
Re: New to fpc, want to use serial unit on macOS
« Reply #3 on: February 24, 2018, 06:08:17 pm »
Thanks for any pointers!

What were you hoping to connect? Macs don't have serial ports.
Correction: Macs are perfectly capable to connect to serial interfaces. They just do not have a serial port in hardware. Conversion cables are available and the driver(s) is part of the kernel.

And yet the FPC serial unit is not included in compiled form for Mac. Hmm.

You haven't actually tested any of that, right?

octetta

  • Newbie
  • Posts: 4
    • Octetta
Re: New to fpc, want to use serial unit on macOS
« Reply #4 on: February 25, 2018, 04:09:06 am »
Thanks for any pointers!

What were you hoping to connect? Macs don't have serial ports.

Phil, although most contemporary Macs don't have exposed UARTs, I'm more interested in updating an older chunk of FPC code that used the serial unit on the Mac.

The Mac's darwin kernel has a serial library like most Unix-like systems and I can happily write C, Lua, Python, etc code that accesses these functions to access a serial port connected via USB.

Having said that, can you offer any useful suggestions on where the serial unit may have gone in later releases of FPC for macOS?

Phil

  • Hero Member
  • *****
  • Posts: 2737
Re: New to fpc, want to use serial unit on macOS
« Reply #5 on: February 25, 2018, 04:13:45 am »
Having said that, can you offer any useful suggestions on where the serial unit may have gone in later releases of FPC for macOS?

No idea, but it compiles fine (serial.pp), so go ahead and test it.

octetta

  • Newbie
  • Posts: 4
    • Octetta
Re: New to fpc, want to use serial unit on macOS
« Reply #6 on: February 25, 2018, 07:02:56 am »
Having said that, can you offer any useful suggestions on where the serial unit may have gone in later releases of FPC for macOS?

No idea, but it compiles fine (serial.pp), so go ahead and test it.

Where is serial.pp? I don't see it anywhere in the 3.0.4 distribution for Lazarus/fpc I pulled from SourceForge.

I'm a Lazarus/fpc noobie. Looking for some constructive help if it's available here.

Thanks!

-joe

Thaddy

  • Hero Member
  • *****
  • Posts: 14159
  • Probably until I exterminate Putin.
Re: New to fpc, want to use serial unit on macOS
« Reply #7 on: February 25, 2018, 10:49:00 am »
And yet the FPC serial unit is not included in compiled form for Mac. Hmm.

You haven't actually tested any of that, right?

Of course I have (with - modified - synaser) and an interface similar to this http://www.planet-rcs.de/article/mac_serial_port/
It is controlling some medical hardware in production. It should even work without the mods, I believe.

The driver is here http://www.prolific.com.tw/US/ShowProduct.aspx?p_id=229&pcid=41
Note the remarks on the wbsite, though.
« Last Edit: February 25, 2018, 11:01:39 am by Thaddy »
Specialize a type, not a var.

Phil

  • Hero Member
  • *****
  • Posts: 2737
Re: New to fpc, want to use serial unit on macOS
« Reply #8 on: February 25, 2018, 02:45:51 pm »
Having said that, can you offer any useful suggestions on where the serial unit may have gone in later releases of FPC for macOS?

No idea, but it compiles fine (serial.pp), so go ahead and test it.

Where is serial.pp? I don't see it anywhere in the 3.0.4 distribution for Lazarus/fpc I pulled from SourceForge.

I'm a Lazarus/fpc noobie. Looking for some constructive help if it's available here.

Just search for it:

mdfind -name serial.pp

It's probably here:

/usr/local/share/fpcsrc/packages/rtl-extra/src/unix/serial.pp



octetta

  • Newbie
  • Posts: 4
    • Octetta
Re: New to fpc, want to use serial unit on macOS
« Reply #9 on: February 25, 2018, 05:01:11 pm »
Having said that, can you offer any useful suggestions on where the serial unit may have gone in later releases of FPC for macOS?

No idea, but it compiles fine (serial.pp), so go ahead and test it.

Where is serial.pp? I don't see it anywhere in the 3.0.4 distribution for Lazarus/fpc I pulled from SourceForge.

I'm a Lazarus/fpc noobie. Looking for some constructive help if it's available here.

Just search for it:

mdfind -name serial.pp

It's probably here:

/usr/local/share/fpcsrc/packages/rtl-extra/src/unix/serial.pp

Awesome and thanks Phil! Going off to see how/if I can make this stuff work.

-joe

 

TinyPortal © 2005-2018