Search bytes in EEprom (help with project)

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 5.
To post in this forum you must have a registered copy of Flowcode 5 or higher.

Moderator: Benj

Post Reply
MJU
Posts: 502
Joined: Wed Nov 07, 2007 6:51 pm
Location: Antwerp Belgium
Has thanked: 121 times
Been thanked: 108 times
Contact:

Search bytes in EEprom (help with project)

Post by MJU »

I'm building a Flowcode project and I'm struggling with following item:

In my Eeprom data is stored 7 bytes at the time.
The data starts @ position 0 and the next serie of seven bytes are stored @ position 7 and so on every 7 bytes.
Every serie of 7 bytes start with a byte that contains the number 1.

Now I want to search the Eeprom for a certain serie of bytes and return the starting point IF there is a match.
If there is no match it should also return a message (true/false).
It could be that there are only 3 or 4 series of the 7 bytes in the Eeprom.
For every first byte of a serie this starts at the 7the position from the previous and the first always starts at position 0.

How can I reliable and fast find IF such a serie exists (the serie I'm looking for is in a parameter[7] array-variable), and IF this exists at which Eeprom address it starts??

Any help is welcome..

User avatar
Jan Lichtenbelt
Posts: 797
Joined: Tue Feb 17, 2009 8:35 pm
Location: Haren GN, the Netherlands
Has thanked: 128 times
Been thanked: 264 times
Contact:

Re: Search bytes in EEprom (help with project)

Post by Jan Lichtenbelt »

Dear MJU

Something like this?

Kind regards

Jan Lichtenbelt
Attachments
Search_7_Bytes.fcf
(15.64 KiB) Downloaded 228 times

MJU
Posts: 502
Joined: Wed Nov 07, 2007 6:51 pm
Location: Antwerp Belgium
Has thanked: 121 times
Been thanked: 108 times
Contact:

Re: Search bytes in EEprom (help with project)

Post by MJU »

Thank you very much!
I'm going to test it tomorrow.

I see in this code: "= 0 // false"
What does the // mean?

Again thanks a lot!!

User avatar
Enamul
Posts: 1772
Joined: Mon Mar 05, 2012 11:34 pm
Location: Nottingham, UK
Has thanked: 271 times
Been thanked: 814 times
Contact:

Re: Search bytes in EEprom (help with project)

Post by Enamul »

// is used to comment out anything in C code. Which you can use in calculation box as well to put comment.
Enamul
University of Nottingham
enamul4mm@gmail.com

User avatar
Jan Lichtenbelt
Posts: 797
Joined: Tue Feb 17, 2009 8:35 pm
Location: Haren GN, the Netherlands
Has thanked: 128 times
Been thanked: 264 times
Contact:

Re: Search bytes in EEprom (help with project)

Post by Jan Lichtenbelt »

Dear MJU,

I'm sorry, but the boolean must be set to true (=1) at the first call, instead of false (=0)

Kind regards

Jan Lichtenbelt

MJU
Posts: 502
Joined: Wed Nov 07, 2007 6:51 pm
Location: Antwerp Belgium
Has thanked: 121 times
Been thanked: 108 times
Contact:

Re: Search bytes in EEprom (help with project)

Post by MJU »

Thank you so very much!

Post Reply