synaser, Serial port retrieving a string lazarus / 21-General ---------------------------------------------------------------------- LemonParty · 2024-02-04 15:52 Hello. I am trying to get data from serial port using next code (library synaser). Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i {...}while comport.WaitingData > 0 do begin  c := Chr( comport.RecvByte(10000));  {...}end;I am getting the first half of a string this way but not the last one. What I doing wrong? ---------------------------------------------------------------------- Thaddy · 2024-02-04 15:54 10000 seems extremely high. ---------------------------------------------------------------------- jamie · 2024-02-04 16:45 Not knowing what you are linked to, is it possible you need to hand shake the device to ACK the received data so it will continue to send the next group of bytes? ---------------------------------------------------------------------- marcov · 2024-02-04 16:57 Not running the OS message pump enough ? ---------------------------------------------------------------------- LemonParty · 2024-02-04 17:39 jamie, I am using a monitoring application and see that response is full sized when on a code level I only see the first 140 bytes of data. Accordingly to documentation ACK is not needed. marcov, not understand your response, please explain. ---------------------------------------------------------------------- jamie · 2024-02-04 19:10 I believe there is a status property you can check in the com code after it times out. its possible you are delaying the app in a loop and causing windows if that is what you are on to stop processing. Insert a Application.ProcessMessages in your loop. ---------------------------------------------------------------------- tetrastes · 2024-02-05 08:19 Quote from: LemonParty on February 04, 2024, 04:52:54 pmHello. I am trying to get data from serial port using next code (library synaser). Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i {...}while comport.WaitingData > 0 do begin  c := Chr( comport.RecvByte(10000));  {...}end;I am getting the first half of a string this way but not the last one. What I doing wrong? "Use the Source, Luke!"  In short: the last half remains in internal buffer. Try WaitingDataEx or CanReadEx instead of WaitingData. ---------------------------------------------------------------------- LemonParty · 2024-02-05 15:01 tetrastes, yes, that helped. Thank you. I would not find this bug by myself without you.