![Campbell CS120A Скачать руководство пользователя страница 80](http://html1.mh-extra.com/html/campbell/cs120a/cs120a_instruction-manual_488900080.webp)
CS120A and CS125 Visibility and Present Weather Sensors
C-4
'Const CS125_Poll = CHR(2)&"POLL:8:0:939A:"&CHR(3)&CHR(13) 'address 8
'Const CS125_Poll = CHR(2)&"POLL:9:0:A4AA:"&CHR(3)&CHR(13) 'address 9
'Main Program
BeginProg
'Open the logger serial port to which the CS125 is connected
SerialOpen (CS125_Comport,38400,3,0,1000)
Scan(10,Sec,1,0)
'The sensor is polled every 10 seconds
SerialOut(CS125_Comport,CS125_Poll,"",0,100)
SerialInRecord(CS125_Comport,InString,&h02,0,&h03,NBytesReturned,01)
'Check that a message has been recieved first
If NBytesReturned > 0 Then
SplitStr (SerialIndest(),InString," ",27,5)
'Check the received checksum is valid
'Calculate the expected checksum
lngCRCCalc = CheckSum(InString,1,NBytesReturned-5)
'Extract the checksum from the message & convert it for comparison
lngCRCMsg = HexToDec(checksumrx)
ChecksumOK = ( lngCRCMsg = lngCRCCalc)
'In critical applications the visibility can be set to NaN if the system status
'is degraded or a critical error flag is set.
If ChecksumOK Then Visibility = Visibilitystr Else Visibility =NaN
EndIf
'Call data storage commands here
NextScan
EndProg
Содержание CS120A
Страница 2: ...ii ...
Страница 4: ......
Страница 6: ......
Страница 8: ......
Страница 12: ...vi ...
Страница 73: ...A 1 Appendix A CS120A CS125 block diagram ...
Страница 74: ...CS120A and CS125 Visibility and Present Weather Sensors A 2 ...
Страница 76: ...CS120A and CS125 Visibility and Present Weather Sensors B 2 ...
Страница 90: ......
Страница 93: ...Appendix D Present Weather Codes D 3 ...