作者andy0624 (威龙)
看板Visual_Basic
标题[VB6 ] 接收数位讯号 结果都是乱码
时间Sun Mar 27 18:05:38 2011
小弟我初学VB 拜托各位大大帮忙
我用8051的RS232传送A/D後的讯号 理论上介面应该接收到的是二进位讯号
但得到都是乱码
我的设定 BAUD RATE 是2400 且使用 COM PORT1
也有设定RS232输入模式是二进位
但问题还是无法解决 (以确认过8051程式没问题)
下面连结是我的程式
http://www.megaupload.com/?d=TU3WL0B7
补上关键程式
Private Sub Form_Load()
MSComm1.CommPort = 1
MSComm1.Settings = "2400,n,8,1"
MSComm1.InputMode = comInputModeBinary '设定接收为二进制资料
MSComm1.RThreshold = 1
MSComm1.PortOpen = True
End Sub
Private Sub Timer1_Timer()
If
MSComm1.InBufferCount > 0 Then
txtReceive.Text = MSComm1.Input
End If
End Sub
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 140.115.70.118
※ 编辑: andy0624 来自: 140.115.70.118 (03/27 18:15)
※ 编辑: andy0624 来自: 140.115.70.118 (03/27 18:15)
1F:→ stool100:建议你先用 终端机工具收看看 04/01 00:36