Shop OBEX P1 Docs P2 Docs Learn Events
Writing to Pink RAM and Flash memory in one send — Parallax Forums

Writing to Pink RAM and Flash memory in one send

skylightskylight Posts: 1,915
edited 2007-06-12 21:46 in General Discussion
I am writing Values to variables on the Pink using the suggested Post Action with no problems(thanks· mhammer and QuattroRS4·for your previous help), these values only write to the Ram and·I would like the value to write to the Flash variable at the same time so that the values are stable in case of a power cut.
I know I can do it through the VVshow.htm page clicking on the update flash link and then putting the value in again and send but i would really like in·the html code to write to both the RAM and flash in one hit.
I viewed the source for the update flash page but can't see the actual command for writing to flash and how i could incorporate this into the code below, for instance is the variable Nb_var00 a Ram only variable and flash is something like Nb_flvar00? If this is the case, then can i have the line:

<Input name= "Nb_var10"and"Nb_flvar00" type="Radio" Value="On">Turn On Variable<BR>

I am able to update several variables in Ram at one send so I imagine this should be possible in both Ram and Flash together?

<HTML>
<HEAD>
<TITLE>Radio Buttons</TITLE>
</HEAD>
<BODY>
Current State of Variable 10: <FONT Color="RED"><B><Nb_var10></B></FONT>
<Form method="Post" Action="/Radio.html">
<Input name="Nb_var10" type="Radio" Value="On">Turn On Variable<BR>
<Input name="Nb_var10" type="Radio" Value="Off">Turn Off variable<BR>
<Input Type="Submit">
</FORM>
</BODY>
</HTML>

Thanks for any help with this

Comments

  • brepsbreps Posts: 6
    edited 2007-04-27 22:17
    i forgot how they updated the flash as I only got to play with mine for a few minutes before I accidently disabled it. But I'm sure if they use 2 different variables, then you could add some javascript to your html page to update them dynamically.

    If you could post the update flash page source I would be able to tell you how and create something very quickly for you.
  • skylightskylight Posts: 1,915
    edited 2007-05-01 13:18
    Thanks breps, the need to use flash mem has now gone away as the pink will be run from a UPS now.
  • Brian CarpenterBrian Carpenter Posts: 728
    edited 2007-06-12 05:29
    skylight, Did you ever get this figured out?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔


    It's Only A Stupid Question If You Have Not Googled It First!!
  • skylightskylight Posts: 1,915
    edited 2007-06-12 12:22
    No I didn't Brian, although it's not an issue anymore I would still like to know how to do it if possible.
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2007-06-12 14:22
    Have either of you attempted to use the code that the Modify Variables page uses to write the default value? If you look at the source code for the Modify Variables page (or just look at the link used to set default values) you’ll see if looks something like this:

    http://xx.xx.xx.xx/VV_Default.htm?00

    This is used to set the default value (the code actually takes you to another page). From the page you’re on the code involved is listed below.

    <FORM ACTION="DEFAULTSET.HTM " METHOD=POST>
    <H1>Set new power on default value for Nb_var01</H1>
    <input type=hidden name=variable_name value="01"><INPUT NAME="NewVal" TYPE="text" SIZE="64" VALUE="NA" >
    </B><BR><BR><INPUT TYPE="submit" value="Submit New Default Value">
    </FORM>

    Here’s where my HTML skills could be a little better. It looks like it’s doing a POST to DEFAULTSET.HTM, but the reference (which variable) may be obtained by the page. If you look it says:

    <input type=hidden name=variable_name value="01"><INPUT NAME="NewVal" TYPE="text" SIZE="64" VALUE="NA" >

    This may also provide what is needed…This would need to be tested. Anyone game? I may be able to try it later in the week if not. Take care.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
  • skylightskylight Posts: 1,915
    edited 2007-06-12 17:16
    Hi Chris,

    Whilst investigating the problem back then I found the same as you suggest·and came to the conclusion that there are 20 stored pages to do the writing to flash, unfortunately there is a problem in that I couldn't work out the way the page numbering worked ie i tried to change the number in the address bar to match the variable number but how this could be put into the form post action I havn't got a clue. It's a problem with having the two types of variables on different pages how do you direct the post action to cover two different html pages?

    Also the fact that there is another level of interaction sort of defeats the simplicity i'm trying to build into the user interface, I was hoping one click of a button would write both Ram and Flash variables in one hit.

    As brep suggested it may be a case of some java script executing both post actions from one button press? I have no idea how to write in Java.

    Although the writing to flash locations wouldnt be on a day to day basis I feel that the level of writing could be an issue in a few years time with eeprom burnout so the route taken with protecting Ram by UPS is probably the most stable route anyway.

    With stating the above an interesting point occurred, would the pink have a form of rotation of locations controller like some usb flash drives have, so that say Var 01 wouldn't always be the same physical location in eeprom?
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2007-06-12 17:57
    That’s why I was wondering if the variable name listed above would have the action. And as for doing both things at once…When you set the default value it automatically affects the RAM version (at least in the Modify Variables Page). So you shouldn’t need to do both actions. Since the module wasn’t designed with this in mind it may be that it’s not possible, but it sure is worth exploring. I don’t know that Java is required. I would probably go with some other NV solution if data changed often anyway, I don’t know how the data is organized, but I’m inclined to think it’s not rotated due to complexity of firmware. Take care.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
  • Brian CarpenterBrian Carpenter Posts: 728
    edited 2007-06-12 20:40
    skylight, why do you need to post to both the ram and the flash? shouldn't just the flash be adequete (sp?)

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔


    It's Only A Stupid Question If You Have Not Googled It First!!
  • skylightskylight Posts: 1,915
    edited 2007-06-12 21:46
    I think there may be confusion over what I was trying to achieve which is my fault for not making it clearer, on reading my original post again I can see where I confused readers.

    On the user interface page I have several radio buttons affecting·many different variables, these are sent by the action of a "send" button.
    ·What i wanted was a mixture of flash and ram variables·(not the same variable set in both flash and ram)·set by this one send action.

    Ideally had the pink been able to update all·100 variables into flash then that would have been the route taken but as i am limited to just the first 20 variables being able to be "flashed"·I was going to assign the most important data to those locations and take my chances with the rest of the data in Ram.

    As it now stands I hopefully will have·connection to a UPS supply circuit·so the worry of lost data has gone away.

    Although my demonstration at work was very successful with my local management pleased with the results, The project is now at the mercy of the accountants and those that make corporate decisions as to whether I or Special Projects continue with the idea, If they decide to hand over the project to the SP dept I can see it being totally redesigned and bearing no resemblance to the original, as that is what they tend to do when they take over any ideas, they like to make them their own.eyes.gif
Sign In or Register to comment.