NOVUS Web Server – WS10 User Manual
Page 18

Web Server – WS10
NOVUS AUTOMATION
18/33
The MAIN.HTM page can not display register values. To display dynamic data in the start page, define frames inside MAIN.HTM and include
register references in separate HTML files. The MAIN.HTM page can also switch automatically to the page which actually displays the register
values. See example of redirection to DATA.HTM below:
<html>
<head>
<meta http-equiv="REFRESH" content="0;URL=data.htm">
</head>
</html>
The example page 2 uses Java Script to format date and time information from the WS10 real time clock, and to execute mathematical operations
before presenting the data. This is an important feature, since sometimes the data measured or acquired by the WS10 is not in the desired
engineering unit for exhibition. The usage of Java scripts allows formatting of the data before presenting the page. In this example a link to other
page is also created.
<html>
<head>
<title>Monitor</title>
<META HTTP-EQUIV="Refresh" CONTENT="3">
</head>
<body>
<center><font face="Arial" color="navy" size=+1><b>
<script language="JavaScript" type="text/JavaScript">
<!--
var month = new Array('jan', 'feb', 'mar', 'apr', 'may', 'jun', 'jul', 'aug', 'sep', 'oct', 'nov', 'dec');
function cMonth(x)
{
if (x > 0 && x < 13)
return month[x - 1];
else
return '';
}
function cNum(x)
{
if (x >= 0 && x < 10)
return '0' + x;
else
return '' + x;
}
document.write(cMonth(
%_INTERNAL_/_MONTH%
)+',
%_INTERNAL_/_DAY%
, '+ cNum(
%_INTERNAL_/_YEAR%
)+'<br>');
document.write(cNum
(%_INTERNAL_/_HOUR%
)+':'+cNum
(%_INTERNAL_/_MIN%
)+':'+cNum
(%_INTERNAL_/_SEC%
));
document.write('<br><br>FT1: '+
%_INTERNAL_/FT1%
/9+'<br>');
document.write('FT1 Total: '+Math.round(
%_INTERNAL_/FT1TOT%
/10)+'<br>');
//-->
</script>
</b></font>
<br>
<br>
<a href=modif.htm>Modify</a></center>
</body>
</html>
Example 2 – Usage of Java Script for formatting and math operations on tag values