发送的数据为0xaa+0x55+调号+频率1+频率2+频率3+(调号+频率1+频率2+频率3和取反)
频率1,2,3是一个长式子的16进制的值的后3个字节
大侠帮看下 改好一定追加
procedure TForm1.Button1Click(Sender: TObject);
var
a,b,c,e,f,g:int64;
j:string;
begin
if combobox2.text=''
then showmessage('调号为空')
else
begin
if combobox3.text=''
then showmessage('请选择频率')
else
begin
g:=round(32768*(((4*strtofloat(combobox3.text))/14.7456)-3/2));
j:=inttohex(g,6);
a:=strtoint(copy(j,1,2));
b:=strtoint(copy(j,3,2));
c:=strtoint(copy(j,5,2));
e:=strtoint(combobox2.text)+a+b+c;
f:=(not e);
if radiobutton1.Checked then
mscomm1.output:=chr($aa)+chr($55)+chr(strtoint(combobox2.text))+chr(a)+chr(b)+chr(c)+chr(f);
Application.CreateForm(Tform5,form5);
form5.showmodal;
form5.free;
end;
end;
end;
combobox2里是 1-20的整数
combobox3里是 带小数点的数
为什么会报错?该怎么改?谢谢
f:=(not e);
取反
胡说叔叔
慕标5832272
慕勒3428872
相关分类