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.

No readings in one Table (CR1000)


RaülOo Mar 22, 2017 11:27 AM

Hi,

I am running a code to have readings on a CR1000 datalogger of a set of sensors, one type of sensors are located in a vertical profile (in the soil) and the other sensors are located on a meteo station above the ground.

The group of sensors on the vertical profile corresponds to Table (Perfil_N) , and the sensors on the meteo station correspond to Table (Meteo).

I have the following problem: I only obtain the first timestamp in Table (Meteo). Instead, I obtain all the timestamps readings of Table (Perfil_N). When I monitor the data with PC4000, the recnum of Meteo Table stays in 0, and the timestamp does not move also, not the same with Perfil_N Table, where the recnum and the timestamp increases.

Thanks, advice is welcome

Raül

PD: I paste part of the code:

ConstTable
    Const frecscan= 10
    Const frecrec= 10
    Const batt_min= 11.0     ' Threshold battery voltage to activate highly restricted modem conection (less than one huor per day).
    Const batt_crit= 10.5     ' Threshold battery voltage to activate modem disconnection.
    Const flag_battery_low_modem_off= 15   'Minutes to disconnect the modem after detecting the battery critic.
    Const modem_start_time= 600
    Const modem_stop_time= 660
    Const mph_modem_on= 30
    Const lowbatt_modem_on= 600
    Const lowbatt_modem_off= 660
    Const lowbatt_mph= 15   
    Const modem_time_control= -1
EndConstTable                                                                      

Const profileNum= 2
Const Num5TE= 6 'numero de total de sensores 5TE
Const Num5TE_perprofile= Num5TE/profileNum  'numero de sensores 5TE por perfil
Const NumT4C= 2
Const NumT4C_perprofile= NumT4C/profileNum  'numero de sensores T4C por perfil
Const NumT107= 6
Const NumT107_perprofile= NumT107/profileNum  'numero de sensores T107 por perfil
Const NumMPS6= 4
Const NumMPS6_perprofile= NumMPS6/profileNum  'numero de sensores MPS6 por perfil
Const NumVP4= 2
Const NumVP4_perprofile= NumVP4/profileNum  'numero de sensores MPS6 por perfil

'Declare Dim Variables
Dim nowmin  As Long
Dim battery_low, battery_crit As Boolean
Dim r,s,t, addressN
Dim A,B,C,D,E,F,G,H,I,J,K,L,M,N As String

'Declare Public Variables
Public batt_volt, PTemp As Float
Public Rain_mm as Float


Public Raw5TE(Num5TE,3)As Float
Public VWC(Num5TE)As Float
Public EC(Num5TE)As Float
Public SoilTemp5TE(Num5TE)As Float
Public WPT4C(NumT4C)As Float
Public SoilTempT107(NumT107)As Float
Public MPS6_raw(NumMPS6,2)
Public WPMPS6(NumMPS6)
Public SoilTempMPS6(NumMPS6)
Public VP4raw(NumVP4,4)As Float
Public VapPress(NumVP4)As Float
Public AirTemp(NumVP4)As Float
Public RelHum(NumVP4)As Float
Public BaromPress(NumVP4)As Float



'Declare units
Units Rain_mm=mm
Units batt_volt= Volts
Units PTemp= deg C
Units VWC() = m3/m3
Units EC() = dS/m
Units SoilTemp5TE = deg_C
Units WPT4C= kPa
Units SoilTempT107= deg_C
Units WPMPS6= kPa
Units SoilTempMPS6= deg_C
Units VapPress = kPa
Units AirTemp = Deg_C
Units RelHum= %
Units BaromPress= kPa

'Declare tables
DataTable (Meteo,1,-1)
    DataInterval (0,frecrec,sec,-1)
    Minimum (1,batt_volt,FP2,False,False)
    Sample (1,PTemp,FP2)
    'record rainfall
    Totalize(1,Rain_mm,FP2,False)
EndTable     

DataTable (Perfil_N,1,-1)                               
    DataInterval (0,frecrec,sec,-1)
    'record 5TE
 ' Sample(Num5TE_perprofile,VWC_N(),FP2)
  'Sample(Num5TE_perprofile,EC_N(),FP2)
  'Sample(Num5TE_perprofile,SoilTemp5TE_N(),FP2)
  Sample(Num5TE,VWC(),FP2)
  Sample(Num5TE,EC(),FP2)
  Sample(Num5TE,SoilTemp5TE(),FP2)
  'record T4C
  Sample(NumT4C,WPT4C,FP2)
  'record T107
  Sample(NumT107,SoilTempT107,FP2)
  'record MPS6
  Sample(NumMPS6,WPMPS6,FP2)
  Sample(NumMPS6,SoilTempMPS6,FP2)
  'record VP4
  Sample(NumVP4,VapPress,FP2)
  Sample(NumVP4, AirTemp,FP2)
  Sample(NumVP4,RelHum,FP2)
  Sample(NumVP4,BaromPress,FP2)
EndTable
 

'Main program
SequentialMode
BeginProg

'    Call Initializing
    
    SW12(1)
    
    Scan (frecscan,Sec,0,0)
            Battery(batt_volt)
            PanelTemp (PTemp,250)
            
            'Lectura de pluviometro  
            PulseCount(Rain_mm,1,1,2,0,0.1,0)
            
            'Encendido de SW12
            SW12(1)  '==PortSet (9,1)
            
            Delay (0,10,Sec)
            
            'Lectura de 5TE's
           For t = 1 To Num5TE
      'sequentially excite each sensor numberd 1-Sensornum on C1.  Returns all 3 values for each sensor.
            SDI12Recorder (Raw5TE(t,1),1,t,"M!",1.0,0)
        Next t
        
            For t = 1 To Num5TE
            'Take bulk dielectric reading from the first element of each sensor array 5TE(i,1) and apply the Topp Equation (1980).
          VWC(t) = 4.3E-6 * Raw5TE(t,1)^3 - 5.5E-4 * Raw5TE(t,1)^2 + 2.92E-2 * Raw5TE(t,1) - 5.3E-2
          'extract the EC and temperature from the raw data array.
          EC(t) = Raw5TE(t,2)
          SoilTemp5TE(t) = Raw5TE(t,3)
        Next t
        
           
            Delay(0,1,Sec)
            
            'Lectura de WPT4C's. Note that RevEx and RevDiff must both be false to read UMS tensiometers note that multiplier
            'of -10.6 adjusts the  sign of output to standard convention (pressure = positive number andtension = negative number)
            BrFull(WPT4C,NumT4C,mV250,1,Vx1,2,2500,False,False,0,_50Hz,-10.6,0.0)
            Delay(0,1,Sec)
            
            'Lectura de T107's.
            Therm107(SoilTempT107,NumT107,5,2,0,_50Hz,1.0,0.0)
            Delay (0,1,Sec)
            
            'Lectura de MPS6's.
            For i = 1 To NumMPS6
                SDI12Recorder(MPS6_raw(i,1),3,i,"M!",1.0,0)
            Next i
            
            For i = 1 To NumMPS6
             WPMPS6(i)= MPS6_raw(i,1)
             SoilTempMPS6(i)= MPS6_raw(i,2)
            Next i
            Delay (0,1,Sec)
            
            'Lectura de VP4's
      'sequentially excite each sensor numberd 1-Sensornum on C3.  
            For i = 1 To NumVP4
                SDI12Recorder(VP4raw(i,1),5,i,"M!",1.0,0)
            Next i
                    
            For i = 1 To NumVP4
             VapPress(i)= VP4raw(i,1)
             AirTemp(i)= VP4raw(i,2)
             RelHum(i)= VP4raw(i,3)
             BaromPress(i)= VP4raw(i,4)
            Next i
            Delay (0,1,Sec)
            
        
            SW12(0)  '==PortSet (9,0)
            
            ' Data recording
            CallTable Meteo
            CallTable Perfil_N

    NextScan

EndProg




 

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