Campbell Scientific HMP155A HMP155A Temperature and Relative Humidity Probe - Page 44
Campbell Scientific HMP155A Manual
View all Campbell Scientific HMP155A manuals
Add to My Manuals
Save this manual to your list of manuals |
Page 44 highlights
Appendix C. Interfacing with HMP155A RS-485 Output 'CR1000 Series Datalogger 'Change HMP155A default serial settings from 4800,E,7,1 To 9600,N,8,1: ' Sensor Wiring: ' *CSI cable Vaisala cable MD485 CR1000 Connector Pin-Out ' blue ' yellow ' black ' red ' white ' shield (clear) ' pink B brown A red blue green Ground Black grey, pink, brown - NOT used G 12V Ground 6 2 8 7 3 not connected 'MD485 settings: ' CS I/O AND RS-485 ' SDC Address 7 ' Transparent Communication ' RS-485 baud 9600 ' *HMP155ACBL2, ordered separately 'Connect CS I/O port of MD485 to CS I/O port on CR1000 with SC12 cable. Public NBytesReturned As Long Public SerialIndest As String * 26 Public RHArray(2) As String Alias RHArray(1)=RH Alias RHArray(2)=TempC Public String_1 As String Public String_2 As String Const SensorPort=32 Const CRLF=CHR(13)+CHR(10) SequentialMode 'Define Data Tables DataTable (Table1,1,-1) DataInterval (0,15,Min,10) Average (1,TempC,FP2,False) Sample (1,RH,FP2) EndTable 'Main Program (for sensor configured for default settings of 4800 baud, E,7,1) BeginProg SerialOpen (SensorPort,4800,58,0,53) ' buffer = 2*number of bytes + 1 ' SDM-SI01 port 58 for half duplex,7,E,1 'Strings to start serial output String_1 = "SMODE RUN"+CRLF ' set SMODE to "RUN" String_2 = "R"+CRLF ' send "R" to start serial output 'Instructions to enable RS-485 serial output SerialOut (SensorPort,String_1,"RUN",3,100) 'send String_1, wait for 'RUN' response Delay (0,500,mSec) SerialOut (SensorPort,String_2,"RH",3,100) 'send String_2 Scan (5,Sec,0,0) 'Get serial string from sensor SerialInRecord (SensorPort,SerialIndest,00,24,&H0D0A,NBytesReturned,00) '&H0D0A = CRLF 'Parse RH and temp from string SplitStr (RHArray(1),SerialIndest,"=",2,0) CallTable Table1 NextScan EndProg C-8