Jump to content

Search the Community

Showing results for tags 'delay'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


  • W3Schools
    • General
    • Suggestions
    • Critiques
  • HTML Forums
    • CSS
  • Browser Scripting
    • JavaScript
    • VBScript
  • Server Scripting
    • Web Servers
    • Version Control
    • SQL
    • ASP
    • PHP
    • .NET
    • ColdFusion
    • Java/JSP/J2EE
    • CGI
  • XML Forums
    • XML
    • Schema
    • Web Services
  • Multimedia
    • Multimedia
    • FLASH

Find results in...

Find results that contain...

Date Created

  • Start


Last Updated

  • Start


Filter by number of...


  • Start





Website URL








Found 2 results

  1. 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;}}
  2. Hi all, I'd like to display a page of HTML after a short delay. My first approach, which works, was to enclose the HTML markup inside a document.write() function and call that function from setTimeout(), e.g. something like this: t1 = setTimeout("writePage()", 10000);...function writePage() {document.write("<h1>Hello World!</h1>");} But this can get quite complicated with a longer page with styling, as I'll have to escape all quote marks with a backslash, and also add line-continuation characters. And it really gets hairy if I want to include a navbar with its own document.write() functions within the HTML that's already nested within a document.write(). Is there a better way? Is there some way to implement a simple wait(n) function that just waits for n milliseconds before proceeding?
  • Create New...