主程序变量公众battery_voltage酒吧lic panel_temperature Public temperature 'EmailRelay() constants Const _EMAIL_ATTACHMENT = "" Const _EMAIL_SUBJECT = "Email Message" Const _EMAIL_TO_ADDRESS = "some.user@campbellsci.com" Const _CR_LF = CHR(13) & CHR(10) 'EmailRelay() variables Public email_message As String * 300 Public email_relay_server_response As String * 100 Public email_trigger As Boolean Public email_tx_success BeginProg Scan (1,Sec,3,0) Battery (battery_voltage) PanelTemp (panel_temperature,250) TCDiff (temperature,1,mV2_5C,1,TypeT,panel_temperature,True ,0,250,1.0,0) If temperature > 30 Then email_trigger = True EndIf NextScan SlowSequence Scan(1,sec,1,0) If email_trigger = True Then email_trigger = False 'reset my trigger email_message = "Warning!" & _CR_LF & _CR_LF email_message = email_message & "This is a automatic email message from the datalogger station " & Status.StationName & ". " email_message = email_message & "An alarm condition has been identified." & _CR_LF email_message = email_message & "The temperature is " & temperature & " degrees C." & _CR_LF email_message = email_message & "Datalogger time is " & Status.Timestamp email_tx_success = EmailRelay (_EMAIL_TO_ADDRESS,_EMAIL_SUBJECT,email_message,email_relay_server_response,_EMAIL_ATTACHMENT) EndIf NextScan EndProg
Baidu