New to fpc, want to use serial unit on macOS lazarus / 33-macOS - Mac OS X ---------------------------------------------------------------------- octetta · 2018-02-24 16:33 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 · 2018-02-24 16:43 Quote from: octetta on February 24, 2018, 05:33:31 pmThanks for any pointers! What were you hoping to connect? Macs don't have serial ports. ---------------------------------------------------------------------- Thaddy · 2018-02-24 16:59 Quote from: Phil on February 24, 2018, 05:43:07 pmQuote from: octetta on February 24, 2018, 05:33:31 pmThanks 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. ---------------------------------------------------------------------- Phil · 2018-02-24 17:08 Quote from: Thaddy on February 24, 2018, 05:59:20 pmQuote from: Phil on February 24, 2018, 05:43:07 pmQuote from: octetta on February 24, 2018, 05:33:31 pmThanks 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 · 2018-02-25 03:09 Quote from: Phil on February 24, 2018, 05:43:07 pmQuote from: octetta on February 24, 2018, 05:33:31 pmThanks 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 · 2018-02-25 03:13 Quote from: octetta on February 25, 2018, 04:09:06 amHaving 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 · 2018-02-25 06:02 Quote from: Phil on February 25, 2018, 04:13:45 amQuote from: octetta on February 25, 2018, 04:09:06 amHaving 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 · 2018-02-25 09:49 Quote from: Phil on February 24, 2018, 06:08:17 pmAnd 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. ---------------------------------------------------------------------- Phil · 2018-02-25 13:45 Quote from: octetta on February 25, 2018, 07:02:56 amQuote from: Phil on February 25, 2018, 04:13:45 amQuote from: octetta on February 25, 2018, 04:09:06 amHaving 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 · 2018-02-25 16:01 Quote from: Phil on February 25, 2018, 02:45:51 pmQuote from: octetta on February 25, 2018, 07:02:56 amQuote from: Phil on February 25, 2018, 04:13:45 amQuote from: octetta on February 25, 2018, 04:09:06 amHaving 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