![Campbell CS120A Instruction Manual Download Page 89](http://html1.mh-extra.com/html/campbell/cs120a/cs120a_instruction-manual_488900089.webp)
Appendix C. Example CRBasic programs
C-13
C.7 Example CRBasic MSGGET program
'-------------------------------------------------------------------------------
' CS125 Present Weather and CS120A Visibility sensor
'
' Program to test the MSGGET command part of the command line interface.
' The sensor should be in POLLED mode for best results.
'
' Examples:
' MSGGET:0:0:C6ED:
' MSGGET:1:0:F1DD:
' MSGGET:2:0:A88D:
' MSGGET:3:0:9FBD:
' MSGGET:4:0:1A2D:
' MSGGET:5:0:2D1D:
' MSGGET:6:0:744D:
' MSGGET:7:0:437D:
' MSGGET:8:0:6F4C:
' MSGGET:9:0:587C:
'-------------------------------------------------------------------------------
Public CS120CommandString As String * 40, CheckValCCITT
Public MSG_Response As String * 100
Public TempString As String
'Main Program
BeginProg
' open port to the visibility sensor
SerialOpen (Com1,38400,3,0,10000)
Scan (10,Sec,0,0)
' Create the main part of the message
TempString = "MSGGET:0:0"
' Add the checksum and command characters
CheckValCCITT = CheckSum (TempString,1,0)
CS120CommandString = CHR(2) + Temp ":" + FormatLong (CheckValCCITT,"%04X") +
":" + CHR(3) + CHR(13) + CHR(10)
' Send the MSGGET command
SerialOut (Com1,CS120CommandString,"",0,100)
Delay (1,1,Sec)
' Record the returned values
SerialIn (MSG_Response,Com1,100,0,200)
NextScan
EndProg
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: ......