Saving variable from a web server in a txt file (client side)
Saving variable from a web server in a txt file (client side)
Hello!
I'm running a web server with a PIC32MX microprocessor running on FreeRTOS. I'm using java scripting to refresh variable from server.
Now i should save these variables on a text file client side.
Please, can you help me?
Thank you!
MM
I'm running a web server with a PIC32MX microprocessor running on FreeRTOS. I'm using java scripting to refresh variable from server.
Now i should save these variables on a text file client side.
Please, can you help me?
Thank you!
MM
This discussion has been closed.
Replies
Allan
Allan
Thank you for the answers!
[code]
~inc:header.inc~
Parametri ERMES
Versione Stack: ~version~
Data compilazione: ~builddate~
...Lavori in corso! In questa pagina verranno visualizzati i parametri del computer di bordo...
Errore:
La connessione con il computer di bordo ERMES è andata persa!
CAN2 TX
?
CAN1 RX
?
LM70 Temp (SPI1 RX)
?
LM70 Temp (SPI2 RX)
?
TC1047A Temp
?
Current tlm
?
Flash Read
?
Oscillator
?
Whatch Dog
?
Latch-Up
?
<!--
// Parses the xmlResponse from status.xml and updates the status box
function aggiornaStato1(xmlData) {
var mainstat1 = document.getElementById('display1').style.display;
var loadstat1 = document.getElementById('loading1').style.display;
// Check if a timeout occurred
if(!xmlData)
{
mainstat1 = 'none';
loadstat1 = 'inline';
return;
}
// Make sure we're displaying the status display
mainstat1 = 'inline';
loadstat1 = 'none';
// Aggiorna variabile can1rx
document.getElementById('can1tx').innerHTML = getXMLValue(xmlData, 'can1tx');
document.getElementById('can2rx').innerHTML = getXMLValue(xmlData, 'can2rx');
document.getElementById('spi1rx').innerHTML = getXMLValue(xmlData, 'spi1rx');
document.getElementById('spi2rx').innerHTML = getXMLValue(xmlData, 'spi2rx');
document.getElementById('tc1047a').innerHTML = getXMLValue(xmlData, 'tc1047a');
document.getElementById('Itlm').innerHTML = getXMLValue(xmlData, 'Itlm');
document.getElementById('NVMread').innerHTML = getXMLValue(xmlData, 'NVMread');
}
setTimeout("newAJAXCommand('testpanel.xml', aggiornaStato1, true)",100);
//-->
<!--
document.getElementById('hello').innerHTML = "~hellomsg~";
//-->
~inc:footer.inc~
[/code]
[code]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
DataTables example
@import "../../media/css/demo_page.css";
@import "../../media/css/demo_table.css";
$(document).ready(function() {
var oTable = $('#example').dataTable( {
"bProcessing": true,
"sAjaxSource": "arrays.txt"
} );
} );
DataTables AJAX source example
Preamble
Although DataTables is built from the principle of progressive enhancement, it is often useful to be able to
construct a table from an AJAX source. This can be done in one of two ways - either using the aData initialisation parameter which
takes an array of data, or using the sAjaxSource initialisation parameter which will have DataTables go to that source with an XHR call
and load data from there. This example shows the latter method in action. DataTables expects an object with an array called "aaData" with the
data source.
Live example
Rendering engine
Browser
Platform(s)
Engine version
CSS grade
Rendering engine
Browser
Platform(s)
Engine version
CSS grade
[/code]
Starting from a swf_path.html, now I can retreive and manual save webserver variable.
[code]
~inc:header.inc~
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
TableTools example
@import "media/css/demo_page.css";
@import "media/css/demo_table.css";
@import "media/css/TableTools.css";
$(document).ready( function () {
$('#example').dataTable( {
"sDom": 'T<"clear">lfrtip',
"oTableTools": {
"sSwfPath": "media/swf/copy_csv_xls_pdf.swf"
}
} );
} );
TableTools example - setting SWF path
Live example
Rendering engine
Browser
Platform(s)
Engine version
CSS grade
Rendering engine
Browser
Platform(s)
Engine version
CSS grade
?
Internet Explorer 4.0
Win 95+
4
X
Trident
Internet Explorer 5.0
Win 95+
5
C
Trident
Internet Explorer 5.5
Win 95+
5.5
A
function aggiornaStato1(xmlData) {
document.getElementById('adc10an0').innerHTML = getXMLValue(xmlData, 'adc10an0');
}
setTimeout("newAJAXCommand('testpanel.xml', aggiornaStato1, true)",100);
//-->
[/code]
Now the question is...
Is there anyway to automatic save on file the table?
Thanks so much!
MM
When I save data or copy it I can't see the variable values:
[quote]
Valore Parametro Note
? ADC canale 0 ADC Vref
? ADC canale 1 sensore TC1047A
? ADC canale 3
? ADC canale 4
? ADC canale 5
? ADC canale 6
? ADC canale 7
? ADC canale 8
? ADC canale 9
? ADC canale 10
? ADC canale 11
? ADC canale 12
? ADC canale 13
? ADC canale 14
? ADC canale 15
Valore Parametro Note
[/quote]
Any idea about???
I'm using this ? to refresh the value passed from the server, but when I save the file I can't see the value displayed on screen, but only this "?".
[code]
function aggiornaStato1(xmlData) {
document.getElementById('adc10an0').innerHTML = getXMLValue(xmlData, 'adc10an0');
}
setTimeout("newAJAXCommand('testpanel.xml', aggiornaStato1, true)",100);
//-->
[/code]