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 timing problem, 1Hz, four WindSonic4 on one CR3000


Phil_AT Mar 7, 2017 05:04 PM

Hi guys,

at the moment we are trying to run four Gill Windsonic4 (SDI12) on a CR3000 with a 1Hz scan rate.

  • CR3000 with logger OS version 28.02 (will be updated within the next days)
  • Four Windsonic4 (bought in 2016) cable length 3m, 5m, 10m and 15m, connected to C1, C3, C5, C7
  • (If everything runs smoothly, I want to add another three HC2-S3, two CMP21, two CGR4, one SR50A (probably no good idea, cause its using SDI12 as well) and an ARG100)

First of all this four Windsonic4 have to work, but whatever I try results in skipped scans.

I tried to use them on two com ports which didn’t work. Then I tried, as advised from Campbellsci DE, to put each sensor on one com port. I’ve tried to play with different commands, if sequences, sub sequences, sequential mode instead of pipeline mode, … , no results. What I didn’t try yet is to update the logger OS to the newest version (will be updated the next days during maintenance)

I am pretty sure it is a timing problem and hope someone can help me to cope with it.

The program I am currently using: (by the way, increasing the scan buffer doesn’t help as well)

'CR3000 Series Datalogger
  '20170306

PipeLineMode

'*****************************************************************************
'*** Public Variables ***
 
'**** Gill WindSonic4 - 2D ultrasonic windspeed and direction
Public windsonic4_1(3)
Alias windsonic4_1(1) = wind_direction_1   : Units wind_direction_1 = degrees
Alias windsonic4_1(2) = wind_speed_1       : Units wind_speed_1 = m/s
Alias windsonic4_1(3) = diag_windsonic4_1  : Units diag_windsonic4_1 = unitless

Public windsonic4_2(3)
Alias windsonic4_2(1) = wind_direction_2   : Units wind_direction_2 = degrees
Alias windsonic4_2(2) = wind_speed_2       : Units wind_speed_2 = m/s
Alias windsonic4_2(3) = diag_windsonic4_2  : Units diag_windsonic4_2 = unitless

Public windsonic4_3(3)
Alias windsonic4_3(1) = wind_direction_3   : Units wind_direction_3 = degrees
Alias windsonic4_3(2) = wind_speed_3       : Units wind_speed_3 = m/s
Alias windsonic4_3(3) = diag_windsonic4_3  : Units diag_windsonic4_3 = unitless

Public windsonic4_4(3)
Alias windsonic4_4(1) = wind_direction_4   : Units wind_direction_4 = degrees
Alias windsonic4_4(2) = wind_speed_4       : Units wind_speed_4 = m/s
Alias windsonic4_4(3) = diag_windsonic4_4  : Units diag_windsonic4_4 = unitless

Public batt_volt            'CRBasic datalogger battery voltage.
Public panel_temp
Units panel_temp = C
Units batt_volt = V

'***************************************************************************************
'*** Final Output Data Tables ***
 
DataTable (Windsonic,TRUE,-1)
  DataInterval (0,1,Sec,0)
 ' CardOut (0,-1)
  Sample (3,windsonic4_1(),IEEE4)
  Sample (3,windsonic4_2(),IEEE4)
  Sample (3,windsonic4_3(),IEEE4)
  Sample (3,windsonic4_4(),IEEE4)
EndTable

'**************************************************************************************
'*** Program ***

BeginProg
  Scan (1,Sec,3,0)
    'CRBasic datalogger panel temperature and battery voltage.
        PanelTemp (panel_temp,250)
        Battery (batt_volt)
    
    'Get WindSonic4 data - 2D windspeed and direction
 
        SDI12Recorder (windsonic4_1,1,1,"R0!",1,0)
        SDI12Recorder (windsonic4_2,3,2,"R0!",1,0)
        SDI12Recorder (windsonic4_3,5,3,"R0!",1,0)
        SDI12Recorder (windsonic4_4,7,4,"R0!",1,0)
            
CallTable(Windsonic)
NextScan
EndProg


JDavis Mar 7, 2017 05:14 PM

The R0! command you are already using is the fastest method to get the data out of the Windsonic option 4.

Unfortunately, SDI12 is a slow interface. It just takes a long time for the data to come across the interface. If you look at the ProcessTime in the Status table, you will see that it takes more than 1 second to go through 4 SDI12 sensors.


Phil_AT Mar 7, 2017 06:38 PM

I already recognized this ProcessTime issue..

My hope was that there is a way to force the cr3000 to start several commands almost simultaneously. B.e. in the first 200ms from this one second. (with a distance of 50ms or something like that) 

Isn't there a lot of idle time while the processor is waiting for response of the sensor? (200-250ms) The idea was to use each sensor on a different port and try some kind of "fake multiprocessor technique"


JDavis Mar 7, 2017 06:55 PM

The SDI12 protocol runs at 1200 baud, and there is spacing time. It is not a matter of processor idle time. It is the nature of SDI12 that uses so much time.


chris_measci Jun 7, 2017 06:36 AM

I’m interested by your question.  It would be interesting to see what the response was if you went to SDI12 terminal mode and hand entered 0R0! You would see the response in the format a<values><CR><LF>.  The advantage of the R command is that there is no delay between the M (measure) instruction and the D (send data command).

I’m going to make some assumptions:

  • The 0R0! command is 4 characters,
  • The response is an ID plus 3 parameters (i.e. a<values><CR><LF>) So that’s 1 for the ID, then a + or a -, and then up to 7 digits per value.  That’s worst case.   I can’t imagine that wind direction uses 7 digits.  I’m going to assume 5 digits per number which I think will cover it.  5 plus the sign per value, plus 1 overhead and <CR><LF>.  21 characters.
  • 25 characters total

Each byte frame is 1 start bit, 7 data bits, 1 parity bit, 1 stop bit.  That’s 10 bits per character, or 250 bits per complete message.  1200 baud is 1200 bits per second, so you can just squeeze in 4 instruments within the second.  Is there an error in my math?

If you started each command 250mS from each other, it seems that there might just be some spare time.  Have you tried a program that this and then watched the SDI12 terminal mode for responses?

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