byNathanael Wright|更新:2019年1月16日|评论:2

您是否知道可以在我们的新数据记录仪上使用集成的蜂窝调制解调器和我们的外部坎贝尔科学品牌的蜂窝模块来监视数据使用情况?在这个两部分的系列中,我将首先向您展示如何在CR310-Cell210的CRBASIC代码中执行此操作。该代码将适用于具有集成的蜂窝调制解调器的CR300系列数据元素的任何型号。当您将其与CR300,CR310,CR6或CR1000X数据拨号器一起使用时,它也适用于我们的外部蜂窝细胞2XX模块。请注意以下数据记录器操作系统兼容性要求:
Looking Ahead:In the second article of this series, I’ll show you how to monitor your data usage using serial commands with our external CELL2XX series of cellular modules using the CR800, CR850, CR1000, or CR3000 dataloggers.
The CR300, CR310, CR1000X, and CR6 dataloggers record cellular data usage that can be used in your data logger programs to turn off interfaces and perform a variety of functions. These values are already stored in the hidden Settings table under some of the following field names:
设置s.CellUsageToday Settings.CellUsageYesterday Settings.CellUsageMonth Settings.CellUsageLastMonth
Recording this data is as easy as adding the values to a CRBasic DataTable, as shown below:
DataTable(CELL_DIAGNOSTICS, True, -1) Sample(1, Settings.CellUsageToday, FP2) Sample(1, Settings.CellUsageYesterday, FP2) Sample(1, Settings.CellUsageMonth, FP2) Sample(1, Settings.CellUsageLastMonth, FP2) EndTable
有关控制变量及其显示方式的更多选项,请按照下面概述的四步过程。
To start monitoring your data usage with CRBasic code, first declare your variable(s) and assign units to the variable(s). In my example below, I am using “cell_todays_usage,” “cell_yesterdays_usage,” “cell_this_months_usage,” and “cell_last_months_usage.”
Public cell_todays_usage Public cell_yesterdays_usage Public cell_this_months_usage Public cell_last_months_usage Units cell_todays_usage = KB Units cell_yesterdays_usage = KB Units cell_this_months_usage = KB Units cell_last_months_usage = KB
If you want to store the usage information in a DataTable, create a new DataTable or add the values to an existing DataTable. Below, the example is included with additional options for yesterday’s usage, this month’s usage, and last month’s usage:
DataTable(CELL_DIAGNOSTICS, True, -1) Sample(1, cell_todays_usage, FP2) Sample(1, cell_yesterdays_usage, FP2) Sample(1, cell_this_months_usage, FP2) Sample(1, cell_last_months_usage, FP2) EndTable
Within yourScan()sequence set the variable(s) you have declared equal to设置s.CellUsageTodayor the other data usage values shown below. Using your variable(s) you can run it against conditional statements to program your logger’s behavior.
cell_todays_usage = Settings.CellUsageToday cell_yesterdays_usage = Settings.CellUsageYesterday cell_this_months_usage = Settings.CellUsageMonth cell_last_months_usage = Settings.CellUsageLastMonth
If you are recording your data to a table, ensure you are writing your values using theCallTable()instruction. To avoid interrupting the reading of our other sensors during normal program operation, I placed myCallTable()instruction in a SlowSequence. (This is more relevant if you are using a larger number of commands than what we are using in this example and may not be necessary for your situation.) Be sure to use theCallTable()instruction if you are recording the values.
SlowSequence Scan (10, Min, 0, 0) cell_todays_usage = Settings.CellUsageToday cell_yesterdays_usage = Settings.CellUsageYesterday cell_this_months_usage = Settings.CellUsageMonth cell_last_months_usage = Settings.CellUsageLastMonth CallTable CELL_DIAGNOSTICS NextScan
When you have completed the steps, your program should look similar to this:
'Declare Public Variables Public battery_voltage Public panel_temperature_c 'cell modem diagnostics information Public cell_todays_usage : Units cell_todays_usage = KB Public cell_yesterdays_usage : Units cell_yesterdays_usage = KB Public cell_this_months_usage : Units cell_this_months_usage = KB Public cell_last_months_usage : Units cell_last_months_usage = KB DataTable(CELL_DIAGNOSTICS, True, -1) Sample(1, Settings.CellUsageToday, FP2) Sample(1, Settings.CellUsageYesterday, FP2) Sample(1, Settings.CellUsageMonth, FP2) Sample(1, Settings.CellUsageLastMonth, FP2) EndTable DataTable(TEST_DATA, True, -1) DataInterval(0, 5, Min, 10) Minimum(1, battery_voltage, FP2, True, False) Sample(1, panel_temperature_c, FP2) EndTable 'Main Program BeginProg Scan (1,Sec,0,0) PanelTemp (panel_temperature_c,60) Battery (battery_voltage) CallTable TEST_DATA NextScan SlowSequence Scan (10, Min, 0, 0) cell_todays_usage = Settings.CellUsageToday 'reported in KB cell_yesterdays_usage = Settings.CellUsageYesterday 'reported in KB cell_this_months_usage = Settings.CellUsageMonth 'reported in KB cell_last_months_usage = Settings.CellUsageLastMonth 'reported in KB CallTable CELL_DIAGNOSTICS NextScan EndSequence EndProg
Additional integrated cellular modem values are available that you can use. A short list is below:
设置s.CellRSSI 'read RSSI (signal strength) from tower Settings.CellUsageToday 'usage reported in KB Settings.CellUsageYesterday 'usage reported in KB Settings.CellUsageMonth 'usage reported in KB Settings.CellUsageLastMonth 'usage reported in KB Settings.CellInfo 'Cell Info. The information that shows in DevConfig's Cellular Network Status field. Settings.CellStatus 'Status of the cellular modem. Settings.CellRSRP 'Reference signal received power for LTE in dbm. Settings.CellECIO 'Reference signal received quality for 3G. Settings.CellRSRQ 'Reference signal received quality for 4G. Settings.CellState 'State that the modem is in. "Network ready." Lets me know my modem is good to go. CellState can be the following (but not limited to): '"Power off.", '"Powering up.", '"Powered up.", '"SIM authorized.", '"Setting baud rate.", '"Waiting for baud rate.", '"Baud rate set.", '"Baud rate failure.", '"Power off. Waiting for retry.", '"Powered up. SIM auth failure.", '"Querying modem.", '"Waiting for network registration.", '"Configuring modem.", '"Dialing.", '"Dialing (retry).", '"Dialed.", '"PPP negotiation.", '"Network ready.", '"PPP closing.", '"PPP paused.", '"PPP dropped.", '"Terminal AT command mode.", '"Firmware update mode.", '"Shutting down."
You can download theCR3XX Settings example programthat uses these values.
You can monitor and program control functions into your data logger based upon data usage and other values associated with Campbell Scientific's internal and external cellular modems. Options available include:设置s.CellUsageToday, Settings.CellUsageYesterday, Settings.CellUsageMonth,and设置s.CellUsageLastMonth.
学分:我的所有代码示例均来自Campbell Scientific,Inc。的通信和软件产品Gary Roberts创建的代码。万博matex网页登录
I hope you found this program example helpful. Try using the code to monitor your data usage, andpost a comment below about your experience. Also, post any questions you may have.
Remember:In the next article, we'll explore using serial commands with our external CELL2XX-series modules using the CR800, CR850, CR1000, and CR3000 dataloggers.
评论
PILO|01/04/2021 at 03:25 PM
Hi, we would want to know of much data is stored per device/sensor??? In order to get a suitable data plan. We will use a cellular modem CELL215 with CR1000X. Thanks
Nathanael|01/05/2021 at 04:48 PM
为了做一个好猜测,我们需要了解更多信息。您有什么传感器?您多久从每个传感器中读取一次?您多久下载文件?如果您认为25MB计划可能对您有用,我的建议是使用250MB计划,因为成本差异很小,并且可用的数据量为10倍。在我们的支持线上与我们联系,我们可能会更快地为您提供答案。435.227.9100
Pleaselog in or registerto comment.