
La tabella 7.3.2.3.1 illustra il testo HTML di una pagina contenente un
form.
Innanzi tutto si può notare che i tre attributi principali del form sono
presenti in questa tag:
<form name="form1" method="post" action="esform.htm">
Si noti che:
• la form è inserita in una tabella; il primo dato della tabella è costituito
da una figura chiamata “Unit.gif” che attraverso il tag <a href…> si
collega alla pagina detail.htm. Cliccando con il mouse sulla figura, il
WebGate visualizzerà la nuova pagina detail.htm;
• il dato successivo della tabella visualizza la temperatura utilizzando il
tag <%var(1,2,1)%>.
• il penultimo tag <TD> comprende una casella di testo per modificare
il valore della variabile analogica 7 del dispositivo numero 2; 12.4 e
13.2 sono i valori minimo e massimo ammessi per quella variabile:
<input type="text"
name="?script:var(1,2,7,12.4,13.2)"
...value="<%var(1,2,7)%>">
Questa sezione descrive il nome e il valore del tag.
name:
La stringa del nome è composta da due campi: un “header”
e un “campo comando” come è possibile vedere nella tabella
che segue:
Tag di scrittura per casella di testo
Header
Campo comando
?script:
comando generico o var (x,y,z,min,max)
Tab. 7.3.2.3.1
L’header “?script:“ viene usato per segnalare al WebGate che l’utente
sta scrivendo il parametro, quando analizza il dato inviato.
In questo esempio, il parametro è una variabile di tipo [y] del
dispositivo [x] con indice di supervisione [z]; min. e max. sono infine i
valori minimo e massimo che definiscono il range di variazione
ammesso per quel parametro. E’ anche possibile usare uno degli altri
comandi disponibili. La lista dei comandi disponibili si trova nella
documentazione di configurazione.
Quando l’utente digita un valore per questa variabile nella casella di
testo, il WebGate elabora il comando utilizzando quel valore, come se il
comando fosse stato inviato dalla consolle interfaccia RS232.
value:
Impostando il valore con il “tag di visualizzazione” è possibi
le visualizzare anche il risultato del comando inviato.
L’ultimo tag nella tabella <TD> include il pulsante:
<input type="
submit
" name="Button1" value="Change">
Poiché il valore input type è impostato a “submit”, l’utente deve inviare
la form cliccando sul pulsante.
Una volta che il valore è stato immesso nella casella di testo è anche
possibile inviarlo con il tasto di invio (ø).
AVVERTENZA:
a volte ci possono essere ritardi nello scaricare la
pagina specificata dall’attributo ACTION dopo aver immesso un nuovo
valore per le variabili del dispositivo. Tale ritardo è dovuto al
meccanismo di comunicazione: il WebGate invia al dispositivo un
messaggio con il nuovo valore, attraverso la linea seriale RS485 e
quindi attende al massimo 30 secondi per controllare l’avvenuta
impostazione del nuovo valore. Se la comunicazione non va a buon
fine, o si supera questo tempo massimo,il WebGate torna alla pagina
HTML con il vecchio valore della variabile. Ad esempio, la Fig. 7.3.2.3.2
mostra cosa potrebbe visualizzare il browser durante un ritardo nella
comunicazione per la modifica del setpoint dell’“IR32 cold”.
La Fig. 7.3.2.3.3 visualizza la pagina dopo che è stata scaricata.
Table 7.3.2.3.1 shows the HTML text of a page having a form.
First you can observe the three main attributes of the form into its tag:
<form name="form1" method="post" action="esform.htm">
Note that:
• the form content is a table; the first table data is a figure called
“Unit.gif” linked by <a href…> tag to the page detail.htm. Clicking your
mouse on the figure from the browser, the WebGate will send the
new page detail.htm;
• a following table entry displays a temperature using the tag
<%var(1,2,1)%>.
• the <TD> tag before the last includes a Text-Box field used to change
the value of the analog variable 7 of the device number 2; 12.4 and
13.2 are the minum and maximum value for that variable:
<input type="text"
name="?script:var(1,2,7,12.4,13.2)"
...value="<%var(1,2,7)%>">
This section describes the name and value of this tag.
name: The name string is composed by two fields: an “header” and a
“command field” as you can see in the following table:
Writing tag for text-boxes
Header
Command-field
?script:
generic command or var(x,y,z,min,max)
Tab. 7.3.2.3..2
The header “?script:“ is used to signal to WebGate that the user is
writing the parameter, when it parses the submitted data.
In this example the parameter is a type[y] variable of device[x] having
supervision index[z]; min and max are its minimum and maximum
values that define the variation range allowed for that parameter. You
can also use one of the other available commands. Refer to the
configuration documentation to have a list of the available commands.
When the user digits a value for this variable into the text-box, the
WebGate parses the command using that value, as if the command
has been sent using the RS232 console interface.
value:
Setting the value using the “visualization tag”, you can
also see the result of the command sent.
The last table data tag <TD> includes the button using:
<input type="
submit
" name="Button1" value="Change">
As the input type is set to “submit” you will submit the data form by
clicking on the button.
Once the value has been digitised into the text-box, you can also send
it using the enter key (ø).
WARNING:
sometimes you may observe a delay during the download
of a page specified in the ACTION attribute, after a new value is
entered for devices variables. This delay is due to the communication
mechanism: WebGate sends to the device, through the RS485 serial
line, an appropriate message reporting the new value, and it will wait at
most 30 seconds to check if the setting of the new value has occured.
If this communication fails, or if the max. time has been exceeded,
WebGate will return the HTML page with the old variable value. For
example, Fig. 7.3.2.3.2 shows what the browser may display during the
communication delay, due to the change of an “IR32” cold setpoint.
Fig. 7.3.2.3.3 report the page after the page download ended.
28
Manuale WebGate - cod. +030220230 rel. 1.0 - 16.09.2003