Site icon Embarcadero RAD Studio, Delphi, & C++Builder Blogs

Robust Asynchronous Serial Communications Library – Delphi & C++ Builder

robust asynchronous serial communications library delphi c builder

What is serial communication?

Serial communication is a simple means of sending data to long distances quickly and reliably. Serial communication is an increasingly important aspect of embedded systems. A good understanding is essential to the aspiring designer. There are 2 broad types of serial communication:

And there are lots of standards and protocols when it comes to serial communications. They should match the right protocol with the right applications.

What is TMS Async?

TMS Async is a communications package that provides access to the serial ports under Windows. The event-driven architecture provides the highest possible performance and allows all the tools to run in the background.

TMS Async Features

procedure TForm1.VaCommRxBuf(Sender: TObject; Data: PVaData;
  Count: Integer);
var
  I: Integer;
begin
  for I := 0 to Count - 1 do
    case Data^[I] of
      #10:;
      #13: MemoIndex := Memo2.Lines.Add('');
      else
      begin
        Memo2.Lines[MemoIndex] := Memo2.Lines[MemoIndex] + Data^[I];
        Memo2.Refresh;
      end;
    end;
end;

procedure TForm1.VaModem21RingDetect(Sender: TObject; Rings: Integer;
  var AcceptCall: Boolean);
begin
  Memo1.Lines.Add('RING: ' + IntToStr(Rings));
  AcceptCall := Rings >= 1;
end;

procedure TForm1.VaModem21CommandTimeout(Sender: TObject);
begin
  case VaModem1.ModemAction of
    maInit: Memo1.Lines.Add('Error initializing modem.');
  end;
end;

How to get TMS Async?

Head over and check out the TMS Async communications package on the GetIt portal and download it in the IDE.

Exit mobile version