Reading Buffer

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 7.

Moderator: Benj

User avatar
jollybv
Flowcode v5 User
Posts: 331
Joined: Thu Feb 12, 2009 5:20 am
Has thanked: 75 times
Been thanked: 23 times
Contact:

Reading Buffer

Postby jollybv » Tue Sep 10, 2019 3:46 pm

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 3 times

User avatar
Benj
Matrix Staff
Posts: 14157
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4330 times
Been thanked: 4080 times
Contact:

Re: Reading Buffer

Postby Benj » Tue Sep 10, 2019 4:38 pm

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 12 times


You might need a timeout to reset the RxMode back to 0 if no data is received for several seconds.

User avatar
jollybv
Flowcode v5 User
Posts: 331
Joined: Thu Feb 12, 2009 5:20 am
Has thanked: 75 times
Been thanked: 23 times
Contact:

Re: Reading Buffer

Postby jollybv » Tue Sep 10, 2019 4:53 pm

Hi Ben

Thanks, I will go through this and see if I can make it work
These users thanked the author jollybv for the post:
Benj (Wed Sep 11, 2019 10:10 am)
Rating: 5.56%