
7. Creare una pagina Web personalizzata per
WebGate
7.1 Introduzione
Questo capitolo vi spiega come creare una semplice pagina Web, che
vi permetterà di monitorare e controllare i valori delle variabili di rete di
una rete locale (LAN) o di una rete WAN.
Si presuppone che abbiate una conoscenza di base del linguaggio
HyperText Markup Language (HTML).
Per inviare al browser pagine Web che visualizzino le variabili di rete,
dovete inserire alcuni “tag” speciali nel codice HTML della pagina Web.
Prima di inviare la pagina Web al browser, il server Web integrato nel
WebGate analizza la pagina alla ricerca di un tag speciale HTML che
indichi una variabile di rete o un parametro di configurazione. Il server
Web, quando invia informazioni al browser, sostituisce quindi i tag con
il valore attuale della variabile di rete.
E’ possibile creare pagine Web utilizzando qualsiasi elaboratore di
testo o editor HTML disponibile in commercio.
Tutti i parametri di tutti i controlli Carel su rete RS485 possono essere
monitorati e modificati mediante l’utilizzo di pagine Web.
7.2 Requisiti
Sono richiesti i seguenti requisiti software:
• Un’applicazione client FTP standard come SmartFTP
(www.smartftp.com) per caricare le pagine Web nel WebGate
• Un editor HTML, come Macromedia® DreamWeaver™
(www.dreamweaver.com).
• Microsoft® Internet Explorer™ (versione 5 o successiva) o Netscape
Communicator™ (versione 6 o successiva).
Avrete inoltre bisogno di alcune conoscenze di base dell’HyperText
Markup Language (HTML).
7.3 Creare Pagine Web
I file HTML per WebGate possono essere creati utilizzando qualsiasi
elaboratore di testo o editor HTML standard. Il server Web integrato
supporta la versione standard HTML per la definizione della struttura e
del formato della pagina Web, oltre ad alcuni tag speciali HTML per
richiamare elementi dinamici di dati ed elaborare form HTML.
I file HTML e grafici risiedono in alcune cartelle speciali della memoria
flash del WebGate. Per i file utente sono disponibili
approssimativamente 400 KB di spazio (vedi anche
File system
).
I file vengono letti e scritti nella memoria flash del WebGate utilizzando
il protocollo standard FTP su connessione IP (vedi
File Transfer
Protocol
).
Per visualizzare una pagina Web, digitate
http://192.168.0.250/mywebpage.htm (dove 192.168.0.250 è l’indirizzo
IP del WebGate) nella finestra URL del browser. Assicuratevi di usare
le maiuscole e le minuscole in modo corretto.
Se digitate solo l’indirizzo IP del WebGate si visualizzerà l’home page
precaricata oppure, se presente, la pagina DEFAULT.HTML.
AVVERTENZA.
La vostra home page va chiamata obbligatoriamente
DEFAULT.HTML. Se non avete nessuna pagina Web chiamata
DEFAULT.HTML, quando digitate l’indirizzo IP del WebGate apparirà la
pagina INDEX.HTML pre-caricata.
Tutti i parametri di tutti i controlli Carel su rete RS485 possono essere
monitorati e modificati mediante l’utilizzo di pagine Web.
7. Creating a custom Web page on the WebGate
7.1 Introduction
This chapter describes how to create a simple Web page which allows
you to monitor and control the values of network variables over a local
network (LAN) or wide area network (WAN).
It is assumed you have a basic understanding of the HyperText Markup
Language (HTML).
In order to serve Web pages that display the network variables to a
standard Web browser, you must insert some special “tags” in the
HyperText Markup Language of the Web page.
Before returning a Web page to the browser, the Web server
embedded in the WebGate parses the page searching for a special
HTML tag indicating a network variable or a configuration parameter
reference. The Web server, when returning information to the browser,
replaces so the current value of the network variable for this tag.
Web pages may be constructed with any off-the-shelf text or HTML
editor. All the parameters of all Carel controllers in RS485 can be
monitored and modified through Web pages.
7.2 Requirements
You will need the following software:
• A standard FTP client application such as SmartFTP
(www.smartftp.com) for uploading your Web pages into the WebGate
• An HTML editor, such as Macromedia® DreamWeaver™
(www.dreamweaver.com).
• Microsoft® Internet Explorer™ (version 5 or higher) or Netscape
Communicator™ (version 6 or higher).
You will need also a basic understanding of the HyperText Markup
Language (HTML).
7.3 Creating Web Pages
HTML files for the WebGate can be created with any standard text or
HTML editor. The WebGate embedded Web server supports standard
HTML for defining the structure and format of your Web page, as well
as some special HTML tags for retrieving dynamic data elements and
processing HTML forms.
HTML and graphic files reside in some special directories of the
WebGate flash memory. Approximately 400 KB of space is available for
user files (see
File system
).
Files are read and written to the WebGate flash memory using the
standard FTP protocol over IP connection (see
File Transfer Protocol
(FTP)).
To retrieve your Web page enter http://192.168.0.250/mywebpage.htm
(where 192.168.0.250 is the WebGate’s IP address) in the browser’s
URL window. Be sure to use the proper case; file names are case
sensitive.
If you enter only the WebGate’s IP address you will get the home page
preloaded by the factory or the DEFAULT.HTML page if it is present.
WARNING.
Your home Web page must be named DEFAULT.HTML. If
you don’t have any Web page named DEFAULT.HTML, the
INDEX.HTML factory preloaded page will be served when you will
enter the WebGate’s IP address.
All parameters of all Carel controllers on the RS485 network can be
monitored and modified through the usage of web pages
21
Manuale WebGate - cod. +030220230 rel. 1.0 - 16.09.2003