Hello
I’m a student and I’m developping an application (VB.net 2008) for the velbus system.
I’ve already created an application similar to the velbuslink.
Now I hope that somebody can explain me how the comport buffer works.
Here I present some code that I use.
Dim compoort As New SerialPort
...
Try
compoort.Read(recvBuffer, 0, recvBuffer.Length)
Catch ex As Exception
Console.WriteLine("compoort read exception")
End Try
The problem I encounter is that when I try to read the memory of the vmbpb8.
That my receivebuffer gets messed up.
In normal circomstances when I receive a packet, my buffer contains only the bytes of 1 packet.
Sometimes the receivebuffer contains more packets, but the most recent is in front of the buffer.
But when I try to read the memory of the vmb8pb after ± 29 send/received packets the buffers gets scrumbled.
What I mean with scrumbled is that my receivebuffer doesn’t begin with &H 0FFB… . (normaly it does).
Now I hope that somebody can explain how these buffer works.
When it is cleared, when the received event is triggered (by received byte or by received packet) and so on?