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.

SDI12 array dimensioned to 3 sets of data from the same Device


Shanks.J Apr 24, 2020 02:54 AM

I am measuring 3 variable within a soil probe.
the probe has 8 sensors, which means there are 3 sets of 8 values to pull.
soil moisture , soil salinity and soil temperature.

I am trying to make the array dimensioned to 24 & define the start variable position in the array
by defining the start variable position in the array ie moisture 1-8 , salinity 9 - 16, temperature 16 - 24.  

So far i am not having luck. and getting NANs accross al varible, is this because of the set up of th alias?
please see below. 
alternative ticket for possible comand issue as the sorce of the problem: https://www.campbellsci.com/forum?forum=1&l=thread&tid=16294

start code:

##########  Declare Variables  ###########

Public LoggerName As String * 24 'allows each logger to have a unique site code or name

Public Batt_volt(4) 'the loggers reading of battery voltages

Public PTemp_degC 'the loggers reading of its own internal temp

Public Soil_SDI12(24) 'probe #2, Address = 6 , Port C1


'##########  Output string from internal battery measurements  ##########

Alias Batt_volt(1) = SupplyVoltsAlias Batt_volt(2) = ChargeInAlias Batt_volt(3) = ChargeOutAlias Batt_volt(4) = LithiumVolts


'##########  output string from Soil moisture probe  ##########
'soil moisture
Alias Soil_SDI12(1)= Soil_Moisture_10cm
Alias Soil_SDI12(2)= Soil_Moisture_20cm
Alias Soil_SDI12(3)= Soil_Moisture_30cm
Alias Soil_SDI12(4)= Soil_Moisture_40cm
Alias Soil_SDI12(5)= Soil_Moisture_50cm
Alias Soil_SDI12(6)= Soil_Moisture_60cm
Alias Soil_SDI12(7)= Soil_Moisture_70cm
Alias Soil_SDI12(8)= Soil_Moisture_80cm
'soil temperature
Alias Soil_SDI12(9)= Soil_Temperature_10cm
Alias Soil_SDI12(10)= Soil_Temperature_20cm
Alias Soil_SDI12(11)= Soil_Temperature_30cm
Alias Soil_SDI12(12)= Soil_Temperature_40cm
Alias Soil_SDI12(13)= Soil_Temperature_50cm
Alias Soil_SDI12(14)= Soil_Temperature_60cm
Alias Soil_SDI12(15)= Soil_Temperature_70cm
Alias Soil_SDI12(16)= Soil_Temperature_80cm
'soil salinity
Alias Soil_SDI12(17)= Soil_Salinity_10cm
Alias Soil_SDI12(18)= Soil_Salinity_20cm
Alias Soil_SDI12(19)= Soil_Salinity_30cm
Alias Soil_SDI12(20)= Soil_Salinity_40cm
Alias Soil_SDI12(21)= Soil_Salinity_50cm
Alias Soil_SDI12(22)= Soil_Salinity_60cm
Alias Soil_SDI12(23)= Soil_Salinity_70cm
Alias Soil_SDI12(24)= Soil_Salinity_80cm


'##########  Define Data Tables  ##########
DataTable(Table1,True,-1)  DataInterval(0,10,Min,10) 'write table every 10 minutes 
Sample (1,LoggerName,String)
 
Sample (1,SupplyVolts,FP2)
 
Sample (1,LithiumVolts,FP2)
 
Sample (1,PTemp_degC,FP2)
  
Sample (24,Soil_SDI12(),FP2)

EndTable

'##########  Main Program  ###########
BeginProg  LoggerName="soiltestbench" 'ie a unique name for this logger/  
'Main Scan  Scan(30,sec,1,0) 'Scan once every 30seconds   
Battery(Batt_volt())'Read the supply and lithium voltages
   
PanelTemp(PTemp_degC,50) 'Read CR6 internal temp

'PROBE     
SDI12Recorder (Soil_SDI12(1),C1,"5","C!",1,0,-1) 'take measuremt (soil moisture)
       
Delay(0,2,Sec)
     
SDI12Recorder (Soil_SDI12(9),C1,"5","C2!",1,0,-1) 'take measuremt (soil temp)
       
Delay(0,2,Sec)
     
SDI12Recorder(Soil_SDI12(17),C1,"5","C1!",1,0,-1) 'take measuremt (soil salinity)
                
CallTable Table1  'Call Data Table and Store Data
 
NextScan


JDavis Apr 24, 2020 04:39 PM

Use a positive number in the FillNan parameter of SDI12Recorder(). See my response to your other post.


Shanks.J Apr 27, 2020 08:43 PM

Thanks JDavis,
where is the fill nan? 

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