CRBasic Example 3: CELL200 series settings configuration and status retrieval using terminal
SerialFlush
(ComSDC11)
SerialOut
(ComSDC11,
'Query for today's cellular data usage
SerialIn
(returned_value, ComSDC11, 100,
modem_current_day_usage = returned_value
SerialFlush
(ComSDC11)
SerialOut
(ComSDC11,
'Query for yesterday's cellular data usage
SerialIn
(returned_value, ComSDC11, 100,
modem_previous_day_usage = returned_value
SerialFlush
(ComSDC11)
SerialOut
(ComSDC11,
'Query for this month's cellular data usage
SerialIn
(returned_value, ComSDC11, 100,
modem_current_month_usage = returned_value
SerialFlush
(ComSDC11)
SerialOut
(ComSDC11,
'Query for last month's cellular data usage
SerialIn
(returned_value, ComSDC11, 100,
modem_previous_month_usage = returned_value
SerialFlush
(ComSDC11)
SerialOut
(ComSDC11,
'Query for last month's cellular data usage
SerialIn
(returned_value, ComSDC11, 100,
modem_battery_voltage = returned_value
CallTable
CELL_DIAGNOSTICS
NextScan
EndSequence
SlowSequence
Do
Delay
(1, 5, Sec)
If(TimeIsBetween
'make sure the modem is off at 10 minutes into
'the hour until 58 minutes into the hour
'PPPClose'Uncomment line for CR1000, CR800 series, and CR3000.
Do Until
(modem_is_off = TRUE)
SerialFlush
(ComSDC11)
'clean out any garbage characters that might have come in.
SerialOut
(ComSDC11, CRLF ,
functionality
"show usage today"
"show usage yesterday"
"show usage month"
"show usage lastmonth"
"show bat"
& CRLF, CRLF, 1, 200)
(10, 58, 60, Min)
"CELL2xx>"
& CRLF, CRLF, 1, 200)
CHR
(13), 1000)
& CRLF, CRLF, 1, 200)
CHR
(13), 1000)
& CRLF, CRLF, 1, 200)
CHR
(13), 1000)
& CRLF, CRLF, 1, 200)
CHR
(13), 1000)
CHR
(13), 1000)
AND
modem_is_off <> TRUE)
, 1, 200)
CELL200-Series 4G LTE Cellular Module
Then
71