Hi,
I'm trying to connect a Vaisala HMP155, RS485 output, to a CR1000X.
Is there any documentation available of the wiring and/or program?
Thanks in advance!
I found this code for a CR6. To use it on a CR1000X, you should just have to move it to ComC5 or ComC7.
'CR6 Series Datalogger 'Vaisala Cable 'Pink C2 RS485 B 'Brown C1 RS485 A 'Red G 'Blue 12V 'Black/clear Ground 'White, Yellow, Green, Brown NOT used. 'Default HMP155A RS485 settings are 4800,E,7,1 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 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 HMP155A configured for 4800 baud, E,7,1) BeginProg SerialOpen (ComC1,4800,10,0,53,4) ' buffer = 2*number of bytes + 1 ' C1/C2 configured for RS485 half duplex transparent 4800,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 RS485 serial output SerialOut (ComC1,String_1,"RUN",3,100) 'send String_1, wait for 'RUN' response Delay (0,500,mSec) SerialOut (ComC1,String_2,"RH",3,100) 'send String_2 Scan (10,Sec,0,0) 'Get serial string from sensor SerialInRecord (ComC1,SerialIndest,00,25,&H0D0A,NBytesReturned,00) '&H0D0A = CRLF 'Parse RH and temp from string SplitStr (RHArray(1),SerialIndest,"=",2,0) CallTable Table1 NextScan EndProg
Also see Appendix C of our HMP155A manual (https://s.campbellsci.com/documents/us/manuals/hmp155a.pdf) which gives an example and debugging info for the RS485 connection. This is for the CR1000 and uses an MD485 as the RS485 interface. Please note an RS485 cable from Campbell Scientific will have different conductor colouring than one supplied by Vaisala.
Hi!
Thanks a lot for the suggestions!
Worked perfectly!