⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 comset.~pas

📁 这是用Delphi+spcomm开发的基于MODBUS协议的RTU程序
💻 ~PAS
字号:
unit comset;

interface

uses
  Windows, Messages,SPComm, Controls, Classes, SysUtils, Variants, Graphics, Forms,
  Dialogs, StdCtrls;

type
  TForm2 = class(TForm)
    Edit1: TEdit;
    Label1: TLabel;
    Label2: TLabel;
    ComboBox1: TComboBox;
    Label3: TLabel;
    Edit2: TEdit;
    Label4: TLabel;
    ComboBox2: TComboBox;
    Label5: TLabel;
    ComboBox3: TComboBox;
    Button1: TButton;
    Button2: TButton;
    procedure Button2Click(Sender: TObject);
    procedure Button1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
   Form2: TForm2;
   parity1:TParity ;
   StopBits1: TStopBits;
   ByteSize1: TByteSize;
implementation

uses fcomm;

{$R *.dfm}

procedure TForm2.Button2Click(Sender: TObject);
begin
form2.Close;
end;

procedure TForm2.Button1Click(Sender: TObject);
begin
  with form1.Comm1
  do
    begin
     commname:=edit1.Text;
     baudrate:=strtoint( edit2.Text ) ;
     parity:=tparity(ComboBox1.itemindex)  ;
     StopBits:=tStopBits( ComboBox3.ItemIndex ) ;
     bytesize:=tbytesize( ComboBox2.ItemIndex ) ;
     form2.Close;
    end;

       // with
end;

end.

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -