Extracting portions of data from Circular Buffer

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

Moderator: Benj

Post Reply
User avatar
jollybv
Flowcode v5 User
Posts: 374
Joined: Thu Feb 12, 2009 5:20 am
Location: Cape Town
Has thanked: 81 times
Been thanked: 25 times
Contact:

Extracting portions of data from Circular Buffer

Post by jollybv »

Hi Guys

I'm trying to extract say for example the phone number from the circular buffer, What i need is to scan the buffer until i see the " then read the 12 digits and exit but i cant seem to be able to get this right any help / examples will be appreciated as system must go out on Monday. I've tried using string manipulation but is not efficient as different networks have different formats.

+CMT: "+27741016705",,"2018/04/21 09:32:31+08"
+CMT: "+27741016705" Please call

mnf
Valued Contributor
Valued Contributor
Posts: 1188
Joined: Wed May 31, 2017 11:57 am
Has thanked: 70 times
Been thanked: 439 times
Contact:

Re: Extracting portions of data from Circular Buffer

Post by mnf »

Please give us a little more detail of what you are trying to do. Save the characters to a string, convert to a number (or several numbers) is there any detail in the string etc

The circular buffer allows easy access to contents using GetByte, and of you've downloaded the latest version of the component then there is a PeekByte which will let you check for the end of a symbol too.

Martin

User avatar
jollybv
Flowcode v5 User
Posts: 374
Joined: Thu Feb 12, 2009 5:20 am
Location: Cape Town
Has thanked: 81 times
Been thanked: 25 times
Contact:

Re: Extracting portions of data from Circular Buffer

Post by jollybv »

Hi Martin

Thank for the response what I'm trying to do is extract the 12 digit phone number (+27741016705) out the string in the buffer and compare it with a number stored in memory. the comparison is not a problem it is getting the 12 digit number as the buffer is constantly getting updated and never the same size to use string manipulation

+CMT: "+27741016705",,"2018/04/21 09:32:31+08"
+CMT: "+27741016705" Please call

User avatar
jollybv
Flowcode v5 User
Posts: 374
Joined: Thu Feb 12, 2009 5:20 am
Location: Cape Town
Has thanked: 81 times
Been thanked: 25 times
Contact:

Re: Extracting portions of data from Circular Buffer

Post by jollybv »

Hi Martin

Thank for the response what I'm trying to do is extract the 12 digit phone number (+27741016705) out the string in the buffer and compare it with a number stored in memory. the comparison is not a problem it is getting the 12 digit number as the buffer is constantly getting updated and never the same size to use string manipulation.

+CMT: "+27741016705",,"2018/04/21 09:32:31+08"
+CMT: "+27741016705" Please call

Do you have a link where i can download the updated component.

mnf
Valued Contributor
Valued Contributor
Posts: 1188
Joined: Wed May 31, 2017 11:57 am
Has thanked: 70 times
Been thanked: 439 times
Contact:

Re: Extracting portions of data from Circular Buffer

Post by mnf »

Something like :

[img]buffer.PNG[/img]

How is your circular buffer being updated - if interrupts? - you may need to disable them whilst reading to .data (which you are then free to compare etc as required)

How big a buffer are you using ?

The updated circular buffer component (thanks to Ben for this) is at http://www.matrixtsl.com/mmforums/downl ... p?id=25485

Martin
Attachments
buffer.PNG
(23.87 KiB) Downloaded 1951 times

User avatar
jollybv
Flowcode v5 User
Posts: 374
Joined: Thu Feb 12, 2009 5:20 am
Location: Cape Town
Has thanked: 81 times
Been thanked: 25 times
Contact:

Re: Extracting portions of data from Circular Buffer

Post by jollybv »

Hi Martin

Thanks for this I can see exactly how it will work

Post Reply