Question for SimpleLan users

matherp

Senior Member
Hi all

I'm using a Simplelan to remotely display information from a 28X1 based logging system and to control the functioning of the logging system. The latter works by reading variables from the SimpleLan that are updated using a web form - so far so good.

The issue I have is that I want to use a checkbox or similar as a momentary switch to reset the max/min temperatures in the logger. However, after I submit a form from the SimpleLan the check box input variable continues to read the "checked" value even if I overwrite it from the picaxe and even though it's default in the form is not checked.

e.g.

Code:
hserout 0, ("!AT0R20")
hserin 0,[1000,timout],0,1
ptr=0
if @ptr="Y" then 
hserout 0,("!AT0W20:","N")
' reset the max mins etc.
endif
in this case AT0R20 continues to read "Y" until the form is re-submitted. I assume this is bug/limitation of the SimpleLan or of my limited understanding of html but is there a way round this anyone has found other than maintaining a state variable in my code which seems as though it should be unnecessary and also means that a user has to explicitly submit a blank form before actioning the reset again.

Thanks in anticipation

Peter
 

papaof2

Senior Member
I suspect that you've been spoiled by HTML pages with active content that can respond immediately to checkboxes and the like.

The manual says "Receive data from HTML form GET messages", so the page will need to be resubmitted for the SimpleLAN to see any changes.

John
 

MORA99

Senior Member
The values from simplelan can only be read while the page is being sent, once its sent to the browser simplelan cannot change it anymore, so the values will be static untill you refresh the page.

However javascript can help, use of onClick to trigger code that downloads new content from simplelan, either as a refresh or in a different (invisible) frame.
Ofcause then its no more so simple :)

However you need some onclick event on the checkbox, if the user is not to submit the form to send it to simplelan.
Easy solution is using a button/link that reloads the page.
Hard solution is accessing the simplelan trough javascript (making a hidden request), thats how AJAX makes dynamic pages, where forums get updated without (visible) reloads, etc.
 
Top