Writing to Pink RAM and Flash memory in one send
skylight
Posts: 1,915
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
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
If you could post the update flash page source I would be able to tell you how and create something very quickly for you.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
It's Only A Stupid Question If You Have Not Googled It First!!
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
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 Savage
Parallax Tech Support
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
It's Only A Stupid Question If You Have Not Googled It First!!
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.