Click here to Skip to main content
15,916,371 members
Home / Discussions / Visual Basic
   

Visual Basic

 
AnswerRe: API in vb 2008 Pin
Baran M30-Apr-09 1:20
Baran M30-Apr-09 1:20 
AnswerRe: API in vb 2008 Pin
Henry Minute30-Apr-09 2:02
Henry Minute30-Apr-09 2:02 
QuestionSending two data with a 2second interval in a queue list Pin
Quin Nee30-Apr-09 0:01
Quin Nee30-Apr-09 0:01 
AnswerRe: Sending two data with a 2second interval in a queue list Pin
Dave Kreskowiak30-Apr-09 13:47
mveDave Kreskowiak30-Apr-09 13:47 
GeneralRe: Sending two data with a 2second interval in a queue list Pin
Quin Nee1-May-09 3:47
Quin Nee1-May-09 3:47 
GeneralRe: Sending two data with a 2second interval in a queue list Pin
Dave Kreskowiak1-May-09 16:02
mveDave Kreskowiak1-May-09 16:02 
GeneralRe: Sending two data with a 2second interval in a queue list Pin
Quin Nee2-May-09 4:53
Quin Nee2-May-09 4:53 
GeneralRe: Sending two data with a 2second interval in a queue list Pin
Quin Nee10-May-09 10:40
Quin Nee10-May-09 10:40 
Right, tested this out but I have a problem of with the string "DataSend". Every time it checks for the the varible that I want, it just repeats itself. For example, I queued the test according to "c", "a", and then "c" again. So the queue sends out "c", "a",and lastly "c". The first time it runs, works perfectly. When the timer tick even kicks in, and sends out the next variable "a", I checked it for "a" and it goes well. After that, I checked for the third variable "c", it skips that and goes straight to "a" instead. What happened here? I don't really understand why it refuses to move forward.

Timer1 tick event
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick

    If tasklist.Count > 0 Then
        'Run the next test

        DataSend = tasklist.Dequeue()
        ListBox1.Items.RemoveAt(0)
        serialPort.Write(DataSend)

        If DataSend.Contains("c") = True Then
            Timer2.Enabled = True
            Timer1.Enabled = False
        ElseIf DataSend.Contains("b") = True Then
            serialPort.Write(DataSend)
            Timer1.Enabled = True
            Timer2.Enabled = False
        ElseIf DataSend.Contains("a") = True Then
            serialPort.Write(DataSend)
            Timer1.Enabled = True
            Timer2.Enabled = False
        End If
    Else
        serialPort.Close()
        PortStatus.Text = serialPort.PortName & " disconnected."
        Disconnect.Enabled = False
        Connect.Enabled = True
        Timer1.Enabled = False
        Timer2.Enabled = False
        MsgBox("Finished All Test")
    End If

End Sub


Timer 2 tick event, just an event to extend the time for variable "c"
Private Sub Timer2_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer2.Tick

        serialPort.Write("p" & vbCrLf)
        Timer2.Enabled = False
        Timer1.Enabled = True

End Sub


I tried making the string empty before dequeue but it doesn't work. Any ideas on how to work around this?
QuestionUsercontrol build problem Pin
Tom Deketelaere29-Apr-09 23:01
professionalTom Deketelaere29-Apr-09 23:01 
AnswerRe: Usercontrol build problem Pin
Johan Hakkesteegt4-May-09 23:06
Johan Hakkesteegt4-May-09 23:06 
GeneralRe: Usercontrol build problem Pin
Tom Deketelaere4-May-09 23:27
professionalTom Deketelaere4-May-09 23:27 
GeneralRe: Usercontrol build problem Pin
Johan Hakkesteegt5-May-09 0:11
Johan Hakkesteegt5-May-09 0:11 
GeneralRe: Usercontrol build problem Pin
Tom Deketelaere5-May-09 0:17
professionalTom Deketelaere5-May-09 0:17 
Questionscripting scheduled task Pin
TheScripter29-Apr-09 21:58
TheScripter29-Apr-09 21:58 
AnswerRe: scripting scheduled task Pin
Dave Kreskowiak30-Apr-09 13:20
mveDave Kreskowiak30-Apr-09 13:20 
QuestionVB6 - how to bitstream Pin
halsboss29-Apr-09 21:15
halsboss29-Apr-09 21:15 
AnswerRe: VB6 - how to bitstream Pin
Mycroft Holmes29-Apr-09 21:56
professionalMycroft Holmes29-Apr-09 21:56 
GeneralRe: VB6 - how to bitstream Pin
halsboss29-Apr-09 22:07
halsboss29-Apr-09 22:07 
GeneralRe: VB6 - how to bitstream Pin
Mycroft Holmes29-Apr-09 22:21
professionalMycroft Holmes29-Apr-09 22:21 
GeneralRe: VB6 - how to bitstream Pin
halsboss30-Apr-09 1:20
halsboss30-Apr-09 1:20 
GeneralRe: VB6 - how to bitstream Pin
Dave Kreskowiak30-Apr-09 13:16
mveDave Kreskowiak30-Apr-09 13:16 
QuestionRe: VB6 - how to bitstream Pin
CPallini30-Apr-09 1:48
mveCPallini30-Apr-09 1:48 
AnswerRe: VB6 - how to bitstream Pin
halsboss8-May-09 21:54
halsboss8-May-09 21:54 
NewsRe: VB6 - how to bitstream Pin
CPallini9-May-09 1:41
mveCPallini9-May-09 1:41 
GeneralRe: VB6 - how to bitstream Pin
halsboss9-May-09 2:06
halsboss9-May-09 2:06 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.