EEprom Help

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

Moderator: Benj

Post Reply
User avatar
JLeith
Posts: 537
Joined: Wed Nov 14, 2012 7:49 pm
Location: British Columbia Canada
Has thanked: 146 times
Been thanked: 26 times
Contact:

EEprom Help

Post by JLeith »

Hi All

Need a liitle guidence on EEprom action.

I was reading posts and think I have it correct but the value is not storing in the EEprom.

Here is my events
The train runs loop 1 ( Button = 2) All good
The train runs Loop 2 ( Button = 3) All good
The tain runs Loop 3 ( The turn outs activate ) Button = 4
The train runs Loop 4 and now is directed to the Inside loop.
The power is turned off.
Now when the power is restored Button = 1
With the Train Turnouts active before the Power OFF the program needs to activate the Button 4 to switch back the Turnouts.
I think by storing the Button state into EEprom 1 when I read EEprom 1 Button shoud read the Value stored in the EEprom 1.

Action
Run the Flowcode see Button advance to Button = 2.
Stop Flowcode
Run Flowcode ----? - Button = 1 not the value that was in EEprom.

Flowcode add to this help.

John
Attachments
Train with Relay control.fcfx
(28.75 KiB) Downloaded 249 times

User avatar
acestu
Posts: 1720
Joined: Thu Dec 01, 2011 9:36 pm
Location: Macclesfield UK
Has thanked: 783 times
Been thanked: 223 times
Contact:

Re: EEprom Help

Post by acestu »

Hi Jleith,

I have just had a quick look at your chart, should your first eeprom macro be reading address 1 and not the variable value "button" ?

Thanks
Stuart

jleith.png
(40.86 KiB) Downloaded 4178 times
Laptop Mac Book Pro i7 retina El Capitan //// Tower/Intel i7-Windows 7 64 Bit, Toshiba i5 Laptop Windows 10
Computers are like air conditioners. They work fine until you start opening windows.

User avatar
JLeith
Posts: 537
Joined: Wed Nov 14, 2012 7:49 pm
Location: British Columbia Canada
Has thanked: 146 times
Been thanked: 26 times
Contact:

Re: EEprom Help

Post by JLeith »

Hello Stuart

I made the changes you suggested and still eeprom will not strore the value of 'Button" used to select the selections.

It is hard to see if the value of Button is being written to the eeprom. I can see variables but not eeprom.

Here is snap shot
Attachments
eeprom1.jpg
eeprom1.jpg (101.14 KiB) Viewed 6741 times

kersing
Valued Contributor
Valued Contributor
Posts: 2045
Joined: Wed Aug 27, 2008 10:31 pm
Location: Netherlands
Has thanked: 553 times
Been thanked: 1081 times
Contact:

Re: EEprom Help

Post by kersing »

John,

Your read macro content is still not right, check the screen shot Stuart provided on how to set the values. Once correctly filled the flowchart icon looks like this:
eeprom-button.PNG
(12.14 KiB) Downloaded 4158 times
To view the eeprom contents, open the eeprom1 tab in the console:
eeprom-console.PNG
(55.29 KiB) Downloaded 4158 times
“Integrity is doing the right thing, even when no one is watching.”

― C.S. Lewis

User avatar
JLeith
Posts: 537
Joined: Wed Nov 14, 2012 7:49 pm
Location: British Columbia Canada
Has thanked: 146 times
Been thanked: 26 times
Contact:

Re: EEprom Help

Post by JLeith »

Hello Kersing
Thank you for the clarity. I could not see the "Read(1) on Sturat's image.

I have made the change and I still can't seam to have the Button saved in EEprom1

I see it listed in EEprom1 when it reaches Loop 2

Is it that when the program starts up again I have the Variables set before it reads eeprom1.

My thought is it reads the Variable ( Button = 1 ) then a few steps down there is a read of Eeprom1 and it should cahnge Button from 1 to 2.

But it looks like when the program runs eeprom1 is refresshing.

See this picture of the steps.
Attachments
eeprom with action.png
(43.52 KiB) Downloaded 1437 times

kersing
Valued Contributor
Valued Contributor
Posts: 2045
Joined: Wed Aug 27, 2008 10:31 pm
Location: Netherlands
Has thanked: 553 times
Been thanked: 1081 times
Contact:

Re: EEprom Help

Post by kersing »

Take a look at the EEPROM properties, there are initialization settings in the properties.
“Integrity is doing the right thing, even when no one is watching.”

― C.S. Lewis

User avatar
JLeith
Posts: 537
Joined: Wed Nov 14, 2012 7:49 pm
Location: British Columbia Canada
Has thanked: 146 times
Been thanked: 26 times
Contact:

Re: EEprom Help

Post by JLeith »

Hi Kersing
I cleared the properties

Still not able to caputue the results of the Eeprom. It looks as if it is there but when I read it it does not put the value of eeprom1 into Button ?

Here is the next pictures
I hope the pictures capture the 1000 words.

I have placed a LCD list of Button 2 as it enters the loop.

I have aslo attatched the flowcode version 2 copy

John
Attachments
Train with Relay control V2.fcfx
(29.82 KiB) Downloaded 239 times
eeprom Clear.jpg
(167.36 KiB) Downloaded 1421 times

kersing
Valued Contributor
Valued Contributor
Posts: 2045
Joined: Wed Aug 27, 2008 10:31 pm
Location: Netherlands
Has thanked: 553 times
Been thanked: 1081 times
Contact:

Re: EEprom Help

Post by kersing »

John,

Your read macro is still wrongly configured. You need to have a macro call with:
Parameters: Address = 1. NOT Button=eeprom1::Read(1), just the number 1.
Return value: Button. Not empty like it is now.
“Integrity is doing the right thing, even when no one is watching.”

― C.S. Lewis

User avatar
JLeith
Posts: 537
Joined: Wed Nov 14, 2012 7:49 pm
Location: British Columbia Canada
Has thanked: 146 times
Been thanked: 26 times
Contact:

Re: EEprom Help

Post by JLeith »

Hello Kersing

I have it working 100% I missed the set of adding the 'Button" to the return field.

Thank you for your help. I now have a better understanding on the eeprom function.

John
Attachments
Mystery solved.png
(81 KiB) Downloaded 4098 times

User avatar
JLeith
Posts: 537
Joined: Wed Nov 14, 2012 7:49 pm
Location: British Columbia Canada
Has thanked: 146 times
Been thanked: 26 times
Contact:

Re: EEprom Help

Post by JLeith »

The eeprom Help
Attachments
Project Completed.jpg
Project Completed.jpg (15.18 KiB) Viewed 6673 times

Post Reply