* * *

Author Topic: TLazSerial : serial port component for Lazarus (windows and linux).  (Read 166082 times)

allan.brito

  • Newbie
  • Posts: 2
Re: TLazSerial : serial port component for Lazarus (windows and linux).
« Reply #225 on: March 08, 2017, 04:02:07 pm »
Hello Everybody,

I'm using LazSerial and it's very useful, but I'm getting some trouble because I want to receive 15 bytes from a barCode Scanner and I can't get it. In Java I get it because i put that I'm receiving 15 bytes. Can anyone help me in this case? Thanks in Advance.

Thaddy

  • Hero Member
  • *****
  • Posts: 6013
Re: TLazSerial : serial port component for Lazarus (windows and linux).
« Reply #226 on: March 08, 2017, 04:49:27 pm »
Well. There still isn't an overloaded function ReadData(Size) for that. It is still string instead of buffer of byte, with length... (That's why I don't use it!)
Since "//    function ReadBuffer(var buf; size: integer): integer;"  is not available....
Why? Dunno, I simply ignore LazSerial and use synaser direct. Lazserial is a bit of a hoax anyway.  It hardly adds anything useful. (I am opiniated  ;D :D,don't take that too serious )
« Last Edit: March 08, 2017, 04:54:15 pm by Thaddy »
I might not give the answer that you want me to.. Peter Green 1969

allan.brito

  • Newbie
  • Posts: 2
Re: TLazSerial : serial port component for Lazarus (windows and linux).
« Reply #227 on: March 08, 2017, 05:35:49 pm »
No problem, I'm new in this language and LazSerial had helped me so much. And Thanks everybody, I get it... I had to disable the RcvLineCRLF and worked well. Thanks.

Stan17

  • Newbie
  • Posts: 3
Re: TLazSerial : serial port component for Lazarus (windows and linux).
« Reply #228 on: April 06, 2017, 10:05:16 am »
Is it supposed to be working under Win 7 64 Lazarus 1.6.4 64?
When I am trying to install the package, I am getting notorious
"CPort.pas(28,1) Fatal: Syntax error, "identifier" expected but "TYPE" found"

Jurassic Pork

  • Hero Member
  • *****
  • Posts: 698
Re: TLazSerial : serial port component for Lazarus (windows and linux).
« Reply #229 on: April 08, 2017, 03:48:09 am »
hello,
Strange !   :-\  because cport.pas belongs to the comport library not lazserial.

Friendly, J.P

jb007

  • Jr. Member
  • **
  • Posts: 91
Re: TLazSerial : serial port component for Lazarus (windows and linux).
« Reply #230 on: August 28, 2017, 06:19:36 pm »
Still working at my RS232.

Just got aware that the first position of a char in a Lazarus string is not  [ 0 ]  but  [ 1 ]...

( have done and still do some other languages... :D...so, no wonder... )

Ocasional things went somehow 'semi-ok' but other times totaly messed-up.


Things are improving rappidly and are now stable at all!





« Last Edit: August 28, 2017, 07:36:13 pm by jb007 »
to DIY or not to DIY

jb007

  • Jr. Member
  • **
  • Posts: 91
Re: TLazSerial : serial port component for Lazarus (windows and linux).
« Reply #231 on: August 28, 2017, 07:56:37 pm »
hello,
jb007, are you using event or sequential serial port read ?
Can you put your lazarus source code in a zip file in attachment to have a look to your code ?

Friendly, J.P

Tnx.

Past time, I concentraded on learning/coding the Atmega2560 using mikroPascal AVR.

Recently started again at Lazarus RS232. ( in combination with the Arduino 2560 )

I hope to send you the code in a couple of days.

First I want to strip down the code of all unneeded code, to get a better view etc.

Kind regards!












to DIY or not to DIY

jb007

  • Jr. Member
  • **
  • Posts: 91
Re: TLazSerial : serial port component for Lazarus (windows and linux).
« Reply #232 on: September 01, 2017, 10:29:17 pm »
For you all: a good weekend!

Cheers!




to DIY or not to DIY

jlopez

  • Newbie
  • Posts: 3
Re: TLazSerial : serial port component for Lazarus (windows and linux).
« Reply #233 on: October 15, 2017, 06:38:57 am »
I am working with TLazSerial to collect data from weight indicators. I had to change the property  RcvLineCRLF: Boolean, for RcvLineTerminated: String, to use this component. There are devices that use another termination like LF, not CRLF, or EOT, or whatever. Obviusly i had to change this too:
Code: Pascal  [Select]
  1. function TLazSerial.ReadData: string;
  2. begin
  3.   result:='';
  4.   if FSynSer.Handle=INVALID_HANDLE_VALUE then
  5.     ComException('can not read from a closed port.');
  6.   if FRcvLineTerminated = EmptyStr then
  7.   result:=FSynSer.RecvPacket(0)
  8.   else
  9.   result:=FSynSer.RecvTerminated(0, FRcvLineTerminated);
  10. end;

esvignolo

  • Full Member
  • ***
  • Posts: 143
  • Using FPC in Windows, Linux, Macos
Re: TLazSerial : serial port component for Lazarus (windows and linux).
« Reply #234 on: October 17, 2017, 02:13:33 am »
Hello J.P., i make changes in your component for work in macos.

Do you want this changes?

hello,
Strange !   :-\  because cport.pas belongs to the comport library not lazserial.

Friendly, J.P
« Last Edit: October 18, 2017, 05:12:31 am by esvignolo »

bobihot

  • New member
  • *
  • Posts: 17
Re: TLazSerial : serial port component for Lazarus (windows and linux).
« Reply #235 on: January 28, 2018, 07:21:50 pm »
I need to can manually set Baud rate. With USB-TTL converter I use successfully 2Mbs speed. New frequency are whole nums, not power of 9600. Like 11,920MHz system.

Thaddy

  • Hero Member
  • *****
  • Posts: 6013
Re: TLazSerial : serial port component for Lazarus (windows and linux).
« Reply #236 on: January 28, 2018, 09:25:13 pm »
I need to can manually set Baud rate. With USB-TTL converter I use successfully 2Mbs speed. New frequency are whole nums, not power of 9600. Like 11,920MHz system.
That's a power of 745, anyway it is non-standard for rs232 comm. Synapse comes with sources. If you need exotics : build exotics. IOW adapt the sources to your needs. Some people call that programming.
« Last Edit: January 28, 2018, 09:26:47 pm by Thaddy »
I might not give the answer that you want me to.. Peter Green 1969

 

Recent

Get Lazarus at SourceForge.net. Fast, secure and Free Open Source software downloads Open Hub project report for Lazarus