Recent

Author Topic: Serial? (SOLVED)  (Read 3241 times)

Degibbo

  • New Member
  • *
  • Posts: 46
Serial? (SOLVED)
« on: August 28, 2018, 08:51:43 am »
G'day All,
Sorry if this is the wrong place to ask:

Since upgrading to V1.8.4 & FPC 3.0.4 I have been unable to open a serial port that has been working OK for some time.  Is this a coincidence, or has the "Serial" unit changed?

A call to SerOpen('COMx') returns 0 instead of the port handle.  COMx is correct (according to the W7 device manager, where X is the COM port number).

I have tried a number of USB to Serial devices.  All return the same.  Any clues where I can look to debug what the problem is?  (with my PC?).

Cheers & thanks,
DG
« Last Edit: August 29, 2018, 03:25:04 am by Degibbo »

tetrastes

  • Sr. Member
  • ****
  • Posts: 481
Re: Serial?
« Reply #1 on: August 28, 2018, 11:29:33 am »
Did you try SerOpen('\\.\COMx') ?

Thaddy

  • Hero Member
  • *****
  • Posts: 14373
  • Sensorship about opinions does not belong here.
Re: Serial?
« Reply #2 on: August 28, 2018, 02:59:09 pm »
Try synaser directly. I have no problems here (I would have noticed..) I don't use the component.
Tested FPC with synapse 3.0.4, 3.2.0 and (atm similar) 3.3.1.
Object Pascal programmers should get rid of their "component fetish" especially with the non-visuals.

jamie

  • Hero Member
  • *****
  • Posts: 6133
Re: Serial?
« Reply #3 on: August 28, 2018, 10:18:46 pm »
can't say anything about the code you are currently using but I know opening a com port in windows 10
still works as it use to but I use my own code...

any comports over 9 need to use the '\\.\…..' in the file name, normally this also works with
values below 10..

 Also, I append the ":" at the end of the device name because the device name is like a drive letter...

 COM9:  for example..

The only true wisdom is knowing you know nothing

VTwin

  • Hero Member
  • *****
  • Posts: 1215
  • Former Turbo Pascal 3 user
Re: Serial?
« Reply #4 on: August 29, 2018, 02:29:27 am »
I'm no expert, but have been using Synaser successfully for a few years. Nothing fancy, just reading a lab recording device, and only tested under Windows XP.
« Last Edit: August 29, 2018, 02:31:57 am by VTwin »
“Talk is cheap. Show me the code.” -Linus Torvalds

Free Pascal Compiler 3.2.2
macOS 12.1: Lazarus 2.2.6 (64 bit Cocoa M1)
Ubuntu 18.04.3: Lazarus 2.2.6 (64 bit on VBox)
Windows 7 Pro SP1: Lazarus 2.2.6 (64 bit on VBox)

Degibbo

  • New Member
  • *
  • Posts: 46
Re: Serial?
« Reply #5 on: August 29, 2018, 03:23:50 am »
G'day Gentlepersons,
Thanks for the advice.  The problem was that Windas hasn't been releasing comports cleanly, just pushing up the COM number.  The problem started from COM 10 and up (thanks Jamie)  I also wondered why some code examples terminate the Comx with a : , so all good info.  I will prefix the port with the \\.\ and see how that goes for the high and low numbers.

I guess this is now solved!

Thanks.  Wonderful.
DG

 

TinyPortal © 2005-2018