Page 1 of 1

Reading Buffer

Posted: Tue Sep 10, 2019 3:46 pm
by jollybv
Hi Guys

I'm trying to figure out how I can read a section of the circular buffer and when it gets to a certain termination character (.) it must jump out

The string that is being sent is something like Name.1111.Hellow World How Are You.

The Name is fine as I'm using LookForValue the pin is also fine as I'm counting 4 digits but the message is a problem as it can be anything from 1 to 20 characters.
Buffer.fcfx
(17.24 KiB) Downloaded 258 times

Re: Reading Buffer

Posted: Tue Sep 10, 2019 4:38 pm
by Benj
Hello,

If everything is delimited with a full stop then I would do something like this using a finite state machine approach.
Parser.fcfx
(11.17 KiB) Downloaded 304 times
You might need a timeout to reset the RxMode back to 0 if no data is received for several seconds.

Re: Reading Buffer

Posted: Tue Sep 10, 2019 4:53 pm
by jollybv
Hi Ben

Thanks, I will go through this and see if I can make it work