Recent

Author Topic: LazSerial Synapse  (Read 447 times)

eldonfsr

  • Sr. Member
  • ****
  • Posts: 311
LazSerial Synapse
« on: September 22, 2022, 07:53:52 pm »
Is possible change buffersize on Lazarial or synapse, because i see not all message come all information from true some are broken and midle..


Jurassic Pork

  • Hero Member
  • *****
  • Posts: 1133
Re: LazSerial Synapse
« Reply #1 on: September 23, 2022, 11:32:57 am »
hello,
what is your code to receive the messages ? your messages have end termination (ex CRLF) ?
Friendly, J.P
Jurassic computer : Sinclair ZX81 - Zilog Z80A à 3,25 MHz - RAM 1 Ko - ROM 8 Ko

eldonfsr

  • Sr. Member
  • ****
  • Posts: 311
Re: LazSerial Synapse
« Reply #2 on: September 24, 2022, 09:46:21 pm »
This procedure
Code: Pascal  [Select][+][-]
  1. procedure TForm_Main.SerialRxData(Sender: TObject);
  2. Var Str:String;
  3. begin
  4.   Str :=  Serial.ReadData;
  5.   CurPos := RPos( Char(13)+chr(10)+'>' ,Str);
  6.   if CurPos = 0 then begin
  7.     FTempStr := FTempStr + Str;
  8.   end
  9.   else begin
  10.     CurPos := RPos( Char(13)+chr(10) ,Str);
  11.     FTempStr := FTempStr + Copy( Str, 1, CurPos-1);
  12.     MDatas.Lines.BeginUpdate;
  13.     MDatas.Lines.Add(FtempStr);
  14.     MDatas.Lines.EndUpdate;
  15.     MDatas.SelStart := Length(MDatas.Lines.Text)-1;
  16.     MDatas.SelLength:=0;
  17.     FTempStr := Copy(Str,CurPos +1, Length(Str) - CurPos);
  18.     MDatas.Refresh;
  19.   end;
  20.   MCMd.SetFocus;
  21. end;      
  22.  

af0815

  • Hero Member
  • *****
  • Posts: 1022
Re: LazSerial Synapse
« Reply #3 on: September 25, 2022, 08:18:25 am »
Use in SerialRxData no GUI Elements. Move the String in a save place and do not block this callback. Refresh your Objects and GUI in a other procedure.
regards
Andreas

eldonfsr

  • Sr. Member
  • ****
  • Posts: 311
Re: LazSerial Synapse
« Reply #4 on: September 26, 2022, 07:58:14 pm »
I don't know now is direct received to the memo but look how the text is put on memo

MD
0,MG"
star
t
Pus
her
"

MD1
,AL
0,A
R50,
WA30
00,
MJ10


MD2
,PM
,MN,
DH10
00

MD3
,MR-
5000
,GO,
WS500
,DH,
WS500
,MA0,
WS500
,RP


MD1
0,MC
250,M
C50

MD11,MG
"Z AX
IS H
OME..
."
M
D12,W
A50,
MC200,W
A50,
GH,W
S
MD1
3,MG
"Z AX
IS HO
ME D
ONE."
,MC21
5,RA2
0,AM5
0,AD
100,A
R21
 
when must be like this;
MD0,MG"start Pusher"
MD1,AL0,AR50,WA3000,MJ10
MD2,PM,MN,DH1000
MD3,MR-5000,GO,WS500,DH,WS500,MA0,WS500,RP

MD10,MC250,MC50
MD11,MG"Z AXIS HOME..."
MD12,WA50,MC200,WA50,GH,WS
here is how i take data from serial port..
Code: Pascal  [Select][+][-]
  1. procedure TForm_Main.SerialRxData(Sender: TObject);
  2. Var Str:String;
  3. begin
  4.   MDatas.Lines.Add(Serial.ReadData);
  5.   MDatas.Refresh;
  6.  
  7.   MCMd.SetFocus;
  8. end;
  9.  
  10.  
I don;t know if is when load data to memo or is how received from mode...


rvk

  • Hero Member
  • *****
  • Posts: 4948
Re: LazSerial Synapse
« Reply #5 on: September 26, 2022, 08:11:33 pm »
MDatas.Lines.Add(Serial.ReadData) adds a string to the memo including a hard return.

If you don't like the hard returns do this:
Code: Pascal  [Select][+][-]
  1. MDatas.Lines.Text := MDatas.Lines.Text + Serial.ReadData;
« Last Edit: September 26, 2022, 08:13:06 pm by rvk »

eldonfsr

  • Sr. Member
  • ****
  • Posts: 311
Re: LazSerial Synapse
« Reply #6 on: September 26, 2022, 08:42:15 pm »
Thanks looks better the problem is Tmemo.Lines.Add( Serial.ReadData )  don't like some time take as must be some times don;t take where the CRLF

 

TinyPortal © 2005-2018