掲示板システム
ホーム
アクセス解析
カテゴリ
ログアウト
VB2005のシリアル通信でバイナリデータを送る方法 (ID:139282)
名前
ホームページ(ブログ、Twitterなど)のURL (省略可)
本文
VisualBasic2005のシリアル通信でバイナリデータを送信したいのですが、、下記のVisualBasic6.0のプログラムではうまくいきますが、 下記のVisualBasic2005のプログラムではうまくいきません。 送信したいバイナリデータは、16進数の82です。 VisualBasic2005では、130と送信されてしまいます。 【VisualBasic6.0】 If MSComm1.PortOpen = False Then MSComm1.PortOpen = True End If Dim command(0) As Byte command(0) = &H82 MSComm1.Output = command If MSComm1.PortOpen = True Then MSComm1.PortOpen = False End If 【VisualBasic2005】 Dim command(0) As Byte If SerialPort1.IsOpen = False Then Call SerialPort1.Open() End If command(0) = &H82 SerialPort1.Write(command(0)) If SerialPort1.IsOpen = True Then Call SerialPort1.Close() End If よろしくお願いいたします。
←解決時は質問者本人がここをチェックしてください。
更新する
戻る
掲示板システム
Copyright 2021 Takeshi Okamoto All Rights Reserved.