发表于:2007/2/2 15:06:00
#0楼
哪位高手请不吝赐教,这段代码有什么问题,为什么反回值是:"⊥⊥⊥⊥⊥“,但都是连在一起的,下面是代码:
Private Sub Form_Load()
MSComm1.Settings = "9600,e,7,1"
MSComm1.CommPort = 1
MSComm1.PortOpen = True
End Sub
Private Sub CmdReadDO_Click()
Dim rd As String
Dim rdh As String
MSComm1.InputLen = 0 '串行数据接收缓冲区初始化'
rd$ = "0230313046363034033734" '在网上找到的资料 读取D123开始的4个字节
MSComm1.Output = rd$
Delay 0.3 '延时0.1秒
rdh$ = MSComm1.Input
End Sub
Private Sub Form_Load()
MSComm1.Settings = "9600,e,7,1"
MSComm1.CommPort = 1
MSComm1.PortOpen = True
End Sub
Private Sub CmdReadDO_Click()
Dim rd As String
Dim rdh As String
MSComm1.InputLen = 0 '串行数据接收缓冲区初始化'
rd$ = "0230313046363034033734" '在网上找到的资料 读取D123开始的4个字节
MSComm1.Output = rd$
Delay 0.3 '延时0.1秒
rdh$ = MSComm1.Input
End Sub