Hi guys,
at the moment we are trying to run four Gill Windsonic4 (SDI12) on a CR3000 with a 1Hz scan rate.
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
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.
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"
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.
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:
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?