CRBasic Example 3: CELL200 series settings configuration and status retrieval using terminal
functionality
Public modem_previous_month_usage As Long 'Previous month's data usage
Units modem_previous_month_usage = kB
Public modem_rsrp 'Current modem RSRP value (LTE signal Strength)
Public modem_rsrq 'Current modem RSRQ value (LTE signal Quality)
Publicc modem_rssi 'Current modem RSSI value (3G signal strength)
Public modem_sdc_address 'Modem's current SDC address (CS I/O Port SDC
'Address setting)
Public modem_state As String * 60 'Current state of the modem (status)
Public modem_is_off As Boolean
Public modem_reset_needed As Boolean
'variables used to parse the strings returned by the modem.
Const CRLF = CHR(13) & CHR(10)
Public returned_value As String * 70
'Temp string to hold the values returned by the modem
'Other variables
Public battery_voltage
Public panel_temperature_c
DataTable(CELL_DIAGNOSTICS, TRUE, -1)
Sample(1, modem_apn, String)
Sample(1, modem_battery_voltage, FP2)
Sample(1, modem_current_day_usage, IEEE4)
Sample(1, modem_current_month_usage, IEEE4)
Sample(1, modem_diversity, String)
Sample(1, modem_ecio, FP2)
Sample(1, modem_ipprotocol, String)
Sample(1, modem_mode, String)
Sample(1, modem_previous_day_usage, IEEE4)
Sample(1, modem_previous_month_usage, IEEE4)
Sample(1, modem_rsrp, FP2)
Sample(1, modem_rsrq, FP2)
Sample(1, modem_rssi, FP2)
Sample(1, modem_sdc_address, FP2)
Sample(1, modem_state, String)
Sample(1, modem_is_off, Boolean)
Sample(1, modem_reset_needed, Boolean)
EndTable
BeginProg
'Setup Campbell Scientific external modem
#If ((LoggerType = CR6 AND OSVERSION >= 9) OR (LoggerType = CR1000X AND _
OSVERSION >= 3) OR LoggerType = CR300 AND OSVERSION >= 8)) Then
SetSetting("CellAPN", "****.****")
'Replace *s with APN assigned by cellular provider
CELL200-Series 4G LTE Cellular Module 66