Newsgroups : Borland : borland.public.delphi.nativeapi.win32 : 2007 Feb : Serial Ports

www.cryer.info
Managed Newsgroup Archive

Serial Ports

Subject:Serial Ports
Posted by:"Gerry" (gepttipa..@hotmail.com)
Date:Fri, 2 Feb 2007 09:17:04

Hi,

I have a pole display plugged into my USB port. It's been assigned to COM3:.
It has 2 x 20 character rows.

I created a connection to the COM port using CreateFile.

I can send characters to it using the following procedure:

procedure SendInfo;
  iCounter : Integer;
  BytesWritten: DWORD;
  sValue : String;

begin
  sValue := Edit1.Text + #13 + #10;

  for iCounter := 1 to Length(sValue) do
  begin
     WriteFile(ComFile, sValue[iCounter], 1, BytesWritten, nil);
  end;

  sValue := Edit2.Text + #10 + #13;

  for iCounter := 1 to Length(sValue) do
  begin
     WriteFile(ComFile, sValue[iCounter], 1, BytesWritten, nil);
  end;
end;

My problem is this:

The pole display has special commands. If I want to turn the cursor off, I
send a CTRL + T. To turn the cursor on, I send a CTRL + S. And to clear both
rows, I send CTRL + _.

I need to know how to send a CTRL + <anykey> to the COM port. The example in
the pole display manual has, ^T, ^S, and ^_ but these just display on the
pole display exactly as they are typed.

Thanks for any help you can give me.

Replies:

www.cryer.info
Managed Newsgroup Archive