[VB2008](急)串列通訊程式的問題

看板Visual_Basic作者 (因為貼心所以是好人)時間16年前 (2009/08/26 00:27), 編輯推噓0(001)
留言1則, 1人參與, 最新討論串1/1
我參考MSDN上的從COMPORT上讀取字串 寫了 Module Module1 Sub Main() Dim Str As String Str = ReceiveSerialData() Console.WriteLine(Str) Console.ReadLine() End Sub Function ReceiveSerialData() As String ' Receive strings from a serial port. Dim returnStr As String = "" Using com1 As IO.Ports.SerialPort = _ My.Computer.Ports.OpenSerialPort("COM3") '我的sensor在COM3上 Do Dim Incoming As String = com1.ReadLine() If Incoming Is Nothing Then Exit Do Else returnStr &= Incoming & vbCrLf End If Loop End Using Return returnStr End Function End Module 可是一直沒讀到東西 請問是我哪裡寫錯呢? -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 203.73.175.14

09/05 17:01, , 1F
有試過先用超級終端機讀過嗎?
09/05 17:01, 1F
文章代碼(AID): #1Ab13UlU (Visual_Basic)