Avatar of cmdolcet
cmdolcet
Flag for United States of America asked on

How to clear unwanted characters from COM buffer

I am suppose to be getting back in my COM Buffer the word " LH FLUSH" however along with the LH FLUSH I get the following "UU LH FLUSH" or "UU LH FL?SH" I clear my InBuffer however I still get the result above. My code is below:

            serialPort.BaudRate = "9600"
            serialPort.PortName = "COM" & activeport
            serialPort.Parity = IO.Ports.Parity.None
            serialPort.DataBits = 8
            serialPort.StopBits = 1
            serialPort.RtsEnable = True
            serialPort.Open()


 serialPort.Write("<@:L" & tempArray(0) & Total_Bytes & "<" & UpdatePoint & "," & "0" & Int_Rank & "," & GageDescription & "," & USL & "," & LSL & ">")
                    System.Threading.Thread.Sleep(100)
                    serialresponse1 = serialPort.ReadExisting


What Am I doing Wrong?
Visual Basic.NET

Avatar of undefined
Last Comment
Bob Learned

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
Bob Learned

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
cmdolcet

ASKER
Yes you were correct I was sending the commands too fast so the device was not responding in the correct time

Thanks.
Bob Learned

That is what handshaking/flow control configuration are designed for.  Does the device require any handshaking, like request-to-send or XOn/XOff?  I see where you had RtsEnable set to true, but you didn't set anything for Handshake...
All of life is about relationships, and EE has made a viirtual community a real community. It lifts everyone's boat
William Peck