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;
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s