beautypg.com

Campbell Scientific CR800 and CR850 Measurement and Control Systems User Manual

Page 171

background image

Section 7. Installation

171

 

CRBasic Example 32. HTML 

'NOTE: Lines ending with "+" are wrapped to the next line to fit on the printed page

'NOTE Continued: Do not wrap lines when entering program into CRBasic Editor.

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

("")

HTTPOut

("")

HTTPOut

("Campbell Scientific CR800 Datalogger")

HTTPOut

("

Welcome To the Campbell Scientific CR800 Web Site!

")

HTTPOut

("")

HTTPOut

("

CHR(34) + ">")

HTTPOut

("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) +"/>")

HTTPOut

("

Current Data:

")

HTTPOut

("

Time: " + time(4) + ":" + minutes + ":" + seconds + "

")

HTTPOut

("

Temperature: " + Temperature + "

")

HTTPOut

("

Links:

")

HTTPOut

("

CHR

(34) +"monitor.html"+

CHR

(34)+">Monitor

")

HTTPOut

("")

HTTPOut

("")

WebPageEnd

'Monitor Web Page

WebPageBegin

("monitor.html",Commands)

HTTPOut

("")

HTTPOut

("")

HTTPOut

("")

HTTPOut

("Monitor CR800 Datalogger Tables")

HTTPOut

("

CR800 Data Table Links

")

HTTPOut

("

CHR

(34) + "command=TableDisplay&table=CRTemp&records=10" + _

CHR

(34)+">Display Last 10 Records from DataTable CR1Temp

")

HTTPOut

("

CHR

(34) + "command=NewestRecord&table=CRTemp"+

CHR

(34) + _

">Current Record from CRTemp Table

")

HTTPOut

("

CHR

(34) + "command=NewestRecord&table=Public"+

CHR

(34) + _

">Current Record from Public Table

")

HTTPOut

("

CHR

(34) + "command=NewestRecord&table=Status" +

CHR

(34) + _

">Current Record from Status Table

")

HTTPOut

("

CHR

(34) +"default.html"+

CHR

(34) + ">Back to the Home Page _

")

HTTPOut

("")

HTTPOut

("")

WebPageEnd