当前位置: 代码迷 >> 移动应用 >> tc35i通信格式(VB编程),该如何处理
  详细解决方案

tc35i通信格式(VB编程),该如何处理

热度:158   发布时间:2016-04-25 08:29:34.0
tc35i通信格式(VB编程)
我用VB编TC35i的串口通信程序,初始设定是
comm1.commport=1
comm1.DTrenable=true
comm1.handshaking=comNone
comm1.inbuffersize=1024
comm1.inputlen=0
comm1.inputmode=cominputmodetext
comm1.nulldiscard=false
comm1.outbuffersize=0
comm1.trhershold=1
comm1.RTSEnable=false
comm1.steeings=9600,n,8,1
comm1.sthreshold=0
我用txtsend文本框的keypress事件输入AT命令
Private Sub txtsend_KeyPress(KeyAscii As Integer)
   
   
  If KeyAscii = 13 Then
  n = Len(txtsend.Text)
  For i = 1 To n
  Comm1.Output = Hex(Asc(Mid(txtsend.Text, i, 1)))  
  Next i
  Comm1.Output = "0D"
  End If

End Sub
当我自发自收at<cr>的时候,在接受区得到的是61740d。用串口调试助手16位输出61740d,tc35i会回复ok,但从我的vb程序输出tc35i就没有反应,大家帮忙看看是为什么呢
谢谢大家了






------解决方案--------------------

 Comm1.Output = "0D" 
應該不是這樣寫的吧,這個是字符串,不是真的回車
  相关解决方案