Figure 75. Customized Numeric-Monitor Web Page
CRBasic Example 62. Custom Web Page HTML
'This program example demonstrates the creation of a custom web page that resides in the
'CR1000. In this example program, the default home page is replaced by using WebPageBegin to
'create a file called default.html. The graphic in the web page (in this case, the Campbell
'Scientific logo) comes from a file called SHIELDWEB2.JPG. The graphic file must be copied to
'the CR1000 CPU: drive using File Control in the datalogger support software. A second web
'page is created that contains links to the CR1000 data tables.
'NOTE: The "_" character used at the end of some lines allows a code statement to be wrapped
'to the next line.
Dim Commands As String * 200
Public Time(9), RefTemp,
Public Minutes As String, Seconds As String, Temperature As String
DataTable(CRTemp,True,-1)
DataInterval(0,1,Min,10)
Sample(1,RefTemp,FP2)
Average(1,RefTemp,FP2,False)
EndTable
'Default HTML Page
WebPageBegin("default.html",Commands)
HTTPOut("<html>")
HTTPOut("<style>body {background-color: oldlace}</style>")
HTTPOut("<body><title>Campbell Scientific CR1000 Datalogger</title>")
HTTPOut("<h2>Welcome To the Campbell Scientific CR1000 Web Site!</h2>")
HTTPOut("<tr><td style=" + CHR(34) +"width: 290px" + CHR(34) + ">")
HTTPOut("<a href=" + CHR(34) + "http://www.campbellsci.com" + CHR(34) + ">")
HTTPOut("<img src="+ CHR(34) +"/CPU/SHIELDWEB2.jpg"+ CHR(34) + "width=" + _
CHR(34) +"128"+CHR(34)+"height="+CHR(34)+"155"+ CHR(34) + "class=" + _
CHR(34) +"style1"+ CHR(34) +"/></a></td>")
HTTPOut("<p><h2> Current Data:</h2></p>")
HTTPOut("<p>Time: " + time(4) + ":" + minutes + ":" + seconds + "</p>")
293