Results 1 to 3 of 3

Thread: MSComm timing problem

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Jan 2001
    Location
    US Steel - Gary, IN
    Posts
    20
    I'm reading an Avtron foot counter from the serial port via MSComm. I'm doing it through a timer, so that I can continually read the port. My problem is that the counter sends a "canned" message. I only need the last value of the message. However, the timing is not always the same when the counter sends the data and when the VB timer is reading the port. Is there some way that I can either eliminate the timer and continually read the port or only accept the data from the port when the entire message is sent? I hope my question is clear. Please feel free to E-mail me if more clearification is necessary. [email protected] Thanks, Jeff

  2. #2
    Lively Member
    Join Date
    Oct 2000
    Posts
    68
    I messed around with MSCOMM once and I don't remember using a timer I just read in from the buffer and when the buffer reached a certain number of bytes I moved the data out of the buffer and malnipulated it.

    I may be wrong but could you do something like that?

    Simon


  3. #3
    PowerPoster Chris's Avatar
    Join Date
    Jan 1999
    Location
    K-PAX
    Posts
    3,238
    Stockton is rite, you can set the InBufferCount properties to 1.

    That mean when there is an incoming data being receive by the MSComm control,
    it will fire the comEvReceive. Then you only going to read the data out from the InputBuffer.

    Cheers!


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