发表于:2007/6/8 21:37:00
#0楼
Private Sub Command1_Click()
If MSComm1.PortOpen = False Then
MSComm1.Settings = "9600,e,7,1"
MSComm1.PortOpen = True
End If
MSComm1.OutBufferCount = 0
MSComm1.InBufferCount = 0
Dim sendtemp(11) As Byte
sendtemp(0) = &H2
sendtemp(1) = &H30
sendtemp(2) = &H30
sendtemp(3) = &H45
sendtemp(4) = &H30
sendtemp(5) = &H32
sendtemp(6) = &H30
sendtemp(7) = &H32
sendtemp(8) = &H3
sendtemp(9) = &H36
sendtemp(10) = &H43
MSComm1.Output = sendtemp
MSComm1.PortOpen = False
If MSComm1.PortOpen = False Then
MSComm1.Settings = "9600,e,7,1"
MSComm1.PortOpen = True
End If
MSComm1.OutBufferCount = 0
MSComm1.InBufferCount = 0
Dim sendtemp1(10) As Byte
sendtemp1(0) = &H2
sendtemp1(1) = &H45
sendtemp1(2) = &H37
sendtemp1(3) = &H30
sendtemp1(4) = &H30
sendtemp1(5) = &H31
sendtemp1(6) = &H32
sendtemp1(7) = &H3
sendtemp1(8) = &H34
sendtemp1(9) = &H32
MSComm1.Output = sendtemp1
MSComm1.PortOpen = False
End Sub
不知道对不对,望各位老师指点一下,还有就是如果对x1,x2...等是怎么置位的呢?
也就是哪个数据是怎么得出来?都快想破头了
If MSComm1.PortOpen = False Then
MSComm1.Settings = "9600,e,7,1"
MSComm1.PortOpen = True
End If
MSComm1.OutBufferCount = 0
MSComm1.InBufferCount = 0
Dim sendtemp(11) As Byte
sendtemp(0) = &H2
sendtemp(1) = &H30
sendtemp(2) = &H30
sendtemp(3) = &H45
sendtemp(4) = &H30
sendtemp(5) = &H32
sendtemp(6) = &H30
sendtemp(7) = &H32
sendtemp(8) = &H3
sendtemp(9) = &H36
sendtemp(10) = &H43
MSComm1.Output = sendtemp
MSComm1.PortOpen = False
If MSComm1.PortOpen = False Then
MSComm1.Settings = "9600,e,7,1"
MSComm1.PortOpen = True
End If
MSComm1.OutBufferCount = 0
MSComm1.InBufferCount = 0
Dim sendtemp1(10) As Byte
sendtemp1(0) = &H2
sendtemp1(1) = &H45
sendtemp1(2) = &H37
sendtemp1(3) = &H30
sendtemp1(4) = &H30
sendtemp1(5) = &H31
sendtemp1(6) = &H32
sendtemp1(7) = &H3
sendtemp1(8) = &H34
sendtemp1(9) = &H32
MSComm1.Output = sendtemp1
MSComm1.PortOpen = False
End Sub
不知道对不对,望各位老师指点一下,还有就是如果对x1,x2...等是怎么置位的呢?
也就是哪个数据是怎么得出来?都快想破头了