Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8812623
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T03:38:42+00:00 2026-06-14T03:38:42+00:00

I am sending data through a COM port and starting my timer with a

  • 0

I am sending data through a COM port and starting my timer with a 4000 interval to send my message back if I did not receive anything before the 4 seconds.

{Load}

Private Sub MainForm_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    [...]    
    SendCard(0)
    [...]
End Sub

{SendCard Sub}
I’m sending the require information through this Sub by setting the property “LastCommand” which sends the data through the port.

Private Sub SendCard(ByVal cardIndex As Integer)
    If cardIndex < Setting.Machine.Cards.Length Then

        'Calling LastCommand's Set()
        LastCommand = "*" & Setting.Machine.Cards(cardIndex) & ": STRQ" & ControlChars.CrLf
    Else
        'Blah blah...
    End If

End Sub

The property sends the data and start the Timer.

Public Property LastCommand() As String
    Get
        Return lastCommandString
    End Get
    Set(ByVal value As String)
        lastCommandString = value
        MainCOMSerialPort.Write(value)
        ResponseTimer.Start()
    End Set
End Property

When I receive an answer I stop the timer and then ask the information for the next card.

Private Sub MainCOMSerialPort_DataReceived(...)
   [...]
   ResponseTimer.Stop() 'After this stop it does not trigger the Tick event any longer.
   SendCard(Array.IndexOf(Setting.Machine.Cards, CardString) + 1) 'Sending the next card
   [...]
End Sub

The tick event works fine for the first card

Private Sub ResponseTimer_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ResponseTimer.Tick
    'MessageBox.Show("No Respone Yet")
    LastCommand = LastCommand
End Sub

So it’s asking my first command every 4 second until I get something in return, but when I start over with the second command the Timer does not tick.

I’m using .NET 4.0 and the {Windows.Forms.Timer}, I tried with Timers.Timer and did not work either I don’t understand why it does not start again.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T03:38:43+00:00Added an answer on June 14, 2026 at 3:38 am

    It looked like System.Timers.Timer was the best options I managed to make the elapse event trigger every 4 second after I sent a command every time I do so.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm very new to sending data over a serial port through .net and I've
When sending data from one iOS device to another, I receive these errors. 2012-06-21
I am having a weird problem with sending data back to my server. This
I have one device which sends data on COM port say on COM13. Now
I am having issue when sending data from Service to Activity through Notification ,
I have a PHP page that uses PEAR Mail to send a message through
I have a certain URL http://dev.mycompany.com and I need to send some data (in
When sending data via POST or GET with jQuery you use for format {
I am sending data in database Like Hello fnds, How are you. I am
How can I stop sending data to the server if the button allready has

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.