I'm trying to connect to a Mettler Toledo Scale via a serial port to read in the weight of an object and output the wieght into a label or text box on the form.
so I have a button and a text box. Here is my code
My problem is that the program hangs there doing nothing when I click the button.Code:Private Sub btnSendText_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSendText.Click Dim Port As SerialPort = New SerialPort("COM1", 9600, Parity.None, 8, StopBits.One) Port.Open() txtWeight.Text = Port.ReadLine() Port.Close() End Sub
Does anyone know why?




Reply With Quote