![Campbell CS120A Instruction Manual Download Page 81](http://html1.mh-extra.com/html/campbell/cs120a/cs120a_instruction-manual_488900081.webp)
Appendix C. Example CRBasic programs
C-5
C.3 Example CRBasic SET program
'-------------------------------------------------------------------------------
' CS125 Visibility
'
' Program to test the SET command part of the command line interface on the CS125
' Do not run this script for extended periods of time (days!) as it writes
' to flash over and over and will eventually wear the flash out
' Logger:CR1000
'-------------------------------------------------------------------------------
Public InString As String * 200
Public TempString As String *100
' Variables for the SET command subroutine
Dim CS125CArray(21) As String * 6 ' CS125 Command Array
'-------------------------------------------------------
' This function creates a SET command string for the
' CS125 visibility sensor. Including all delimiting
' characters and checksums
' then returns the string in "CS125CommandString"
' Array variable order is as follows:
' 1. Sensor ID
' 2. User Alarm 1 Set
' 3. User Alarm 1 Active
' 4. User Alarm 1 Distance
' 5. User Alarm 2
' 6. User Alarm 2 Active
' 7. User Alarm 2 Distance
' 8. Serial BaudRate
' 9. Serial number (Read only so not used)
' 10. Visibility Units
' 11. Continuous mode output interval
' 12. Polling Or Continuous modes
' 13. Message Format (Basic/Partial/Full)
' 14. RS232 or RS485 serial communications enabled
' 15. Averaging Period
' 16. Sample timing
' 17. Dew heater override
' 18. Hood Heater override
' 19. Dirty window compensation
' 20. Use CRC checking
' 21. PSU input voltage shutdown level
Function CS125_SETCommand As String *100
Dim TempStringFunc As String * 100
Dim CS125CommandString As String * 100
Dim i As Long
Dim CheckVal As Long
' Create a string containing the values going out to the CS125
TempStringFunc = "SET:0:"
For i = 1 To 21
TempStringFunc = TempStri CS125CArray(i) + " "
Next
' Create a check sum of the values going out
Summary of Contents for CS120A
Page 2: ...ii ...
Page 4: ......
Page 6: ......
Page 8: ......
Page 12: ...vi ...
Page 73: ...A 1 Appendix A CS120A CS125 block diagram ...
Page 74: ...CS120A and CS125 Visibility and Present Weather Sensors A 2 ...
Page 76: ...CS120A and CS125 Visibility and Present Weather Sensors B 2 ...
Page 90: ......