[求助]請教MSComm的問題
我已經完成完成以下程式的編寫,並且可以與數位萬用表溝通(電壓資料獲取).但是當電壓值變為10.0V以上時, txtReceive.text 接收框的值為1.00V.(小數點的位置向前移動了)
煩請各位老師,大俠指教. 怎么才消除小數點位置的問題? Thanks! 以下為原代碼:
Private Sub cmdexit_Click()
MSComm1.PortOpen = False
End
End Sub
Private Sub cmdRead_Click()
Dim Buf
MSComm1.Output = "READ?" + Chr(10)
TimeDelay 200
Buf = Trim(MSComm1.Input)
If Len(Buf) = 0 Then
txtReceive.Text = "HA HA "
Else
txtReceive.Text = Buf + Left(Buf, 7)
End If
End Sub
Private Sub Form_Load()
MSComm1.Settings = "9600,n,8,1"
MSComm1.PortOpen = True
MSComm1.Output = "SYST:RWL" + Chr(10)
MSComm1.Output = "Conf: volt: DC 10; :Volt: DC: NPLC 0.02" + Chr(10)
End Sub