Hello. I am working on a program that requires me to generate a status of the program I am writing. Up to now I can display every string values out onto the txtDisplayText box but except that last one which the value was generated from the serial port

Code Snippet

Dim sRx_Buffer As String

Dim sRx_Msg As String

commSerial.Output = stringValue

sRx_Buffer = commSerial.Input

sRx_Msg = Conversion(sRx_Buffer)

*Conversion function*

txtDisplayStatus.Text = txtDisplayStatus.Text & _

"From Serial device: " & generatedValue & vbcrlf & vbcrlf

I let it run in a loop function. Everything shows up except the last one. I set a breakpoint to check what's in the commSerial.Input. I did see some values but the variable could not capture the string of data that is from the serialComm.Input. Any help on this Thank you very much.

Re: Display a value in a looping status


It is ok now. I found out the problem. I set the breakpoint at commSerial.Output = stringValue, Srx_Buffer = commSerial.Input and sRx_Msg = Conversion(sRx_Buffer). To check where my problem lies and found out that my previous data was not cleared.

I just want to know how I can clear the buffer values in commSerial.Output or commSerial.Input

Thank you

EDIT: Sorry if I made another account here. My main account is giving me problems yesterday, thus making me create another account to look for answers here.