如何在不按下梅特勒托利多秤上的按钮的情况下打印重量
How to print weight without pressing the button on Mettler Toledo scales
这是我按下秤上的按钮时的代码:
Private Sub SerialPort1_DataReceived(sender As Object, e As SerialDataReceivedEventArgs) Handles SerialPort1.DataReceived
If comOpen Then
Try
readBuffer = SerialPort1.ReadExisting()
Me.Invoke(New EventHandler(AddressOf DoUpdate))
Catch ex As Exception
MsgBox("read " & ex.Message)
End Try
End If
End Sub
Public Sub DoUpdate(ByVal sender As Object, ByVal e As System.EventArgs)
TxtIn.AppendText(readBuffer)
End Sub
我的体重秤是 Metller Toledo AB204-S。
终于发现卡住了
Private Sub BtnSend_Click(sender As Object, e As EventArgs) Handles BtnSend.Click
SerialPort1.WriteLine("SI" & vbCrLf)
End Sub
这是代码命令 SI 和 CrLf
这是我按下秤上的按钮时的代码:
Private Sub SerialPort1_DataReceived(sender As Object, e As SerialDataReceivedEventArgs) Handles SerialPort1.DataReceived
If comOpen Then
Try
readBuffer = SerialPort1.ReadExisting()
Me.Invoke(New EventHandler(AddressOf DoUpdate))
Catch ex As Exception
MsgBox("read " & ex.Message)
End Try
End If
End Sub
Public Sub DoUpdate(ByVal sender As Object, ByVal e As System.EventArgs)
TxtIn.AppendText(readBuffer)
End Sub
我的体重秤是 Metller Toledo AB204-S。
终于发现卡住了
Private Sub BtnSend_Click(sender As Object, e As EventArgs) Handles BtnSend.Click
SerialPort1.WriteLine("SI" & vbCrLf)
End Sub
这是代码命令 SI 和 CrLf