Our full technical support staff does not monitor this forum. If you need assistance from a member of our staff, please submit your question from the Ask a Question page.


Log in or register to post/reply in the forum.

Remote area RDI ChannelMaster ADCP setup with SDI-12 communications


RichardQld Feb 6, 2014 04:02 AM

I've hopefully got more of a solution than a problem here, but I thought I’d post it in case anyone else tries to run a similar setup. I’ve attached a cut-down version of the program below, so you can see how it works.

The configuration seems to be working well, with a couple of very nice events having gone through. I did encounter a number of issues though, the biggest of which was that the ADCP forgot its config when it lost power. Since I was communicating through SDI-12, it wouldn’t work after power was lost for more than a day. Re-setting it required me to talk to it using a serial cable and BBTalk, (an RDI hyperterminal style program). This wasn’t a huge problem in the office, but since I was deploying the instrument 1000km’s away, I needed a wake-up solution which didn’t involve a laptop.

As I’d extended the supplied 7 core cable out to 120m, I hooked the end of the cable up to some chocolate block connector terminal and cut an RS232 cable in half to provide me with male and female 9-pin connectors. I then decided to load all of the config settings required into my CR1000 program, and leave the male RS232 plugged into the logger when I wasn’t there (I use Com4 for my modem anyway). This seemed to work well, and was capable of resetting the config, but after deployment I found that the “soft” break sent by the Campbell wasn’t enough to wake it up after powering down. I think I have solved this problem by leaving the Doppler on all the time, (CL 0), and also by running it off a relay.

I use the variable ADCP_Temperature to indicate if it’s communicating, as this always returns a value when it’s working, regardless of water being present or not. In the first instance of ADCP_Temperature returning NAN, I try to send the config again throught the RS232 port. If it still brings back NAN the next time around, I cut the power to the Doppler for 30 seconds, turn it back on, wait 30 seconds and then run the config subroutine again. I only let it do this do this once per day (9am reset) but it seems to do the trick where the config didn’t work alone.

Note; I have an Ott CBS recording height as well, since the Doppler is set above a rock shelf in the channel and is dry some of the time. I don’t get it to read when it’s dry but there’s no reason you couldn’t. I’ve also got a calculation in there which allows an Index Velocity factor to be applied in the logger, so you can have both raw and adjusted flow recorded. I thought it would make it easier to back-calculate if you change it later. A single vertical beam measurement corresponds very nicely with the Ott height, so is sufficient for my needs.
Let me know if you’ve any suggestions or comments.

Cheers

Richard


'SUMMARY OF PROGRAM;
'Trailer gets height data from the on board OTT 7 minutes into every "levelscan" period or when "ReadOTT" is true
'Reads the ChannelMaster ADCP whenever the height is above ADCPMount every 9 minutes into every "levelscan" period or when "ReadADCP" is set to true

'LOGGER PORTS
'C5 SDI12 sensors Sonde is 0, Turb is 1, Ott is 2, ADCP is 3
'C6 ADCP Relay

SequentialMode
PreserveVariables

Const LevelScan = 10 'min aa
Const Levellog = 10 'min aa
Const ScanPeriod = 1 'Min

Public ADCPPresent As Boolean
Public OTTPresent As Boolean
Public SDI_OTT(7), SDI_ADCP1(9), SDI_ADCP2(6)
Public Leveldatum, level, Flow, ADCPVelocityIndex, y, ADCPMount
Public ReadADCP As Boolean
Public ReadOTT As Boolean
Public Loaddefault As Boolean


Alias SDI_OTT(1)=OttLevel
Alias SDI_OTT(6)=OttTemperature
Alias SDI_OTT(7)=OttStatus

Alias SDI_ADCP1(1) = ADCP_temperature
Alias SDI_ADCP1(2) = ADCP_pressure
Alias SDI_ADCP1(3) = ADCP_PlaceHolder
Alias SDI_ADCP1(4) = ADCP_RangeToSurface
Alias SDI_ADCP1(5) = ADCP_Pitch
Alias SDI_ADCP1(6) = ADCP_Roll
Alias SDI_ADCP1(7) = ADCP_MeanXvel
Alias SDI_ADCP1(8) = ADCP_Voltage
Alias SDI_ADCP1(9) = ADCP_test

Alias SDI_ADCP2(1) = ADCP_MeanVel
Alias SDI_ADCP2(2) = ADCP_Height 'from vertical beam unless unavailable
Alias SDI_ADCP2(3) = ADCP_Area
Alias SDI_ADCP2(4) = ADCP_Q
Alias SDI_ADCP2(5) = ADCP_UpperVol
Alias SDI_ADCP2(6) = ADCP_LowerVol

Public PumpingLevel
Public ADCPReset

Units ADCP_MeanVel=mps
Units ADCP_Q=cumecs
Units ADCP_Area=m2
Units ADCP_Height=m

DataTable(Lev_Data,True,-1)
Sample(1,level,FP2)
EndTable

DataTable(ADCP,True,5000)
Sample (1,ADCP_MeanXvel,FP2)
Sample (1,Flow,FP2)
Sample (1,ADCP_temperature,FP2)
Sample (1,ADCP_pressure,FP2)
Sample (1,ADCP_RangeToSurface,FP2)
Sample (1,ADCP_Height,FP2)
Sample (1,ADCP_Area,FP2)
Sample (1,ADCP_Q,FP2)
Sample (1,ADCP_UpperVol,FP2)
Sample (1,ADCP_LowerVol,FP2)
EndTable

Sub ADCPConfig
SerialOpen (ComRS232,9600,0,1000,1000)
SerialOut (ComRS232,"===","",0,100)'send a break
Delay (1,4,Sec)
SerialOut (ComRS232,"===","",0,100)'multiple wake-ups
Delay (1,4,Sec)
SerialOut (ComRS232,"CR 1"+CHR(13),"",0,10)'reset to user defaults
Delay (1,2,Sec)
SerialOut (ComRS232,"MR 0"+CHR(13),"",0,10)'Recorder off
SerialOut (ComRS232,"WN 20"+CHR(13),"",0,10)'number of bins
SerialOut (ComRS232,"VP 1"+CHR(13),"",0,10)'number of vertical pings (contain sub-pings so should be OK at 1)
SerialOut (ComRS232,"WS 400"+CHR(13),"",0,10)'horizontal cell size (cm) aa edit this, this is 20x400 (80m river) probably want more like 300 for Mulgrave
SerialOut (ComRS232,"WF 200"+CHR(13),"",0,10)'blanking distance (cm)
SerialOut (ComRS232,"WP 3"+CHR(13),"",0,10)'number of horizontal pings per ensemble
SerialOut (ComRS232,"TP 00:00.50"+CHR(13),"",0,10)'time between pings 0.6 is standard
SerialOut (ComRS232,"EX 01010"+CHR(13),"",0,10)'leave... see manual
SerialOut (ComRS232,"EZ 1111101"+CHR(13),"",0,10)'Salinity manual (0), everything else as per instrument readings
SerialOut (ComRS232,"ES 12"+CHR(13),"",0,10)'salinity 18 is mid range, this is a tidal site
SerialOut (ComRS232,"CF 11100"+CHR(13),"",0,10)'leave...
SerialOut (ComRS232,"PD 0"+CHR(13),"",0,10)'output data format
SerialOut (ComRS232,"CJ 1,3,0"+CHR(13),"",0,10)'SDI12 on, address 3, SI units
SerialOut (ComRS232,"CT 1"+CHR(13),"",0,10)' turnkey operation on
SerialOut (ComRS232,"IO 1"+CHR(13),"",0,10)'flow calculation on
SerialOut (ComRS232,"IB 1"+CHR(13),"",0,10)'right bank
SerialOut (ComRS232,"IC 3"+CHR(13),"",0,10)'irregular profile
SerialOut (ComRS232,"IS 100,1,20"+CHR(13),"",0,10)'number of cells to average velocity
SerialOut (ComRS232,"IV 0.000,1.000,0.000"+CHR(13),"",0,10)'index velocity multiplier
'aa you can see if your cross section is in the CM using IP0 (that's a zero) in BBtalk. It lists the values, scroll up.
SerialOut (ComRS232,"IP 1,0, 9.8"+CHR(13),"",0,10)'profile points
SerialOut (ComRS232,"IP 2,9.1, 9.8"+CHR(13),"",0,10)
SerialOut (ComRS232,"IP 3,14.6, 7.6"+CHR(13),"",0,10)
SerialOut (ComRS232,"IP 4,17, 5.7"+CHR(13),"",0,10)
SerialOut (ComRS232,"IP 5,22.8, 4.2"+CHR(13),"",0,10)
SerialOut (ComRS232,"IP 6,26.5, 4"+CHR(13),"",0,10)
SerialOut (ComRS232,"IP 7,29.6, 4.6"+CHR(13),"",0,10)
SerialOut (ComRS232,"IP 8,31.7, 4.3"+CHR(13),"",0,10)
SerialOut (ComRS232,"IP 9,34.9, 2.2"+CHR(13),"",0,10)
SerialOut (ComRS232,"IP 10,38.2, 1.8"+CHR(13),"",0,10)
SerialOut (ComRS232,"IP 11,39.4, 1.5"+CHR(13),"",0,10)
SerialOut (ComRS232,"IP 12,41.5, 0.7"+CHR(13),"",0,10)
SerialOut (ComRS232,"IP 13,45.9, -0.1"+CHR(13),"",0,10)
SerialOut (ComRS232,"IP 14,50.1, 0.1"+CHR(13),"",0,10)
SerialOut (ComRS232,"IP 15,59.9, -0.2"+CHR(13),"",0,10)
SerialOut (ComRS232,"IP 16,71.1, 0.4"+CHR(13),"",0,10)
SerialOut (ComRS232,"IP 17,87.7, 0.4"+CHR(13),"",0,10)
SerialOut (ComRS232,"IP 18,96.5, 1.6"+CHR(13),"",0,10)
SerialOut (ComRS232,"IP 19,110.2, 1.6"+CHR(13),"",0,10)
SerialOut (ComRS232,"IP 20,113.7, 1.4"+CHR(13),"",0,10)
SerialOut (ComRS232,"IP 21,117.7, 1.6"+CHR(13),"",0,10)
SerialOut (ComRS232,"IP 22,120.2, 1.4"+CHR(13),"",0,10)
SerialOut (ComRS232,"IP 23,124.6, 1.7"+CHR(13),"",0,10)
SerialOut (ComRS232,"IP 24,127.4, 1.5"+CHR(13),"",0,10)
SerialOut (ComRS232,"IP 25,129.5, 0.1"+CHR(13),"",0,10)
SerialOut (ComRS232,"IP 26,132.5, 0.2"+CHR(13),"",0,10)
SerialOut (ComRS232,"IP 27,134.7, 1.8"+CHR(13),"",0,10)
SerialOut (ComRS232,"IP 28,135.1, 1.8"+CHR(13),"",0,10)
SerialOut (ComRS232,"IP 29,139.7, 5.1"+CHR(13),"",0,10)
SerialOut (ComRS232,"IP 30,142, 4.6"+CHR(13),"",0,10)
SerialOut (ComRS232,"IP 31,146.8, 6.3"+CHR(13),"",0,10)
SerialOut (ComRS232,"IP 32,154.1, 7.5"+CHR(13),"",0,10)
SerialOut (ComRS232,"IP 33,157.5, 9.8"+CHR(13),"",0,10)
SerialOut (ComRS232,"IP 34,9999, 9999"+CHR(13),"",0,10)
SerialOut (ComRS232,"IE 2.3,0.000"+CHR(13),"",0,10)'instrument mounted at 2.3m
SerialOut (ComRS232,"IU 1,1,1,1,1"+CHR(13),"",0,10)'output units (SI)
SerialOut (ComRS232,"IT 0,0"+CHR(13),"",0,10)'scaling factors for outputs
SerialOut (ComRS232,"CL 0"+CHR(13),"",0,10)'don't go to sleep, can use up to 1.2Ah/day
SerialOut (ComRS232,"CK"+CHR(13),"",0,10)'save
SerialOut (ComRS232,"CS"+CHR(13),"",0,10)'start pinging
SerialClose (ComRS232)
EndSub

Sub ADCPPowerdown
PortSet(6,0)
Delay (1,30,Sec)
PortSet(6,1)
Delay (1,30)Sec)
ADCPConfig
EndSub

BeginProg
Scan (ScanPeriod,Min,0,0)
If NOT Loaddefault Then
ADCPPresent = True 'aa
OTTPresent = True 'aa
Leveldatum = 1.375 'aa added to OTT level for local level
ADCPMount = 2.5
ADCPVelocityIndex = 1
y = 0
PortSet(6,1)
EndIf

If IfTime(9,24,hr) Then
ADCPReset = 0
EndIf

If IfTime(7,LevelScan,min) Then
ReadOTT = True
EndIf

If IfTime(9,LevelScan,min) AND level > ADCPMount Then
ReadADCP = True
EndIf

If ADCPReset = 1 Then
ADCPConfig
ADCPReset = 2
EndIf

NextScan
SlowSequence
Scan (20,sec,0,0)
If OTTPresent AND ReadOTT Then
ReadOTT = 0
SDI12Recorder (SDI_OTT(),5,2,"C!",1.0,0)
level = SDI_OTT(1) + Leveldatum
CallTable Lev_data
EndIf

If ADCPPresent AND ReadADCP Then
ReadADCP = False
SDI12Recorder (SDI_ADCP1(),5,3,"M!",1.0,0)
SDI12Recorder (SDI_ADCP2(),5,3,"M9!",1.0,0)
Flow = ((ADCP_MeanVel * ADCPVelocityIndex) + y) * ADCP_Area
CallTable ADCP
If ADCP_temperature = NAN AND ADCPReset = 0 Then
ADCPReset = 1
EndIf
If ADCP_temperature = NAN AND ADCPReset = 2 Then
ADCPPowerdown
ADCPReset = 3
EndIf
EndIf

NextScan
EndProg

Log in or register to post/reply in the forum.