Appendix B. Example Programs
B-3
B.1.2 CR200X Series Programs
'This generic program for the CR200X triggers the PVS5120 based on a user-defined time interval.
'The VSC100 must be configured for SDI-12 control type and have an SDI-12 address of 0
'*** Change this value to the desired sample interval.
'Sample interval must be greater than or equal to two minutes unless you are using a very short hose.**
Const Sample_Interval = 2 ' Minutes. This is the sample interval
Public Run 'Set as a non-zero value in the public table for the sampler to begin sampling on the next scan
'interval. For example 0=Stop 1=sample.
Public BVolt 'This is the voltage of the CR200's power supply
Units BVolt = VDC
Public VSC100(4)'This is the destintation array for the output values from the VSC100
Alias VSC100(1) = Bottle_Number 'This is the bottle number that the last sample was deposited into
Alias VSC100(2) = Sample_Number 'This is the number of the last sample that was deposited into the current
bottle
Alias VSC100(3) = Response_Code 'This is the result code returned by the VSC100
'Possible response codes returned from VSC100
' 0 - No Error
' 1 - Sampler Full
' 2 - Low Sampler Start Battery
' 3 - Low Sampler Run Battery
' 4 - Vacuum Timeout
' 5 - Bottle Overflow (if detection probe installed)
' 6 - No Water Present (if water detection probe installed)
' 7 - Distributor Arm Calibration Failure
' 8 - Sample Sense Rod Shorted
Alias VSC100(4) = Sampler_Volt 'this is the voltage of the sampler battery
Units Sampler_Volt = VDC
Dim I 'This is a hidden variable used as an index counter
DataTable (Sampler_Data,True,-1)
DataInterval (0,Sample_Interval,min)
Sample (1,BVolt)
Sample (4,VSC100())
EndTable
BeginProg
Scan (Sample_Interval ,min)
Battery (BVolt) 'Measure the CR200's power supply
If Run <> 0 Then 'If the system has been enabled to run then
For I = 1 To 4'This loop sets all the elements in the VSC100 array to NAN. This will make it
easier to recognize errors.
VSC100(I) = NaN
Next I
SDI12Recorder (VSC100(),"0M!",1.0,0) 'Trigger the VSC100 to take a sample
CallTable Sampler_Data
EndIf
NextScan
EndProg
Summary of Contents for PVS5120 Series
Page 2: ......
Page 4: ......
Page 6: ......
Page 8: ......
Page 70: ...Appendix A Sample Transport Velocity A 2...
Page 78: ...Appendix B Example Programs B 8...
Page 86: ...Appendix C Monitoring Sampler Status via RS 485 C 8...
Page 96: ...Appendix G Generic Modbus Control G 4...
Page 100: ...Appendix H ISO5667 Conformity H 4...
Page 101: ......