OK thought my brain might be clearer in the morning, apparently not!
Well I cant see a single random 10 anywhere in the data from teraterm. Can post if you want but its a pretty boring read. I also tried with some VCP port monitoring software
Serial Port Monitor. Professional-grade software for establishing a serial connection with COM-based software and devices. COM Port Monitor allows you to debug, test and scan of serial communication
www.virtual-serial-port.org
Good question Erel, why arent I using byte builder. Why is Converting random bytes to string a big mistake? I simply don't know enough about B4X. ( and I did try reading forum on it)
Even if I rewrote all my code to work with B4R in Prefix mode ( which I cant unless you support PIC18 as well) I am not sure that it would then be compatible with other software. Does prefix mode send the first byte as the length of data, or does it make sure that the buffer has the right amount of data. It would be so much simpler to build strings byte by byte, but that's only because I don't know what Im doing. Every send may well be a 'random' length dependant on the value from the sensor, and number of sensors connected.
I will look at modifying code to use Stringbuilder, but that seems to suggest that $String1=$String1 & $String2 is bad idea, as opposed to sb.Append.
The problem looks more like buffer contains the 10
IF you believe TeraTerm and Eltima software
srx 1592851290578 3 : 88 49 50
SerialBuffer = [X12]
srx 1592851290593 16 : 53 49 59 89 48 59 90 45 57 48 59 65 48 59
49 48
SerialBuffer = [X1251;Y0;Z-90;A0;
10]
I have downloaded the Eltima log to show that I believe my data is Clean.
But will carry on as you suggest Emexes with an sb.
Thanks
Steve