Results 1 to 3 of 3

Thread: Serial Communication

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Nov 2004
    Posts
    1,414

    Serial Communication

    Hi to all:

    I have a project that receive data from an electronic board and in the same project this data received must send to annother apllicattion.

    For that i had use this code for receive the data:

    Code:
      Private Sub SerialPort1_DataReceived(ByVal sender As Object, ByVal e As System.IO.Ports.SerialDataReceivedEventArgs) Handles SerialPort1.DataReceived
            ReceivedText(SerialPort1.ReadExisting())           
        End Sub
    And for send data:

    Code:
     Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
    
    end sub
    Like we know both this events have a constant cycle....
    My doubt here is:
    This is the best way to do this once this have 2 cycles? I mean this could run reasonably with a few lines of code in both events with no problem?

    If possible please send me your opinions!

    Thanks

  2. #2
    PowerPoster dunfiddlin's Avatar
    Join Date
    Jun 2012
    Posts
    8,245

    Re: Serial Communication

    It's all a bit vague. Why can't you use the DataReceived event to trigger the send also?
    As the 6-dimensional mathematics professor said to the brain surgeon, "It ain't Rocket Science!"

    Reviews: "dunfiddlin likes his DataTables" - jmcilhinney

    Please be aware that whilst I will read private messages (one day!) I am unlikely to reply to anything that does not contain offers of cash, fame or marriage!

  3. #3

    Thread Starter
    Frenzied Member
    Join Date
    Nov 2004
    Posts
    1,414

    Re: Serial Communication

    Ok...it's one ideia...i never thought about it!

    Thanks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width