Appendix B. Example Programs
B-5
'Main Program
BeginProg
'The following text is associated with the numeric response codes provided from the sampler after each
attempted ‘sample.
Response_List(1) = "No error"
Response_List(2) = "All samples complete"
Response_List(3) = "Low start battery (V<11.0 V)"
Response_List(4) = "Low run battery (V<10.5V)"
Response_List(5) = "Sampler vacuum timed out, no sample detected"
Response_List(6) = "Sample overflow detected"
Response_List(7) = "No sample liquid detected"
Response_List(8) = "Arm calibration error"
Response_List(9) = "Conductivity rod and Sample tube are shorted"
AutoRun=true 'initialize to True but the user can stop the sampler from sampling by changing it to false in
the ‘public table.
sampler_PakBus_address = 95 ‘This address must match the address assigned to the sampler in DevConfig
'Right now this sample program scans every 10 seconds and triggers the sampler once every 15 minutes
'Both the scan interval and the sampler time can be adjusted as needed.
Scan (10,Sec,0,0)
Battery (batt_volt)
CallTable logger_battery
If IfTime(0,15,Min) AND AutoRun Then 'If you are 0 seconds into the 15 minute and autorun is true
Run_sampler = true 'Then set "Run_sampler" flag to True
EndIf
If GetStatus Then 'if GetStatus is true then get variables from the sampler. If the communication fails
return
'the results to Result(1). "Public" is the sampler table name. "Start" is the field name on the
sampler.
GetVariables (Result(1),ComSDC7,0,sampler_PakBus_address,0000,0,"Public","Start",Start_sample,1)
If Start_sample <> True AND Result(1)=0 Then 'If Start_sample is not True and Result(1)=0 then get
sampler ‘status
GetVariables
(Result(3),ComSDC7,0,sampler_PakBus_address,0000,0,"Public","Bottle",Sampler_status(1),4)
response_code_message = Response_List(Respo1)
CallTable SamplerStat 'send the current status values to the SamplerStatus table
GetStatus=false
ElseIf Result(1)<> 0 OR Result(3) <> 0 Then 'Else if there either result(1) or result(3) does not equal
zero than
'call the communcation error table.
CallTable Errors
EndIf
EndIf
If Run_sampler Then 'If Run_sampler is true send the start instruction to the sampler
Start_sample = true
SendVariables (Result(2),ComSDC7,0,sampler_PakBus_address,0000,0,"Public","Start",Start_sample,1)
If Result(2)<>0 Then 'If result(2) does not equal 0 call the communication error table.
CallTable Errors
Else 'set GetStatus to true so on the next scan the logger knows to ask for the updated sampler_status
GetStatus = true
EndIf 'reset run_sampler to false so the logger waits until the top of the next sample interval
'in this case 0 seconds into the next 15 minute interval to sample.
Run_sampler = false
EndIf
NextScan
EndProg
Содержание PVS5120 Series
Страница 2: ......
Страница 4: ......
Страница 6: ......
Страница 8: ......
Страница 70: ...Appendix A Sample Transport Velocity A 2...
Страница 78: ...Appendix B Example Programs B 8...
Страница 86: ...Appendix C Monitoring Sampler Status via RS 485 C 8...
Страница 96: ...Appendix G Generic Modbus Control G 4...
Страница 100: ...Appendix H ISO5667 Conformity H 4...
Страница 101: ......