level 3
无言落叶伤的忧
楼主
大佬们跪求帮看一下,为什么我的串口只有在使用过串口调试助手才可以往下位机发送数据,然后从下位机读取数据?不能直接运行就正常发送?![[泪]](/static/emoticons/u6cea.png)
![[泪]](/static/emoticons/u6cea.png)
代码如下,大佬们不要抛弃小弟啊![[乖]](/static/emoticons/u4e56.png)
![[乖]](/static/emoticons/u4e56.png)
unit Unit2;interfaceuses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, ExtCtrls,DateUtils ;type TByteArr = array of byte; TForm2 = class(TForm) Button1: TButton; Label1: TLabel; Label3: TLabel; Memo2: TMemo; Button2: TButton; RadioGroup1: TRadioGroup; Timer1: TTimer; Button4: TButton; Button5: TButton; Edit1: TEdit; GroupBox1: TGroupBox; ComboBox1: TComboBox; ComboBox2: TComboBox; ComboBox3: TComboBox; ComboBox4: TComboBox; Label2: TLabel; Label4: TLabel; procedure sendstr(ss:TByteArr); procedure Button1Click(Sender: TObject); procedure Button2Click(Sender: TObject); procedure Timer1Timer(Sender: TObject); procedure Button4Click(Sender: TObject); procedure Button5Click(Sender: TObject); procedure FormCreate(Sender: TObject); private { Private declarations } public { Public declarations } end;var Form2: TForm2; k,nn,sendtimes:integer;
2018年09月13日 09点09分
1
unit Unit2;interfaceuses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, ExtCtrls,DateUtils ;type TByteArr = array of byte; TForm2 = class(TForm) Button1: TButton; Label1: TLabel; Label3: TLabel; Memo2: TMemo; Button2: TButton; RadioGroup1: TRadioGroup; Timer1: TTimer; Button4: TButton; Button5: TButton; Edit1: TEdit; GroupBox1: TGroupBox; ComboBox1: TComboBox; ComboBox2: TComboBox; ComboBox3: TComboBox; ComboBox4: TComboBox; Label2: TLabel; Label4: TLabel; procedure sendstr(ss:TByteArr); procedure Button1Click(Sender: TObject); procedure Button2Click(Sender: TObject); procedure Timer1Timer(Sender: TObject); procedure Button4Click(Sender: TObject); procedure Button5Click(Sender: TObject); procedure FormCreate(Sender: TObject); private { Private declarations } public { Public declarations } end;var Form2: TForm2; k,nn,sendtimes:integer;