title: Serial Communication stops working when loop is started
body: <p>I have problem with serial data communication if I started a loop it is not updating the data from my weighing scale. I can't figure out how to continue the communication as well as to run the loop. The logic of my code will be in the loop so I could check the value from my integer and compare it to the data from serial data (Weighing Scale)</p>
  
  <pre><code>Private Sub conWeight_DataReceived(sender As System.Object, e As System.IO.Ports.SerialDataReceivedEventArgs) Handles conWeight.DataReceived
  
  receivedText(conWeight.ReadExisting())
  
  End Sub
  
  
  Private Sub receivedText(ByVal [text] As String)
      If Me.lblWeight.InvokeRequired Then
          Dim x As New SetTextCallback(AddressOf receivedText)
          Me.Invoke(x, New Object() {(text)})
      Else
          Dim reverseString As String = [text]
          Dim revString As String = StrReverse(reverseString)
          Dim clean As String
          clean = revString.Replace("=", "")
          Me.lblWeight.Text = clean 'append text
      End If
  End Sub
  
  'this is part with loop
  
   If binWeight = 0 Then
              targetweight = CInt(txtbSilo1.Text) + CInt(txtbSilo2.Text) + CInt(txtbSilo3.Text) + CInt(txtbSilo4.Text)
              If CInt(txtbSilo1.Text) &gt; 0 Then
                  currentWeight = CInt(txtbSilo1.Text)
                  frmAutomaticControl.conControl.Open()
                  frmAutomaticControl.conControl.Write("motr1")
                  frmAutomaticControl.conControl.Close()
                  MsgBox("check")
                  Do
                      If binWeight &gt;= currentWeight Then
                          frmAutomaticControl.conControl.Open()
                          frmAutomaticControl.conControl.Write("moto1")
                          frmAutomaticControl.conControl.Close()
                          Exit Do
                      End If
  
                  Loop
              Else
  
              End If
              BunifuFlatButton1.Enabled = True
          Else
              MsgBox("Empty The Bin")
          End If
  </code></pre>