下面VB怎么翻译成Delhpi?(100)

  • 主题发起人 主题发起人 hug
  • 开始时间 开始时间
H

hug

Unregistered / Unconfirmed
GUEST, unregistred user!
Public OutByte(6) As BytePrivate Sub cmdAlong_Click() OutByte(0) = &HCE OutByte(1) = &HEC '调大 (1846) OutByte(2) = &H0 OutByte(3) = &H0 OutByte(4) = &H3A OutByte(5) = &H60 OutByte(6) = &H54 frmMain.Comm1.Output = OutByte Timer2.Enabled = True Label6.Caption = "正在向后调节...." StatusBar1.Panels(1) = Label6.Caption'frmMain.Timer2.Enabled = TrueEnd Sub我有控件comm串口通信。
 
var OutByte:string[6];procedure tform1.cmdAlongClick()
begin OutByte[1] := #$CE OutByte[2] := #$C //调大 (1846) OutByte[3] ;= #$0 OutByte[4] ;= #$0 OutByte[5] := #$3A OutByte[6] := #$60 OutByte(6) := #$54 frmMain.Comm1.Output := OutByte
Timer2.Enabled := True
Label6.Caption := '正在向后调节....'
StatusBar1.Panels[1] := Label6.Caption;//frmMain.Timer2.Enabled = TrueEnd;//你有控件comm串口通信。
 
谢谢,这样是否可以呢?procedure TForm1.BitBtn1Click(Sender: TObject);var OutByte:array[0..6] of byte
i:integer;begin OutByte[0] := byte($CE)
OutByte[1] := byte($FC)
// 调小
OutByte[2] := byte($0)
OutByte[3] := byte($0)
OutByte[4] := byte($3A)
OutByte[5] := byte($60)
OutByte[6] := byte($64)
for i:=0 to 6 do Comm1.WriteCommData(@OutByte,Length(OutByte));end;
 
另外,别人给另外我这样的单片机控制协议,请问怎么用呢?CE XX 00 00 00 00 CSJ1:A P1.7B P1.6C P1.5J2:A P1.4B P1.3C P1.2XX:;P2.4 J3.1CE F1 00 00 00 00 BF;P2.5 J8.1 //WHM CE A1 00 00 00 00 6F/*****继电器列************/;J1.1 P1.1=0 //WHMCE A8 00 00 00 00 76 ;J1.2 P1.1=0;J1.2 P1.1=0 CE EA 00 00 00 00 B8 CE EC 00 00 00 00 BA ;J1.3 P1.1=0 //WHMCE A9 00 00 00 00 77;J1.4 P1.1=0CE EB 00 00 00 00 B9;J1.5 P1.1=0 CE EF 00 00 00 00 BD;J1.6 P1.1=0 //WHM CE A5 00 00 00 00 73 //测量电机处于最低转速0.5/min 300/min< 0.5-300;J1.7 P1.1=0 //WHM CE A6 00 00 00 00 74 //多位盘电机正常 10/minJ1.8 P1.1=0 //WHM /*********水泵列*********/;J2.1CE F3 00 00 00 00 C1;J2.2CE F4 00 00 00 00 C2 ;J2.3 CE F5 00 00 00 00 C3;J2.4CE F6 00 00 00 00 C4 ;J2.5CE F7 00 00 00 00 C5 ;J2.6 //WHMCE A2 00 00 00 00 70 ;J2.7 //WHM CE A3 00 00 00 00 71 ;J2.8 //WHM CE A4 00 00 00 00 72/*****继电器扩展列*************/;J1.1 P1.1=1CE FC 00 00 F6 E0 A0;J1.2 P1.1=1 CE FA 00 00 00 00 C8;J1.3 P1.1=1 //WHM CE AA 00 00 00 00 78;J1.4 P1.1=1 CE FB 00 00 00 00 C9;J1.5 P1.1=1 CE FD 00 00 00 00 CB;J1.6 P1.1=1 CE FE 00 00 00 00 CC;J1.7 P1.1=1 //WHM CE AB 00 00 00 00 79;J1.8 P1.1=1 //WHM CE AC 00 00 00 00 7A0XF9: J1.3
 
哈哈,兄弟这个就太多啦。你还是掏票子吧!
 
后退
顶部