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.

Wiring CS616 and 227 Delmhorst SWP blocks on AM16/32 as differential voltage + sample code?


Matej Jan 12, 2016 06:20 PM

Hi, I am trying to write a code for CR1000 + AM16/32 multiplexer, swiched on differenital voltage measurement. What's the best configuration (wiring, programming) for a am16/32 to measure 3 CS616 soil moisture probes and 3 207 SWP gypsum blocks and use the rest of the multiplexer channels for voltage differential measurements?

If anyone knows how to wire it, or repair my programme, I would be very thankful. 

This is current version of my programme:

'CR1000
'Created by Short Cut (3.0)

'Declare Variables and Units
Dim WindCorr
Public BattV
Public PTemp_C
Public T_up
Public T_down
Public RH_up
Public RH_down
Public WindSpeed_up
Public WindDir
Public LCount_5
Public VWC(3)
Public NR_Wm2
Public NRcor_Wm2
Public NR_Shenk
Public SHF
Public LCount_8
Public T_soil(3)
Public Grad_EMS11
Public Grad_EMS11_MJ
Public Grad_SKY
Public LCount_11
Public Rs_kOhm(6)
Public WP_kPa(6)
Public WindSpeed_down
Public WindDir_2
Public Mult_5(3)={0.000494,0.000494,0.000494}
Public Offs_5(3)={-0.554,-0.554,-0.554}
Public Mult_8(3)={1,1,1}
Public Offs_8(3)={0,0,0}
Public Mult_11(6)={1,1,1,1,1,1}
Public Offs_11(6)={0,0,0,0,0,0}


Units BattV=Volts
Units PTemp_C=Deg C
Units T_up=Deg C
Units T_down=Deg C
Units RH_up=%
Units RH_down=%
Units WindSpeed_up=m/s
Units WindDir=deg
Units VWC=(%)
Units NR_Wm2=W/m^2
Units NRcor_Wm2=W/m^2
Units NR_Shenk=W/m^2
Units SHF=W/m^2
Units T_soil=Deg C
Units Grad_EMS11=W/m^2
Units Grad_EMS11_MJ=W/m^2
Units Grad_SKY=W/m^2
Units Rs_kOhm=kOhms
Units WP_kPa=kPa
Units WindSpeed_down=m/s
Units WindDir_2=deg

'Define Data Tables
DataTable(Meteo,True,-1)
DataInterval(0,10,Min,10)
Average(1,T_up,FP2,False)
Average(1,T_down,FP2,False)
Average(1,RH_up,FP2,False)
Average(1,RH_down,FP2,False)
Average(1,Grad_EMS11,FP2,False)
Average(1,Grad_SKY,FP2,False)
Average(1,NR_Shenk,FP2,False)
Average(1,NRcor_Wm2,FP2,False)
FieldNames("NRlite2_cor_AVG")
Average(1,SHF,FP2,False)
Average(1,WindSpeed_up,FP2,False)
Average(1,WindSpeed_down,FP2,False)
Sample(1,WindDir,FP2)
EndTable

DataTable(Soil,True,-1)
DataInterval(0,60,Min,10)
Totalize(1,Grad_EMS11_MJ,IEEE4,False)
Minimum(1,BattV,FP2,False,False)
Average(1,VWC(1),FP2,False)
Average(1,VWC(2),FP2,False)
Average(1,VWC(3),FP2,False)
Average(1,T_soil(1),FP2,False)
Average(1,T_soil(2),FP2,False)
Average(1,T_soil(3),FP2,False)
Sample(1,WP_kPa(1),FP2)
Sample(1,WP_kPa(2),FP2)
Sample(1,WP_kPa(3),FP2)
Sample(1,WP_kPa(4),FP2)
Sample(1,WP_kPa(5),FP2)
Sample(1,WP_kPa(6),FP2)
EndTable

DataTable(Daily,True,-1)
DataInterval(0,1440,Min,10)
Minimum(1,BattV,FP2,False,False)
Minimum(1,T_down,FP2,False,False)
Maximum(1,WindSpeed_up,FP2,False,True)
EndTable

'Main Program
BeginProg
'Main Scan
Scan(30,Sec,1,0)
'Default Datalogger Battery Voltage measurement 'BattV'
Battery(BattV)
'Default Wiring Panel Temperature measurement 'PTemp_C'
PanelTemp(PTemp_C,_50Hz)
'Turn AM16/32 Multiplexer On
PortSet(2,1)
Delay(0,150,mSec)
LCount_5=1
SubScan(0,uSec,3)
'Switch to next AM16/32 Multiplexer channel
PortSet(3,1)
PulsePort(1,10000)
'Generic Differential Voltage measurements 'VWC()' on the AM16/32 Multiplexer
VoltDiff(VWC(LCount_5),3,AutoRangeC,6,True,0,_50Hz,Mult_5(LCount_5),Offs_5(LCount_5))
LCount_5=LCount_5+1
PortSet(3,0)
NextSubScan
'Switch to next AM16/32 Multiplexer channel
PulsePort(1,10000)
'Generic Differential Voltage measurements 'NR_Shenk' on the AM16/32 Multiplexer
VoltDiff(NR_Shenk,1,mV25,6,True,0,_50Hz,119.1,0)
'Switch to next AM16/32 Multiplexer channel
PulsePort(1,10000)
'Generic Differential Voltage measurements 'SHF' on the AM16/32 Multiplexer
VoltDiff(SHF,1,AutoRange,6,True,0,_50Hz,15.75,0)
LCount_8=1
SubScan(0,uSec,3)
'Switch to next AM16/32 Multiplexer channel
PulsePort(1,10000)
'Generic Differential Voltage measurements 'T_soil(3x)' on the AM16/32 Multiplexer
Therm107 (T_soil(),3,6,Vx3,0,250,1.0,0)
NextSubScan
'Switch to next AM16/32 Multiplexer channel
PulsePort(1,10000)
'Generic Differential Voltage measurements 'Grad_EMS11' on the AM16/32 Multiplexer
VoltDiff(Grad_EMS11,1,AutoRange,6,True,0,_50Hz,42.3,0)
Grad_EMS11_MJ=Grad_EMS11*0.00001
'Switch to next AM16/32 Multiplexer channel
PulsePort(1,10000)
'Generic Differential Voltage measurements 'Grad_SKY' on the AM16/32 Multiplexer
VoltDiff(Grad_SKY,1,AutoRange,6,True,0,_50Hz,100,0)
LCount_11=1
SubScan(0,uSec,6)
'Switch to next AM16/32 Multiplexer channel
PulsePort(1,10000)

'227 Soil Moisture Block measurements Rs_kOhm and WP_kPa:
BrHalf(Rs_kOhm,6,mV250,6,Vx2,6,250,True ,0,250,1.0,0)
Rs_kOhm=Rs_kOhm/(1-Rs_kOhm)
If Rs_kOhm<17 Then
WP_kPa=Rs_kOhm*0.1
WP_kPa=0.15836+(6.1445*WP_kPa)+(-8.4189*WP_kPa^2)+(9.2493*WP_kPa^3)+(-3.1685*WP_kPa^4)+(0.33392*WP_kPa^5)
WP_kPa=WP_kPa*100
Else
WP_kPa=1000
EndIf
'tu si nejsem jisty jak pokracovat
NextSubScan
'Turn AM16/32 Multiplexer Off
PortSet(2,0)
Delay(0,150,mSec)

'Turn on warm up 1s for EMS33 sensors
PortSet (8 ,1 )
Delay (0,1.5,Sec)
'Generic Differential Voltage measurements 'T_up'
VoltDiff(T_up,1,AutoRange,1,True,0,_50Hz,0.1,-40)
'Generic Differential Voltage measurements 'T_down'
VoltDiff(T_down,1,AutoRange,2,True,0,_50Hz,0.1,-40)
'Generic Differential Voltage measurements 'RH_up'
VoltDiff(RH_up,1,AutoRange,3,True,0,_50Hz,0.1,0)
'Rounds RH_up max to 100 %
If RH_up>100 AND RH_up<108 Then RH_up=100
'Generic Differential Voltage measurements 'RH_down'
VoltDiff(RH_down,1,AutoRange,4,True,0,_50Hz,0.1,0)
'Rounds RH_up max to 100 %
If RH_down>100 AND RH_down<108 Then RH_down=100
'Turn off warm up 1s for EMS33 sensors
PortSet (8 ,0)

'034A/034B Wind Speed & Direction Sensor measurements 'WindSpeed_up' and 'WindDir'
PulseCount(WindSpeed_up,1,1,2,1,0.7989,0.28)
If WindSpeed_up=0.28 Then WindSpeed_up=0
BrHalf(WindDir,1,mV2500,9,1,1,2500,True,0,_50Hz,720,0)
If WindDir>=360 OR WindDir<0 Then WindDir=0
'NR-LITE2 Net Radiometer (dynamic wind speed correction) measurement 'NR_Wm2' and 'NRcor_Wm2'
VoltDiff(NR_Wm2,1,mv25,7,True,0,_50Hz,74.07,0)
If WindSpeed_up>=5 Then
NRcor_Wm2=NR_Wm2*(1+0.021286*(WindSpeed_up-5))
Else
NRcor_Wm2=NR_Wm2
EndIf

'034A/034B Wind Speed & Direction Sensor measurements 'WindSpeed_down' and 'WindDir_2'
PulseCount(WindSpeed_down,1,2,2,1,0.7989,0.28)
If WindSpeed_down=0.28 Then WindSpeed_down=0
'Call Data Tables and Store Data
CallTable(Meteo)
CallTable(Soil)
CallTable(Daily)
NextScan
EndProg

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