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.

CR1000x error with CS616 TDR


Paul Heinrich Aug 20, 2020 03:54 PM

I'm programming a CR100x in Short Cut.  When I try to compile I get errors from the second and third of three CS616 TDRs that state "reps exceed number of valid channels".  Reps for the CS616 commands are set to "1".  Anybody know what is going wrong here?  The errors are generated by lines 163 and 168

Here's the full CRbasic code...

'CR1000X Series
'Created by Short Cut (4.0)

'Declare Variables and Units
Dim AirTC
Dim SPkPa
Dim Twg
Dim Twpg
Dim Vpg
Dim Vp
Dim SVp
Dim Twch
Dim VpgVpd
Dim Top
Dim Bottom
Dim SVpW
Dim N
Public BattV
Public PTemp_C
Public PAR_Den
Public PAR_Tot
Public SlrkW
Public SlrMJ
Public AirTC_2m
Public RH_2m
Public WS_ms
Public WindDir
Public VW_30
Public PA_uS_30
Public VW_60
Public PA_uS_60
Public VW_90
Public PA_uS_90
Public soilTemp_5cm
Public soilTemp_10cm
Public soiltemp_15cm
Public TCTemp_2m
Public TdC
Public TwC

Units BattV=Volts
Units PTemp_C=Deg C
Units PAR_Den=umol/s/m^2
Units PAR_Tot=mmol/m^2
Units SlrkW=kW/m^2
Units SlrMJ=MJ/m^2
Units AirTC_2m=Deg C
Units RH_2m=%
Units WS_ms=meters/second
Units WindDir=degrees
Units PA_uS_30=uSec
Units PA_uS_60=uSec
Units PA_uS_90=uSec
Units soilTemp_5cm=Deg C
Units soilTemp_10cm=Deg C
Units soiltemp_15cm=Deg C
Units TCTemp_2m=Deg C
Units TdC=Deg C
Units TwC=Deg C

'Define Data Tables
DataTable(Hourly,True,-1)
DataInterval(0,60,Min,10)
CardOut(0,-1)
Average(1,BattV,FP2,False)
Average(1,PTemp_C,FP2,False)
Average(1,PAR_Den,FP2,False)
Totalize(1,PAR_Tot,IEEE4,False)
Average(1,SlrkW,FP2,False)
Totalize(1,SlrMJ,IEEE4,False)
Average(1,AirTC_2m,FP2,False)
Maximum(1,RH_2m,FP2,False,False)
Average(1,WS_ms,FP2,False)
StdDev(1,WS_ms,FP2,False)
Sample(1,WindDir,FP2)
WindVector(1,WS_ms,WindDir,FP2,False,1,0,0)
FieldNames("WS_ms_S_WVT,WindDir_D1_WVT,WindDir_SD1_WVT")
Average(1,VW_30,FP2,False)
Average(1,PA_uS_30,FP2,False)
Average(1,VW_60,FP2,False)
Average(1,PA_uS_60,FP2,False)
Average(1,VW_90,FP2,False)
Average(1,PA_uS_90,FP2,False)
Average(1,soilTemp_5cm,FP2,False)
Average(1,soilTemp_10cm,FP2,False)
Average(1,soiltemp_15cm,FP2,False)
Average(1,TCTemp_2m,FP2,False)
Average(1,TdC,FP2,False)
Average(1,TwC,FP2,False)
ETsz(AirTC_2m,RH_2m,WS_ms,SlrMJ,111.6785,35.25729,2254,6,0,FP2,False)
FieldNames("ETos,Rso")
EndTable

DataTable(Daily,True,-1)
DataInterval(0,1,Day,10)
CardOut(0,-1)
Minimum(1,BattV,FP2,False,False)
Average(1,PTemp_C,FP2,False)
Maximum(1,PTemp_C,FP2,False,True)
Minimum(1,PTemp_C,FP2,False,True)
Average(1,PAR_Den,FP2,False)
Totalize(1,PAR_Tot,IEEE4,False)
Average(1,SlrkW,FP2,False)
Totalize(1,SlrMJ,IEEE4,False)
Average(1,AirTC_2m,FP2,False)
Maximum(1,AirTC_2m,FP2,False,True)
Minimum(1,AirTC_2m,FP2,False,True)
Maximum(1,RH_2m,FP2,False,True)
Minimum(1,RH_2m,FP2,False,True)
Average(1,WS_ms,FP2,False)
Maximum(1,WS_ms,FP2,False,True)
Minimum(1,WS_ms,FP2,False,True)
Sample(1,WindDir,FP2)
WindVector(1,WS_ms,WindDir,FP2,False,1,0,0)
FieldNames("WS_ms_S_WVT,WindDir_D1_WVT,WindDir_SD1_WVT")
Average(1,VW_30,FP2,False)
Average(1,PA_uS_30,FP2,False)
Average(1,VW_60,FP2,False)
Average(1,PA_uS_60,FP2,False)
Average(1,VW_90,FP2,False)
Average(1,PA_uS_90,FP2,False)
Average(1,soilTemp_5cm,FP2,False)
Average(1,soilTemp_10cm,FP2,False)
Average(1,soiltemp_15cm,FP2,False)
Average(1,TCTemp_2m,FP2,False)
Maximum(1,TCTemp_2m,FP2,False,True)
Minimum(1,TCTemp_2m,FP2,False,True)
EndTable

'Main Program
BeginProg
'Main Scan
Scan(15,Sec,1,0)
'Default CR1000X Datalogger Battery Voltage measurement 'BattV'
Battery(BattV)
'Default CR1000X Datalogger Wiring Panel Temperature measurement 'PTemp_C'
PanelTemp(PTemp_C,60)
'LI190R Quantum Sensor measurements 'PAR_Tot' and 'PAR_Den
VoltDiff(PAR_Den,1,mV200,1,True,0,60,1,0)
If PAR_Den<0 Then PAR_Den=0
PAR_Tot=PAR_Den*3.497808
PAR_Den=PAR_Den*233.1872
'LI200R Pyranometer measurements 'SlrMJ' and 'SlrkW'
VoltDiff(SlrkW,1,mV200,2,True,0,60,1,0)
If SlrkW<0 Then SlrkW=0
SlrMJ=SlrkW*0.00230521
SlrkW=SlrkW*0.1536807
'HMP155 (constant power) Temperature & Relative Humidity Sensor measurements 'AirTC_2m' and 'RH_2m'
VoltSE(AirTC_2m,1,mV1000,5,False,0,60,0.14,-80)
VoltSE(RH_2m,1,mV1000,6,False,0,60,0.1,0)
If RH_2m>100 AND RH_2m<108 Then RH_2m=100
'05108 Wind Speed & Direction Sensor measurements 'WS_ms' and 'WindDir'
PulseCount(WS_ms,1,P1,5,1,0.1666,0)
BrHalf(WindDir,1,mV5000,7,VX1,1,2500,True,20000,60,355,0)
If WindDir>=355 Or WindDir<0 Then WindDir=0
'CS616 Water Content Reflectometer measurements 'VW_30' and 'PA_uS_30'
If TimeIntoInterval(0,1,Hr) Then
CS616(PA_uS_30,1,8,C1,1,1,0)
VW_30=-0.0663+(-0.0063*PA_uS_30)+(0.0007*PA_uS_30^2)
EndIf
'CS616 Water Content Reflectometer measurements 'VW_60' and 'PA_uS_60'
If TimeIntoInterval(0,1,Hr) Then
CS616(PA_uS_60,1,9,C1,1,1,0)
VW_60=-0.0663+(-0.0063*PA_uS_60)+(0.0007*PA_uS_60^2)
EndIf
'CS616 Water Content Reflectometer measurements 'VW_90' and 'PA_uS_90'
If TimeIntoInterval(0,1,Hr) Then
CS616(PA_uS_90,1,10,C1,1,1,0)
VW_90=-0.0663+(-0.0063*PA_uS_90)+(0.0007*PA_uS_90^2)
EndIf
'109 Temperature Probe measurement 'soilTemp_5cm'
Therm109(soilTemp_5cm,1,11,VX1,0,60,1,0)
'109 Temperature Probe measurement 'soilTemp_10cm'
Therm109(soilTemp_10cm,1,12,VX1,0,60,1,0)
'109 Temperature Probe measurement 'soiltemp_15cm'
Therm109(soiltemp_15cm,1,13,VX1,0,60,1,0)
'Type K Thermocouple measurements 'TCTemp_2m'
TCDiff(TCTemp_2m,1,mv200C,8,TypeK,PTemp_C,True,0,60,1,0)
'Dew Point and Wet-Bulb calculation prep
AirTC=AirTC_2m
SPkPa=77.02208
SVp=6.107799961+AirTC*(4.436518521*10^-1+AirTC*(1.428945805*10^-2+AirTC*(2.650648471*10^-4+AirTC*(3.031240396*10^-6+AirTC*(2.034080948*10^-8+6.136820929*10^-11*AirTC)))))
SVp=SVp*0.1
Vp=RH_2m*SVp/100
'Dew Point calculation 'TdC'
TdC=(241.88*LOG(Vp/0.61078))/(17.558-LOG(Vp/0.61078))
If TdC>AirTC Then TdC=AirTC
'Find Wet-Bulb 'TwC'
Top=AirTC
Bottom=TdC
For N = 1 To 25
Twpg=Twg
Twg=((Top-Bottom)/2)+Bottom
SVpW=6.107799961+Twg*(4.436518521*10^-1+Twg*(1.428945805*10^-2+Twg*(2.650648471*10^-4+Twg*(3.031240396*10^-6+Twg*(2.034080948*10^-8+6.136820929*10^-11*Twg)))))
SVpW=SVpW*0.1
Vpg=SVpW-(0.000660*(1+0.00115*Twg)*(AirTC-Twg)*SPkPa)
VpgVpd=Vpg-Vp
Twch=ABS(Twpg-Twg)
If VpgVpd>0 Then
Top=Twg
Else
Bottom=Twg
EndIf
If Twch<0.01 Or N=25 Then ExitFor
Next
TwC=Twg
'Call Data Tables and Store Data
CallTable Hourly
CallTable Daily
NextScan
EndProg


nsw Aug 21, 2020 08:00 AM

Hi. I have put this in my CRBasic and it compiles fine.

I see you have V4.0 of ShortCut. I would upgrade your ShortCut to the latest, its availble for download from the website. Plus load the latest OS from the website to your Pc which updates the compiler and put the latest OS in your CR1000X.

That should probably solve your issue.


Paul Heinrich Aug 28, 2020 06:10 PM

Updating Shortcut and Loggernet on the laptop I was using to write the program solved the problem.  Thank you!

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