byJacob Davis| Updated: 06/17/2015 | Comments: 3
Through programming, relatively slow SDI-12 measurements can coexist, without problems, alongside fast measurements. To illustrate the need for accommodations in your data logger program, I will share the story of the worst sunburn I ever got.
Southern Peru is near the Pacific Ocean, yet is home to the driest place on Earth. In these deserts are some of the world's largest copper mines. Mines need water to operate, so it is critical to closely monitor the available water supply. Campbell Scientific equipment is used by mines for monitoring the water supply as well as to collect data for environmental compliance.
I made a trip to southern Peru to provide training and customer support for a mining customer. On my last day in the area, I went with the customer to a weather station on a peak in the Andes with an elevation above 10,000 ft. The view and the elevation were both breathtaking. The station on the peak, however, was skipping scans, which resulted in some missed measurements.
The weather station was running on a 1 second scan interval and had anSR50Asnow level sensorconnected to it. When all sensors were connected and things were running well, the data logger was able to complete all the measurements within the 1 second interval. The problem exhibited itself when the SR50A was removed during the summer. With the SR50A removed, the data logger spent extra time retrying communication to the missing sensor. This meant that the data logger took more than 1 second to complete all of its measurement tasks, and thus skipped scans.
There was nothing wrong with the hardware, and the problem could be resolved with a small change to the data logger program. I took out my laptop, sat down, and began modifying the data logger program right then and there.
这是晒伤发生的地方。太阳在我的背上。我穿着一件长袖衬衫和一顶全额外的帽子,以保护。当天早些时候,我涂了一些防晒霜。但是,当您靠近赤道时,太阳更加强烈。同样,在高海拔时,阳光穿越较少的气氛,而较大的紫外线则使其成为表面。向前倾斜以查看笔记本电脑的屏幕,我的帽子的阴影向上移动,把脖子的底部留在了太阳上。我手的背部也直接暴露于阳光下。
With the program working perfectly, later that day, I headed to the airport. On the way, I began to feel the effects of the sunburn. The base of my neck and the back of my hands turned bright red. They were red like the primary color. My hands didn't burn as badly as my neck, as they were occasionally shaded by my body. The skin on my neck, however, blistered and peeled. After a couple of days spent applying lotion to the burn every couple of hours, I was able to sleep through the night again. My neck remained red for another week.
To avoid the same sunburned fate as me, you can proactively write your programs in a way that won't skip scans. There are two ways to run SDI-12 sensors at a slower rate than your other measurements.
The simplest way to do this is by using the "C" SDI-12 command. The “C” command is the concurrent command and allows other measurements to occur while a data logger is awaiting the sensor's response. The CR1000 datalogger has a multitasking operating system that handles the SDI-12 communications as a task separate from your analog measurements. Not all sensors support the use of the “C” command. Refer to your sensor manual to see which SDI-12 commands are supported.
An example of using the “C” command:
“ CR1000”声明变量和单位公共BattV公共PTEMP_C公共Airtemp公共SR50A(2)公共TCDT公共snowdepth别名sr50a(1)= dt别名sr50a(2)'定义数据表DataTable(每小时,true,-1)datainterval(0,60,min,10)平均值(1,snowdepth,fp2,false)示例(1,airtemp,fp2)EndTable DataTable(每日,true,true,-1))datainterval(0,1440,最小值,10)最小值(1,Battv,fp2,false,false)端尾'Main Prograble'beginprog'主扫描(1,sec,1,0)'默认数据编号电池电压测量'battv'battv'battv''battv''电池(BATTV)“默认接线面板温度测量'PTEMP_C'PANELTEMP(PTEMP_C,_60Hz)'107温度探针测量'airtemp'Therm107(airtemp,1,1,1,0,_60Hz,1,0)'sr50a sr50a sorn sonic ranganging ranganging ranging ranging ranging ranging Sensor(SDI-12输出)测量'dt','q','tcdt'和'snowDepth'Sdi12Recorder(sr50a(Sr50a(),7,“ 0”,“ 0”,“ C1!”,1,0)tcdt = dt*sqr((airtemp+273.15)/273.15)snowdepth = 2.5-tcdt'呼叫数据表和存储数据表可呼叫每日呼叫每日nextscan endscan endprog
The other way to run SDI-12 measurements at a slower rate is by placing any SDI-12 measurement in a slow sequence. A scan in a slow sequence behaves like your main scan, except it pauses whenever the data logger is busy with the main scan. The SDI-12 measurement process takes several steps, and these steps would be broken up and scheduled to take place between main scans.
SDI-12测量以缓慢序列的示例:
“ CR1000”声明变量和单位公共BattV公共PTEMP_C公共Airtemp公共SR50A(2)公共TCDT公共snowdepth别名sr50a(1)= dt别名sr50a(2)'定义数据表DataTable(每小时,true,-1)datainterval(0,60,min,10)平均值(1,snowdepth,fp2,false)示例(1,airtemp,fp2)EndTable DataTable(每日,true,true,-1))datainterval(0,1440,最小值,10)最小值(1,Battv,fp2,false,false)端尾'Main Prograble'beginprog'主扫描(1,sec,1,0)'默认数据编号电池电压测量'battv'battv'battv''battv''Battery(BattV) 'Default Wiring Panel Temperature measurement 'PTemp_C' PanelTemp(PTemp_C,_60Hz) '107 Temperature Probe measurement 'AirTemp' Therm107(AirTemp,1,1,1,0,_60Hz,1,0) 'Call Data Tables and Store Data CallTable Hourly CallTable Daily NextScan SlowSequence Scan (5,Sec,3,0) 'SR50A Sonic Ranging Sensor (SDI-12 Output) measurements 'DT', 'Q', 'TCDT', and 'SnowDepth' SDI12Recorder(SR50A(),7,"0","M1!",1,0) TCDT=DT*SQR((AirTemp+273.15)/273.15) SnowDepth=2.5-TCDT NextScan EndProg
I invite you to review your existing programs for stations that use SDI-12 sensors. Consider if these programs need changes to account for potential delays caused by SDI-12 retries.
Recommended for You:For assistance configuring an SDI-12 sensor, watch ourTransparent Mode video和我们的Watch or Sniffer Mode video. |
Proactively make accommodations for SDI-12 in your program and don't get burned!
Comments
JDavis|09/01/2015 at 08:50 AM
Anything that makes the scan take more than the scheduled interval can cause skipped scans. The Status table has MeasureTime, ProcessTime, and MaxProcTime values that indicate how much time the scan actually takes. There is also a special InstructionTimes instruction that can be added to a program to narrow down what is using up time.
KH|09/07/2015 at 05:05 PM
你好,是的cob,
Very good advice. Thank you. Can you explain what the C and R command differ each other? Do they require different time to get data from same SDI device? If yes, which one needs shorter second?
Best Regards
KH Hong
JDavis|09/08/2015 at 08:34 AM
In SDI-12, the R command is continuous mode. Sensors that support it will continually run, updating the measurement result internally. The R command just retrieves the result.
The C command is for concurrent mode. Concurrent mode allows multiple sensors on the same channel to be performing their measurement sequence at the same time. The CR800, CR1000, CR3000, and CR6 handle the C mode a special way. These dataloggers will send the C command to the sensor and retrieve the result on a following scan. The measurement might lag a scan behind the other measurements, but the datalogger won't be delayed. For more information about this behavior, refer to the help for SDI12Recorder in the CRBasic help.
Pleaselog in or registerto comment.