The RecvTerminated function is in synser:
Str := LazSerial1.synser.RecvTerminated(150,'?');
That may work for the test string, but that is only one function of the serial port. When I send a "Start" command, which is Ctrl_A, the device will send a continuous stream of byte pairs, which can be anything from 0x00 to 0xff. I want to store them in a circular queue for a time period of 100 to 300 mSec, which corresponds to 480 to 1440 bytes. When the timer event fires, I will be parsing the data as byte pairs which contain 6 bits of a 12 bit ADC value, and two bits which increment as 00, 01, 10, 11, 00, ... These values are used to synchronize the data stream. Each valid pair will start with 00 or 10 and the second byte of the pair will be 01 or 11. If not, it means that a data byte has been missed, and the data pair will be discarded. The errors are tracked and usually are very uncommon.
Using my previous serial port components, SerialNG and ComDrv32, the serial port continues to run and fills the main buffer, while the timer tick processes the data received up to the time of the timer tick. This is what I am trying to do with the "OnTimer" event. The application error you experienced was probably because of the "SetFocus" when the TMemo had not yet been created. I removed it and the try..except caught and handled the attempt to open a non-existent COM port.
After removing the "Memo1.SetFocus" from the timer tick, the Open and Close buttons seem to be more responsive. So perhaps they need to have focus on the main form rather than the memo, in order to work.