Hi to all,
I have a problem here with my code, lines marked as bold, once the code pass throught the lines and don't do anything, i mean the motor should stop but don't stop....I think the loop is very fast and the code can't stop the motor...Any sugestion to make this work?
Private Sub SerialPort1_DataReceived(ByVal sender As Object, ByVal e As System.IO.Ports.SerialDataReceivedEventArgs) Handles SerialPort1.DataReceived
'Automatically called every time a data is received at the serialPort
Me.Invoke(New EventHandler(AddressOf receber_Tramas))
End Sub
Private Sub receber_Tramas()
Select Case var_trim_anterior
Case (var_exp_Trim - 174) To (var_exp_Trim + 174)
'Stop the motor
estado_motor = "00"
var_enviar_trama = "070B" & "05" & "ac" & "0A" & "00" & "ff" & estado_motor
SerialPort1.Write(var_enviar_trama & vbCr)
End Select
End Sub
I have a problem here with my code, lines marked as bold, once the code pass throught the lines and don't do anything, i mean the motor should stop but don't stop....I think the loop is very fast and the code can't stop the motor...Any sugestion to make this work?
Private Sub SerialPort1_DataReceived(ByVal sender As Object, ByVal e As System.IO.Ports.SerialDataReceivedEventArgs) Handles SerialPort1.DataReceived
'Automatically called every time a data is received at the serialPort
Me.Invoke(New EventHandler(AddressOf receber_Tramas))
End Sub
Private Sub receber_Tramas()
Select Case var_trim_anterior
Case (var_exp_Trim - 174) To (var_exp_Trim + 174)
'Stop the motor
estado_motor = "00"
var_enviar_trama = "070B" & "05" & "ac" & "0A" & "00" & "ff" & estado_motor
SerialPort1.Write(var_enviar_trama & vbCr)
End Select
End Sub