rs232 and waiting on receive to send

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Blokker1999
    New Member
    • Nov 2008
    • 1

    #1

    rs232 and waiting on receive to send

    Hello,

    I am new to VB.net and I am trying to write a program to interface with a device. I have most of the protocol documented. Thanks to this forum I am already able to send information to the device, but I am unable to do it automated.

    The problem is that you have to send the information one byte at the time and wait for the device to answer, if you send all the information at once the device simply sends an error code back instead of the go ahead.

    So how do I send one byte and then wait for the correct response before I can send the next one?
  • Plater
    Recognized Expert Expert
    • Apr 2007
    • 7872

    #2
    Program logic?
    Code:
    SendMesage()
    {
       while(stillOKToSend)
       {
          Send one byte
          Wait for Response
          validate response
          if message=done then stilloktosend=false
       }
    }

    Comment

    Working...