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.

several sensors on one SDI12-channel


Chasper B. Feb 11, 2020 10:51 AM

Hi there

I have several SDI12-sensors on a CR1000X. From my earlier experience and from the sensors manual too, it should be possible to connect more than one sensor to the same control port, of course with different addresses.

In the earlier project I read all sensors (of the same type) with one command and that works fine. With my actual project I want to connect different sensors to the same channel and therefore can't combine all requests in one command. By placing two SDI12Recoder-functions I get a compile error like:

[Version]C:\Campbellsci\Lib\Compilers\CR1000XComp.exe VERSION:CR1000X.Std.03.02  DATE:04/15/2019
Tajikistan_snowdrift-_meteostation.cr1x -- Compile Failed!

line 184: SDI12Recorder: channel C3 already in use or unavailable.
Error(s) detected in the program. Double-click an error above to navigate to it.

Does anyone knows how to handle this issue? I'm limited with the control ports and therefore can't use a different port for each sensor.

Thanks in advance and best Regards,

Chasper


meteor Feb 12, 2020 07:39 AM

Hi,

can you post the program code?

Uwe


Chasper B. Feb 12, 2020 08:37 AM

Hi Uwe

Thanks for your answer. As the whole code is quite complex (over three files) I post here the first part of the first slow sequence with the two concerning calls of SDI12Recorder, where ClimaTRH_SDIPort is defined with C3:

'---   measurement slow scan loop - measurement tasks   ------------------------------
  SlowSequence
    Scan (SlowScanMeasureInterval,min,0,0)
      Battery (BatteryVoltage)       'measure loggers voltage supply and temperature
      PanelTemp (LoggerTemp,50)
      
      BrHalf (WindDir_Prop,1,mV5000,AnemoPropDir_SEch,AnemoPropDir_VxCh,1,4000,True,20000,15000,PropDirMul,0)
        'measure the propellers rotation and the direction potentiometer, anemometer
      SDI12Recorder (ClimaVueData(),ClimaTRH_SDIPort,ClimaVueAddress,ClimaVue_StdReadCMD,1,0,-1)
        'read CimaVUE50s measurement values (all 14 values)
      PresVapour = PresVapour * KiloToHecto              'convert from kPa to hPa
      PresBaroAbs = PresBaroAbs * KiloToHecto            'convert from kPa to hPa
      RelHum_ClimaVue = RelHum_ClimaVue * FracToPercent  'from fraction (0-1) to %
      SDI12Recorder (TRHData(),ClimaTRH_SDIPort,TRH_CS215Address+TRH_HygroVueAddress,TRH_StdReadCMD,1,0)
        'read measurement values from CS215 and HygroVUE10 TRH-sensors
      SI111Measure ()   'measure & calculate snow surface temperature
      Therm107 (TempSoil_1,1,SoilTemp1_SEch,SoilTemp1_VxCh,0,15000,1,0) 
      Therm107 (TempSoil_2,1,SoilTemp2_SEch,SoilTemp2_VxCh,0,15000,1,0)
        'measure thermistors for soil temperature
      If PortGet_UsrFct(SN500SS_Pwr) = True Then
        SDI12Recorder (RadNet_SN500SS(),SN500SS_SDIPort,SN500SS_Address,SN500SS_ReadCMD,1,0)
      EndIf                'measure radiation values, if sensor is on
      If PortGet_UsrFct(LufftSnowHeight_Pwr) = True Then
        SDI12Recorder (SnowHeight_Lufft(),LufftSDIPort,LufftSHM31_Address,Lufft_ReadCMD,1,0)
      EndIf                'measure values of laser snow height sensor, if it's on
      If PortGet_UsrFct(FlowCapt_Pwr) = True Then
        SDI12Recorder (SnowDrift_FC4(),FlowCaptSDIPort,FlowCapt_Address,FlowCapt_ReadCMD,1,0)
      EndIf                'measure snow drift sensor values, if sensor is on

      CallTable Meteodata_Entire
      CallTable ServiceData
...

But now I found the problem, I made a function which directly returns the state of the control ports. To keep this function generally, I inserted a PortGet for C3 too, even if I don't use the function with parameter C3 later on. With this the port became unavailable.

Now I commented the PortGet with C3 and the compiler and me are both happy. :-)

Thanks a lot and have a nice day.

Chasper

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