Circular buffer question help needed.

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

Moderator: Benj

Post Reply
Pactor
Posts: 61
Joined: Sat Apr 11, 2015 12:07 pm
Has thanked: 20 times
Been thanked: 14 times
Contact:

Circular buffer question help needed.

Post by Pactor »

Hello
I'm baffled again.
If I have the below in the circular buffer and wanted just to print the 20.8 temp received how would I do it?
I've tried searching for the string that comes before and it gets located, I just thought I could get the following bytes and that would be what I was looking for but it never seem to print what I'm looking for.
Thanks for any advice

Mark


+IPD,100:<span id="ctl00_ContentMain_dlParams_ctl01_lblPValue"><b><font size="6">20.8&deg;C</font></b></span>CLOSED

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

Re: Circular buffer question help needed.

Post by Benj »

Hi Mark,

Please can you post the program or a snippet of code that shows what you are doing and hopefully we can point you in the right direction.

Pactor
Posts: 61
Joined: Sat Apr 11, 2015 12:07 pm
Has thanked: 20 times
Been thanked: 14 times
Contact:

Re: Circular buffer question help needed.

Post by Pactor »

I had some luck I'm getting >22.8 on the display. Could do without the ">" appearing though.

I'm just wondering how to isolate the 22.8 out of the data received.
I'm very thick. I've attached my attempt

+IPD,100:<span id="ctl00_ContentMain_dlParams_ctl01_lblPValue"><b><font size="6">22.8&deg;C</font></b></span>CLOSED

I'm not sure about all the chip config options available to the micro I'm using.
I have an external xtal. Somethings happening so it must be half right.
Attachments
8266-1.fcfx
(19.91 KiB) Downloaded 275 times

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

Re: Circular buffer question help needed.

Post by Benj »

Hello,

How's this. I have created a simple state machine that looks for the "6">" and then starts filling the buffer until we reach the next "<" character.
8266-1.fcfx
(28.89 KiB) Downloaded 314 times
You may want to finish the reading after you receive the '&' character instead of the '<' but it should be easy for you to change this by switching the last compare hex value.

Pactor
Posts: 61
Joined: Sat Apr 11, 2015 12:07 pm
Has thanked: 20 times
Been thanked: 14 times
Contact:

Re: Circular buffer question help needed.

Post by Pactor »

Thanks very much.
You've got a very logical brain.

I only had to alter 2 small things and it worked perfectly.
Why could I not see that solution.

Thanks again.

Post Reply