Jump to content

Mark Wheeler

  • Posts

  • Joined

  • Last visited

Previous Fields

  • Languages

Profile Information

  • Location
  • Interests
    Pic Micro
    Making interesting toys for my kids to distroy..

Mark Wheeler's Achievements


Newbie (1/7)



  1. Just an update on my problem. I have used Wireshark to look at the data to and from the Web Server and I see the problem but don’t know how to fix it. When the form is submitted 1 submit > data to the web server requesting a parameter 2 response from the server with current data in RAM but this is not the requested parameter but the previous parameter from the last request. 3 submit > data to web server requesting a parameter 4 response from the server with the updated value in RAM from my request in step 1 The action between the HMS module has to get the data from the attached I/O and populate the RAM on the HMS module but this cannot happen in one submit of the form. So it appears the only way is to submit the form twice but I’'m not sure how to do that.
  2. HI DavejI have been away for a few weeks and tonight was my first time I have had chance to look at my project.I think I may have narrowed the problem down to the input fields.I think what is happening is that the fields are holding the data from the previous submit, it's like the input fields are being cached in some way but i'm not entirely sure. <form action="testme.html" method="post" id="testme" > <input type="text" id="read" name="read" value="<?--#exec cmd_argument='printf("%i",InReadUword(44))'-->"></input> <input type="text" name="write" id="write"></input> <?--#exec cmd_argument='scanf("write", "%u", OutWriteword( 0 ))'--> <input type="submit" value="Submit"></input>I'm not sure if the is a way to get around this.Once again thanks for your help, I did call HMS but not much luck i'm afraidMark
  3. Hi Davejthey just list the funtions in the manual and not much detailI put a call in today so i am awaiting a reply.still trying a few things, i will update thepost when i have something.Thanks for your help on this DavejMark
  4. Hi DavejThese commands are used to read and write to the web server.printf is used to display data read from the web server.scanf reads the contents of the nameed input box and writes it to the server.You will see that the Read input box is updated after the second time the submit button is pressed.Mark
  5. Hi Davej Here is a cut down version of my code The input box on the left is the value read from the server The input box on the right is the value to be written to the server. If you enter 200 in the write box and hit sumit the value will be sent to the server You will see that the read input box will still read the previous value. Hit the submit button again and you will see the value 200 appear. If you do get a spare moment and would like to take a look at the page on my test module <!DOCTYPE html><head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>testme</title></head> <body> <form action="testme.html" method="post" id="testme" > <input type="text" id="read" name="read" value="<?--#exec cmd_argument='printf("%i",InReadUword(44))'-->"></input> <input type="text" name="write" id="write"></input> <?--#exec cmd_argument='scanf("write", "%u", OutWriteword( 0 ))'--> <input type="submit" value="Submit"></input> </form> </body></html>
  6. HI DaveJI really appreciate your help on this one as my knowledge of HTML is just as a beginer and i'm not really clear on the event handling on the Web server.The Embedded Web server is part of a module called an Anybus S interface from HMS Industrial Networks. The module fits into a piece of your own hardware to allow the hardware to connect to an industrial network, In this case I have the board in a weighing system.the module ishttp://www.hms.se/products/products.asp?PID=94&ProductType=Anybus-SThe actual delay will be from the weighing harware updating the duel port RAM. When the weighing hardware is written to by the Anybus Module (Web Server) it will respond around 800mS later. The delay causses the Web Sever on the Anybus module to refresh before the update from the duel port RAM.When I write to the server and get the "write OK" back in my page can I capture this and trigger a function which I can then send the read command to the Web Server?Once again thanks for your interst and help with this problem.Mark
  7. Hi DaveJThanks very much for the reply.The web server is just reading old data in the RAM because the RAM is slow to update the web server hence the delay.On the second time the submit button is pressed the data has been updated in the RAM so the Web server reads the updated data.When I submit the form I do get a responce back in the form that states "Write OK", is it possible to capture that returned status and maybe then I could send the read function to the server with the <?--#exec cmd_argument='printf("%i",InReadUword(44))'--> to get the updated data ?Mark
  8. Here is a niggling problem I have with an embedded web server.The issue i am having is when I submit my form the form data is submitted to the web server, the web server updates a duel port RAM chip and will then read from that duel port RAM. The problem is the action of reading and writing to the duel port RAM causes a delay in data being passed back to and Web Server.If I write for example the value selected in the option list and submit the form the value is written to the server and when the form reloads it attempt to read the values written from the duel port RAM. The problem is that I always get the previously stored value because the Web server updates quicker than the RAM updates. If I hit the submit button twice the value is read back fine.I put in a breakpoint in the ReadReadBlock but it shows the previous read so I know the problem is due to the slow update from the RAM to the Web server.How can I get around the delay between submitting the form and reading the data back when the form loads.Below is my HTML and Javascript and was hoping that something could give me some pointers.Write to server function is<?--#exec cmd_argument='scanf("parameter", "%u", OutWriteword( 0 ))'-->Read from server function is<?--#exec cmd_argument='printf("%i",InReadUword(44))'-->Many thanks <!DOCTYPE html><head><link rel="stylesheet" type="text/css" href="../css/styles.css" media="screen"><title>BW500</title><script type="text/javascript" src="js/convert.js"></script><script>window.addEventListener('load',ReadReadBlock)</script></head><body><form action="test.html" method="post" id="spa" ><input type="text" id="r_parameter" name="r_parameter"value="<?--#exec cmd_argument='printf("%i",InReadUword(44))'-->"></input><input type="text" id="r_dp" name="r_dp"value="<?--#exec cmd_argument='printf("%i",InReadUword(54))'-->"></input><input type="text" id="r_priindex" name="r_priindex"value="<?--#exec cmd_argument='printf("%i",InReadUword(46))'-->"></input><input type="text" id="r_valueread" name="r_valueread"value="<?--#exec cmd_argument='printf( "%d",InReadUlong(50))'-->"></input><select name="parameter" id="parameter" onChange="WriteWriteBlock()"><option value="911">mA output</option><option value="914">mA input Value</option><option value="918">Speed Frequency</option><option value="940">Load Cell mV</option><option value="943">A/D Reference</option><option value="367">Direct Zero</option><option value="368">Direct Span</option><option value="377">Inital Zero</option><option value="378">Inital Span</option><option value="950">Zero Register</option><option value="951">Span Register</option><option value="341">Days of Service</option><option value="948">Error Log</option></select><select name="pri" id="pri"><option value="1">1</option><option value="2">2</option><option value="3">3</option><option value="4">4</option><option value="5">5</option><option value="5">5</option></select><input type="hidden" name="dp" id="dp"></input><input type="submit" value="Submit"></input></form><?--#exec cmd_argument='scanf("parameter", "%u", OutWriteword( 0 ))'--><?--#exec cmd_argument='scanf("priindex", "%u", OutWriteword(2))'--><?--#exec cmd_argument='scanf("dp", "%u", OutWriteword(10))'--></body></html> function ReadReadBlock(p,pr,d,value_in){p= document.getElementById('r_parameter').value;pr= document.getElementById('r_priindex').value;d = document.getElementById('r_dp').value;value_in= document.getElementById('r_valueread').value;switch (p){case "911": /mA output/document.getElementById('parameter').selectedIndex = 0;document.getElementById("pri").disabled = false;document.getElementById("r_dp").value = 2;d=2;break;case "914": /mA input/document.getElementById('parameter').selectedIndex = 1;document.getElementById("pri").disabled = false;document.getElementById("r_dp").value = 2;d=2;break;case "918": /Speed Input/document.getElementById('parameter').selectedIndex = 2;document.getElementById("pri").disabled = false;document.getElementById("r_dp").value =2;d=2;break;case "940":/Loadcell mV/document.getElementById('parameter').selectedIndex = 3;document.getElementById("pri").disabled = false;document.getElementById("r_dp").value = 2;d=2;break;case "943": /AD Referonce/document.getElementById('parameter').selectedIndex = 4;document.getElementById("pri").disabled = false;document.getElementById("r_dp").value = 0;d=0;break;case "367": /Direct Zero/document.getElementById('parameter').selectedIndex = 5;document.getElementById("pri").disabled = true;document.getElementById("r_dp").value = 0;d=0;break;case "368":/Direct Span/document.getElementById('parameter').selectedIndex = 6;document.getElementById("pri").disabled = false;document.getElementById("r_dp").value = 0;d=0;break;case "377": /Inital Zero/document.getElementById('parameter').selectedIndex = 7;document.getElementById("pri").disabled = false;document.getElementById("r_dp").value = 0;d=0;break;case "378":/Inital Span/document.getElementById('parameter').selectedIndex = 8;document.getElementById("pri").disabled = false;document.getElementById("r_dp").value = 0;d=0;break;case "950": /Zero Register/document.getElementById('parameter').selectedIndex = 9;document.getElementById("pri").disabled = false;document.getElementById("r_dp").value = 0;d=0;break;case "951":/Span Register/document.getElementById('parameter').selectedIndex = 10;document.getElementById("pri").disabled = false;document.getElementById("r_dp").value = 0;d=0;break;case "341": /Days of Service/document.getElementById('parameter').selectedIndex = 11;document.getElementById("pri").disabled = true;document.getElementById("r_dp").value = 0;d=0;break;case "948": /error log/document.getElementById('parameter').selectedIndex = 12;document.getElementById("pri").disabled =false;document.getElementById("r_dp").value = 0;d=0;break;}switch (d){case 0:document.getElementById("r_valueread").value=value_in;break;case 1:document.getElementById("r_valueread").value=value_in/10;break;case 2:document.getElementById("r_valueread").value=value_in/100;break;case 3:document.getElementById("r_valueread").value=value_in/1000;break;}}
  9. thescientistMay I first say thankyou very much for your help and time you spent on the sample code, I managed with your help to find the problem.After loading your code and adding the server code I ended up with thinks almost working however I started to look at how the server is processing the saving and loading of the "setting.cfg" file.It appeared that the file would be read with the<?--#exec cmd_argument='IncludeFile("settings.cfg")'-->function and then immediately written with the<?--#exec cmd_argument='SaveToFile("settings.cfg","#",Overwrite)'-->I wondered if I moved the savetofile function to the HEADER<?--#exec cmd_argument='SaveToFile("settings.cfg","#",Overwrite)'-->it would seperate the two functions.With your modified code I downloaded it to the server and it worked.Once again thankyou for your help I very much appreciate it.Mark<!DOCTYPE html> <head> <?--#exec cmd_argument='SaveToFile("settings.cfg","#",Overwrite)'--> <title>Config Option Updater</title> <script> function readFileSettings(){ var readFile,designUnits,speedUnits; readFile = document.getElementById('settingsFile').value; console.log('readFile value => ' + readFile); designUnits = readFile.charAt(12); speedUnits = readFile.charAt(25); console.log('designUnits => ' + designUnits); console.log('speedUnits value => ' + speedUnits); document.getElementById('speedUnits').selectedIndex = speedUnits; document.getElementById('designUnits').selectedIndex = designUnits; document.getElementById('settingsFile').value=""; } window.addEventListener('load',readFileSettings); </script> </head> <body> <h2>Design Units</h2> <form action="test.html" method="post" id="test" name="test"> <select name="designUnits"id="designUnits"> <option value="0">T/h( tons / hour)</option> <option value="1">t/h (tonnes / hour)</option> <option value="2">LT/h (long tons) / hour</option> <option value="3">kg/h (kilograms / hour)</option> <option value="4">lb/h (pounds / hour)</option> <option value="5">kg/min (kilograms / minute)</option> <option value="6"> lb/min (pounds / minute)</option> </select> <h2>Design Speed Units</h2> <select name="speedUnits" id="speedUnits"> <option value="0">Feet/min</option> <option value="1">Metres/s</option> </select> <input type="hidden" name="settingsFile" id="settingsFile" value="<?--#exec cmd_argument='IncludeFile("settings.cfg")'-->"></input> <input type="submit" name="save"></input> </form> </body></html>
  10. Thanks very much for your reply thescientist I am using Firebug to debug and my file is being read into the "hidden" input field element. The data in the <input> id= "settingFile" value seems to have all of the text from the file when I look at the debug panel in Firebug. value="designUnits#3speedUnits#0save#Submit QuerysettingsFile# What I have found is the following. If I make a selection on the option list and hit submit the file is saved but the option list revert back to when the form was loaded. If I go to another page in my site and type in the url the "settings.html" I return back to the page and see the update of my option lists. I know this is my lack of knowledge but it seems that when the submit button is pressed my page does not reload or does not update the option lists. So I guess it's something to do with the way the page loads but i'm not entirely sure as I thought when the submit button is pressed the page would reload but I must be wrong. I don’t think I have the option of using PHP on this embedded web server but I could be wrong. Many thanks Mark
  11. I have been working on this problem for a while now and don’t seem to be able to find a solution and was wondering if someone could help. I have a form which is submitted and passes two form object values and saves them to a text file held on the server, this works ok. After the submit button is pushed the file is saved with the function <?--#exec cmd_argument='SaveToFile("settings.cfg","#",Overwrite)'--> I read back the contents of the file and try to set the "selectedindex" on my speedUnits and rateUnits option list, however the option lists "selectindex" does not seem to update. I use an "input" "hidden" text field to hold the contents of the text file which is read in with the function <?--#exec cmd_argument='IncludeFile("settings.cfg")'--> My main HTML and Javascript are shown below and I was hoping something could give me some pointers. The "settings.cfg" contains designUnits#3 speedUnits#0 save#Submit Query settingsFile# <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN""http://www.w3.org/TR...tml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"> <head> <meta http-equiv="content-type" charset="utf-8"> <link rel="stylesheet" type="text/css" href="css/styles.css" media="screen"> <title>Siemens BW500</title> <script type="text/javascript" src="js/convert.js"></script> </head> <body> <div id="outer_wrapper"> <div id = "wrapper"> <div id = "banner"> <h1>BW500</h1> </div> <div id ="logo"> <img src="images/logo_siemens.jpg"> </div> <div id ="topnav"> <ul> <li><a id="onlink" href='index.html'>Process</a></li> <li><a href='status.html'>status</a></li> <li><a href='control.html'>Control</a></li> <li><a href='PID.html'>PID</a></li> <li><a href='spa.html'>Parameters</a></li> <li><a href='Manuals.html'>Manuals</a></li> <li><a href='network.html'>Network</a></li> </ul> </div> <div id ="data"> <form action="settings.html" method="get" id="unitsSetup" name="unitsSetup"> <table> <tr> <td>Design Units</td> <td><select name="designUnits"id="designUnits"> <option value="0">T/h(tons / hour)</option> <option value="1">t/h (tonnes / hour)</option> <option value="2">LT/h(long tons) / hour</option> <option value="3">kg/h (kilograms / hour)</option> <option value="4">lb/h(pounds / hour)</option> <option value="5">kg/min (kilograms / minute)</option> <option value="6"> lb/min (pounds / minute)</option> </td> </tr> <tr> <td>Design Speed Units</td> <td><select name="speedUnits" id="speedUnits"> <option value="0">Feet/min</option> <option value="1">Metres/s</option> </td> </tr> <tr> <td><input type="submit" name="save"></input></td> </tr> </table> <input type="hidden" name="settingsFile" id="settingsFile"value="<?--#exec cmd_argument='IncludeFile("settings.cfg")'-->"></input> <script language="javascript" type="text/javascript">readFileSettings()</script> </form> <?--#exec cmd_argument='SaveToFile("settings.cfg","#",Overwrite)'--> </div> <div id ="copywrite"> <p>Copywrite</p> </div> </div> </div> </body> </html> The Javascript function "readFileSettings() is shown below. function readFileSettings() { var readFile,designUnits,speedUnits; readFile =document.getElementById('settingsFile').value; designUnits = readFile.charAt(12); speedUnits = readFile.charAt(25); document.getElementById('speedUnits').selectedIndex = speedUnits; document.getElementById('designUnits').selectedIndex = designUnits; }
  12. HI Dave Thanks for the hints I have my code working thanks to you. I changed my submit buttons to type "button" and pass the values in to the function that I need to write. { document.getElementById("t1").value = value_in; document.getElementById("resets").submit(); alert("Totalizer reset"); document.getElementById("t1").value =0; document.getElementById("resets").submit(); } Many thanks for your help
  13. I have noticed that I have to use input type as "submit" or the value of 256 or 512 is not written to the applicaton on the server. Your third suggestion may be the answer, I will take a look. Many thanks for your help and suggestions.
  14. It’s my first post so here I go. I have been taking a course on HTML and I’m already familiar with C. I need to submit a value from a hidden input field when the form is submitted, this works fine, however what I need to do is submit a new value 2 seconds after the first one has been submitted. I need to make this happen without any additional buttons. The code below (without CSS) writes the value to my application just fine but I dont know how to submit a second value 2 seconds later. Hoping someone can help <!DOCTYPE html><html><!-- InstanceBegin template="/Templates/BW500.dwt" codeOutsideHTMLIsLocked="false" --> <head> <!-- InstanceBeginEditable name="doctitle" --> <title>BW500</title> <!-- InstanceEndEditable --> <link rel="stylesheet" type="text/css" href="css/styles.css" media="screen"> <script type="text/javascript" src="js/convert.js"></script> </head> <body> <div id="outer_wrapper"> <div id = "wrapper"> <div id = "banner"> <h1>BW500</h1> </div> <div id ="logo"> <img src="images/logo_siemens.jpg"> </div> <div id ="topnav"> <ul> <li><a href='index.html'>Process</a></li> <li><a href='status.html'>status</a></li> <li><a id="onlink" href='control.html'>Control</a></li> <li><a href='PID.html'>PID</a></li> <li><a href='spa.html'>Parameters</a></li> <li><a href='Manuals.html'>Manuals</a></li> <li><a href='network.html'>Network</a></li> </ul> </div> <div id ="data"> <table id="table_data"> <!-- InstanceBeginEditable name="data" --> <form action="control.html" method="post" id="resets"> <tr> <td>Reset Total 1</td> <td><input type="submit" name="Reset"value="256"></input></td> </tr> <tr> <td>Reset total 2</td> <td><input type="submit" name="reset"value="512"></input> </td> </tr> <script language="JavaScript">control(<?--#exc cmd_argument='printf("%i",outReadUword(16 ))'-->)</script> <?--#exec cmd_argument='SsiOutput( "", "Write Failed" )'--> <?--#exec cmd_argument='scanf("reset", "%u", OutWriteword( 16 ))'--> <?--#exec cmd_argument='printf( "%i",outReadUword(16 ))'--> </form> <!-- InstanceEndEditable --> </table> </div> <div id ="copywrite"> <p>Copywrite Siemens Canada Limited</p> </div> </div> </div> </body><!-- InstanceEnd --></html> control.html
  • Create New...