Quantcast
Channel: VBForums - Visual Basic .NET
Viewing all articles
Browse latest Browse all 27189

VS 2008 Problem in code

$
0
0
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

Viewing all articles
Browse latest Browse all 27189

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>