Serial in Thread

The problem is if I sleep the thead when I wait for data, not all the charaters is captured.
A While Wend loop works, but takes 25 % of my recources.

What to do ?..

Do you need to have the socket in a thread? The Dataavailable event, or maybe paired with a timer that polls the thread every sensible period of time for your purposes, should do the job reliably.

probably not …
I thought it was best to have communications in a separate tread…

It’s not. The processing of data you get from the serial might be better in a thread, but not the communiations.

Thanks Ulrich and Tim