Re: [VB6 ] 關於MSComm的問題

看板Visual_Basic作者 (小獅子)時間19年前 (2006/01/10 11:41), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串3/4 (看更多)
※ 引述《r121465n (希望不是真的)》之銘言: : debug結果...data不是零,是中文亂碼 @Q@ : 如果寫MSComm1.output="1" : 經RS232,遠端會收到31H : 那遠端先後傳送:31H、32H給VB : data=MSComm1.input : 照理說data應該會等於"12" : 結果居然是中文亂碼,不是"12" : 寫法是不是出錯了? "31H" ? 接收端會把資料自動用十六進制顯示不合理吧@@ 範例... 傳送端: MSComm1.CommPort = 1 MSComm1.Settings = "19200,n,8,1" MSComm1.Handshaking = 0 MSComm1.PortOpen = True MSComm1.Output = "1" & vbCrLf 接收端: MSComm1.CommPort = 1 MSComm1.Settings = "19200,n,8,1" MSComm1.Handshaking = 0 MSComm1.PortOpen = True '用 Timer 等待資料... If MSComm1.InbufferCount Then Debug.Print MSComm1.Input End If -- ▃▅▇▆▄ ▆▂▃ ` 逝去感如何能留住,半點遺留殊不易,██▅▇▄▃ ▇▃▂" . █████████▃i ▁▄▇ 更多悽悽慘慘的遭遇………██▆▃ █▅▆▃ˍ▄* ▂█▄▇▅▂. 我不知道,王~八~蛋~~! ▂▆███ █▄▃ 。fumizuki。Check。 -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 61.222.155.162
文章代碼(AID): #13mopdaW (Visual_Basic)
討論串 (同標題文章)
文章代碼(AID): #13mopdaW (Visual_Basic)