ksTools 0.20

The second pre-release (ver 0.20) of ksTools library containes documentation in .chm format and many TksComPort enhancements. The most useful enhancement is the second TksComPort.Read method overload with new (Timeout) parameter, which simplifies the serial communications with external device using “Request – Answer” scheme. The end of the device answer now can be defined in OnReadStop event handler.

For example, some devices answer by ASCII string of arbitrary length ending with LF character. With the correspondent OnReadStop event handler Read returnes immediately after finding LF in the input:

procedure TForm1.ksComPort1ReadStop(Sender: TObject; Value: Byte;
var Stop: Boolean);
begin
if Value = $0A { LF } then Stop:= True;
end;

Leave a comment