📄 unit1.pas
字号:
//var strN25 :string;
//var TxstrP25: string;
//var TxstrN25: string;
var liao: string;
var liaoxu: string;
//var liaoxuming :string;
begin
//var BaudRate :integer;
Case ComboBox1.ItemIndex Of
0 : begin
liao:='EB 04 01 01 01 0B 00 EC FE 00 90';
strP25:='发送:EB 04 01 01 01 0B 00 EC FE 00 90 ';
end;
1 : begin
liao:='EB 04 02 01 01 0B 00 EC FF 00 90';
strP25:='发送:EB 04 02 01 01 0B 00 EC FF 00 90 ';
end;
2 : begin
liao:='EB 04 03 01 01 0B 00 EC 00 01 90';
strP25:='发送:EB 04 03 01 01 0B 00 EC 00 01 90 ';
end;
3 : begin
liao:='EB 04 04 01 01 0B 00 EC 01 01 90';
strP25:='发送:EB 04 04 01 01 0B 00 EC 01 01 90 ';
end;
4 : begin
liao:='EB 04 05 01 01 0B 00 EC 02 01 90';
strP25:='发送:EB 04 05 01 01 0B 00 EC 02 01 90 ';
end;
5 : begin
liao:='EB 04 06 01 01 0B 00 EC 03 01 90';
strP25:='发送:EB 04 06 01 01 0B 00 EC 03 01 90 ';
end;
6 : begin
liao:='EB 04 07 01 01 0B 00 EC 04 01 90';
strP25:='发送:EB 04 07 01 01 0B 00 EC 04 01 90 ';
end;
7 : begin
liao:='EB 04 08 01 01 0B 00 EC 05 01 90';
strP25:='发送:EB 04 08 01 01 0B 00 EC 05 01 90 ';
end;
8 : begin
liao:='EB 04 09 01 01 0B 00 EC 06 01 90';
strP25:='发送:EB 04 09 01 01 0B 00 EC 06 01 90 ';
end;
9 : begin
liao:='EB 04 0A 01 01 0B 00 EC 07 01 90';
strP25:='发送:EB 04 0A 01 01 0B 00 EC 07 01 90 ';
end;
10 : begin
liao:='EB 04 0B 01 01 0B 00 EC 08 01 90';
strP25:='发送:EB 04 0B 01 01 0B 00 EC 08 01 90 ';
end;
else begin
liao:='EB 04 01 01 01 0B 00 EC FE 00 90';
strP25:='发送:EB 04 01 01 01 0B 00 EC FE 00 90 ';
end; ;
End;
//liao:='EB 04 01 01 01 0B 00 EC FE 00 90';
//strP25:='发送:EB 04 01 01 01 0B 00 EC FE 00 90 ';
if ComHaveSet<>55 then
begin
Application.MessageBox('波特率没有设定'+#13+
' 请重新设定','警告',MB_ICONWARNING or MB_OK);
// ComboBox2.SetFocus;
Form2.showmodal;
end
else
begin
liaoxu:= HexStrToStr(liao);
// Form2.Comm1.WriteCommData(Pchar(HexStrToStr(TxstrP25)),Length(TxstrP25));
Form2.Comm1.WriteCommData(Pchar(liaoxu),Length(liaoxu));
Button1.Caption:='+2.5V';
Memo1.Text := Memo1.Text + StrP25;
Memo1.SelStart := Length(Memo1.Text);
Memo1.SelLength:= 0;
Memo1.Perform(EM_SCROLLCARET,0,0);
//\r\njlklkkjkjl
memo1.Lines.Append('');
memo1.Lines.Append('');
JiaoYangJianChe:=55;
//if Comm1.WriteCommData(Pchar(str),Length(str)) then
//begin
// FTXNum:=FTXNum+Length(str);
// ShowTX;
// end;
end;
end;
procedure TForm1.Label2Click(Sender: TObject);
begin
Label2.Caption:='12' ;
end;
procedure TForm1.Button2Click(Sender: TObject);
var strP75 :string;
var strN75 :string;
var TxstrP75: string;
var TxstrN75: string;
//var liao: string;
var liaoxu: string;
//var liaoxuming :string;
begin
//var BaudRate :integer;
Case ComboBox1.ItemIndex Of
0 : begin
TxstrP75:='EB 04 01 01 01 0E 00 EE 06 00 00 09 01 90';
TxstrN75:='EB 04 01 01 01 0E 00 EE 07 00 00 0A 01 90';
strP75:='发送:EB 04 01 01 01 0E 00 EE 06 00 00 09 01 90 ';
strN75:='发送:EB 04 01 01 01 0E 00 EE 07 00 00 0A 01 90 ';
end;
1 : begin
TxstrP75:='EB 04 02 01 01 0E 00 EE 06 00 00 0A 01 90';
TxstrN75:='EB 04 02 01 01 0E 00 EE 07 00 00 0B 01 90';
strP75:='发送:EB 04 02 01 01 0E 00 EE 06 00 00 0A 01 90 ';
strN75:='发送:EB 04 02 01 01 0E 00 EE 07 00 00 0B 01 90 ';
end;
2 : begin
TxstrP75:='EB 04 03 01 01 0E 00 EE 06 00 00 0B 01 90';
TxstrN75:='EB 04 03 01 01 0E 00 EE 07 00 00 0C 01 90';
strP75:='发送:EB 04 03 01 01 0E 00 EE 06 00 00 0B 01 90 ';
strN75:='发送:EB 04 03 01 01 0E 00 EE 07 00 00 0C 01 90 ';
end;
3 : begin
TxstrP75:='EB 04 04 01 01 0E 00 EE 06 00 00 0C 01 90';
TxstrN75:='EB 04 04 01 01 0E 00 EE 07 00 00 0D 01 90';
strP75:='发送:EB 04 04 01 01 0E 00 EE 06 00 00 0C 01 90 ';
strN75:='发送:EB 04 04 01 01 0E 00 EE 07 00 00 0D 01 90 ';
end;
4 : begin
TxstrP75:='EB 04 05 01 01 0E 00 EE 06 00 00 0D 01 90';
TxstrN75:='EB 04 05 01 01 0E 00 EE 07 00 00 0E 01 90';
strP75:='发送:EB 04 05 01 01 0E 00 EE 06 00 00 0D 01 90 ';
strN75:='发送:EB 04 05 01 01 0E 00 EE 07 00 00 0E 01 90 ';
end;
5 : begin
TxstrP75:='EB 04 06 01 01 0E 00 EE 06 00 00 0E 01 90';
TxstrN75:='EB 04 06 01 01 0E 00 EE 07 00 00 0F 01 90';
strP75:='发送:EB 04 06 01 01 0E 00 EE 06 00 00 0E 01 90 ';
strN75:='发送:EB 04 06 01 01 0E 00 EE 07 00 00 0F 01 90 ';
end;
6 : begin
TxstrP75:='EB 04 07 01 01 0E 00 EE 06 00 00 0F 01 90';
TxstrN75:='EB 04 07 01 01 0E 00 EE 07 00 00 10 01 90';
strP75:='发送:EB 04 07 01 01 0E 00 EE 06 00 00 0F 01 90 ';
strN75:='发送:EB 04 07 01 01 0E 00 EE 07 00 00 10 01 90 ';
end;
7 : begin
TxstrP75:='EB 04 08 01 01 0E 00 EE 06 00 00 10 01 90';
TxstrN75:='EB 04 08 01 01 0E 00 EE 07 00 00 11 01 90';
strP75:='发送:EB 04 08 01 01 0E 00 EE 06 00 00 10 01 90 ';
strN75:='发送:EB 04 08 01 01 0E 00 EE 07 00 00 11 01 90 ';
end;
8 : begin
TxstrP75:='EB 04 09 01 01 0E 00 EE 06 00 00 11 01 90';
TxstrN75:='EB 04 09 01 01 0E 00 EE 07 00 00 12 01 90';
strP75:='发送:EB 04 09 01 01 0E 00 EE 06 00 00 11 01 90 ';
strN75:='发送:EB 04 09 01 01 0E 00 EE 07 00 00 12 01 90 ';
end;
9 : begin
TxstrP75:='EB 04 0A 01 01 0E 00 EE 06 00 00 12 01 90';
TxstrN75:='EB 04 0A 01 01 0E 00 EE 07 00 00 13 01 90';
strP75:='发送:EB 04 0A 01 01 0E 00 EE 06 00 00 12 01 90 ';
strN75:='发送:EB 04 0A 01 01 0E 00 EE 07 00 00 13 01 90 ';
end;
10 : begin
TxstrP75:='EB 04 0B 01 01 0E 00 EE 06 00 00 13 01 90';
TxstrN75:='EB 04 0B 01 01 0E 00 EE 07 00 00 14 01 90';
strP75:='发送:EB 04 0B 01 01 0E 00 EE 06 00 00 13 01 90 ';
strN75:='发送:EB 04 0B 01 01 0E 00 EE 07 00 00 14 01 90 ';
end;
else begin
TxstrP75:='EB 04 01 01 01 0E 00 EE 06 00 00 09 01 90';
TxstrN75:='EB 04 01 01 01 0E 00 EE 07 00 00 0A 01 90';
strP75:='发送:EB 04 01 01 01 0E 00 EE 06 00 00 09 01 90 ';
strN75:='发送:EB 04 01 01 01 0E 00 EE 07 00 00 0A 01 90 ';
end; ;
End;
//liao:='EB 04 01 01 01 0B 00 EC FE 00 90';
//TxstrP75:='EB 04 01 01 01 0E 00 EE 06 00 00 09 01 90';
//TxstrN75:='EB 04 01 01 01 0E 00 EE 07 00 00 0A 01 90';
//strP75:='发送:EB 04 01 01 01 0E 00 EE 06 00 00 09 01 90 ';
//strN75:='发送:EB 04 01 01 01 0E 00 EE 07 00 00 0A 01 90 ';
if ComHaveSet<>55 then
begin
Application.MessageBox('老大'+#13+
' 麻烦你设置一下串口好不好?','警告',MB_ICONWARNING or MB_OK);
// ComboBox2.SetFocus;
Form2.showmodal;
end
else
begin
if RadioButton3.Checked then
begin
liaoxu:= HexStrToStr(TxstrP75);
// Form2.Comm1.WriteCommData(Pchar(HexStrToStr(TxstrP25)),Length(TxstrP25));
Form2.Comm1.WriteCommData(Pchar(liaoxu),Length(liaoxu));
Button2.Caption:='+7.5V';
Memo1.Text := Memo1.Text + StrP75;
Memo1.SelStart := Length(Memo1.Text);
Memo1.SelLength:= 0;
Memo1.Perform(EM_SCROLLCARET,0,0);
//\r\njlklkkjkjl
memo1.Lines.Append('');
memo1.Lines.Append('');
//if Comm1.WriteCommData(Pchar(str),Length(str)) then
//begin
// FTXNum:=FTXNum+Length(str);
// ShowTX;
// end;
end;
if RadioButton4.Checked then
begin
Button2.Caption:='-7.5V';
liaoxu:= HexStrToStr(TxstrN75);
Form2.Comm1.WriteCommData(Pchar(liaoxu),Length(liaoxu));
Memo1.Text := Memo1.Text + StrN75;
Memo1.SelStart := Length(Memo1.Text);
Memo1.SelLength:= 0;
Memo1.Perform(EM_SCROLLCARET,0,0);
//\r\njlklkkjkjl
memo1.Lines.Append('');
memo1.Lines.Append('');
end;
end;
end;
procedure TForm1.Button3Click(Sender: TObject);
var strP150 :string;
var strN150 :string;
var TxstrP150: string;
var TxstrN150: string;
//var liao: string;
var liaoxu: string;
//var liaoxuming :string;
begin
//var BaudRate :integer;
//liao:='EB 04 01 01 01 0B 00 EC FE 00 90';
Case ComboBox1.ItemIndex Of
0 : begin
TxstrP150:='EB 04 01 01 01 0E 00 EE 0A 00 00 0D 01 90 ';
TxstrN150:='EB 04 01 01 01 0E 00 EE 0B 00 00 0E 01 90';
strP150:='发送:EB 04 01 01 01 0E 00 EE 0A 00 00 0D 01 90 ';
strN150:='发送:EB 04 01 01 01 0E 00 EE 0B 00 00 0E 01 90 ';
end;
1 : begin
TxstrP150:='EB 04 02 01 01 0E 00 EE 0A 00 00 0E 01 90 ';
TxstrN150:='EB 04 02 01 01 0E 00 EE 0B 00 00 0F 01 90';
strP150:='发送:EB 04 02 01 01 0E 00 EE 0A 00 00 0E 01 90 ';
strN150:='发送:EB 04 02 01 01 0E 00 EE 0B 00 00 0F 01 90 ';
end;
2 : begin
TxstrP150:='EB 04 03 01 01 0E 00 EE 0A 00 00 0F 01 90 ';
TxstrN150:='EB 04 03 01 01 0E 00 EE 0B 00 00 10 01 90';
strP150:='发送:EB 04 03 01 01 0E 00 EE 0A 00 00 0F 01 90 ';
strN150:='发送:EB 04 03 01 01 0E 00 EE 0B 00 00 10 01 90 ';
end;
3 : begin
TxstrP150:='EB 04 04 01 01 0E 00 EE 0A 00 00 10 01 90 ';
TxstrN150:='EB 04 04 01 01 0E 00 EE 0B 00 00 11 01 90';
strP150:='发送:EB 04 04 01 01 0E 00 EE 0A 00 00 10 01 90 ';
strN150:='发送:EB 04 04 01 01 0E 00 EE 0B 00 00 11 01 90 ';
end;
4 : begin
TxstrP150:='EB 04 05 01 01 0E 00 EE 0A 00 00 11 01 90 ';
TxstrN150:='EB 04 05 01 01 0E 00 EE 0B 00 00 12 01 90';
strP150:='发送:EB 04 05 01 01 0E 00 EE 0A 00 00 11 01 90 ';
strN150:='发送:EB 04 05 01 01 0E 00 EE 0B 00 00 12 01 90 ';
end;
5 : begin
TxstrP150:='EB 04 06 01 01 0E 00 EE 0A 00 00 12 01 90 ';
TxstrN150:='EB 04 06 01 01 0E 00 EE 0B 00 00 13 01 90';
strP150:='发送:EB 04 06 01 01 0E 00 EE 0A 00 00 12 01 90 ';
strN150:='发送:EB 04 06 01 01 0E 00 EE 0B 00 00 13 01 90 ';
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -