Serial receive - order
Roland from South Africa  [97 posts]
3 years


Is there a simple way to set the receive order of variables?

Often, a device would send out a <cr> or <lf> that one uses as a marker, but in this case I have no control of the receive string format.

If I send out;

and I have;  \[a]\[b]\[c]     as the receive variables

the received variables can be;

How can I get an order without sorting the variables in a VB script?
The device I'm using sends a string format that I cannot modify, something like;
55 aa 01 00 01 00

What I would like to do is simply receive the sequence in the order that it come in

where "a" will always receive the first character,  in a similar way to the console window.

Roland from South Africa  [97 posts] 3 years

Ok, I wrote a simple 'if' script to sort them.

It would have been nice if I could have used something like;

<85> <170> in the same way that one uses;
<lf>  <cr>

Ie the parenthesized figures, of choice, determine the string match

Steven Gentner from United States  [1370 posts] 3 years
Yes, that what


in the serial module documentation is referring to. 255 is often used as a sync char which is what you were looking for. So in your case


should do the trick.


This forum thread has been closed due to inactivity (more than 4 months) or number of replies (more than 50 messages). Please start a New Post and enter a new forum thread with the appropriate title.

 New Post   Forum Index