How to read data from 2N®SmartCOM (PRO) memory?

AMS (Autonomous Metering System) – protocol M-Bus
AMS (Autonomous Metering System) - protocol IEC 62056-21

Readout data from 2N®SmartCOM (PRO):

AT^SCDATA=?

^SCDATA: "MESS_CNT"                        - number of saved messages in memory

^SCDATA: "GET_SPACE"                      - available memory in bytes

^SCDATA: "GET_OLDEST"                    - listing of oldest message

^SCDATA: "GET_FILTERED","0-150"      - listing messages by applied filter

^SCDATA: "DEL_OLDEST"                    - delete oldest message

^SCDATA: "DEL_ALL"                           - delete all saved messages

OK


Command "get_oldest"

at^scdata="get_oldest"                         - listing oldest message

at^scdata="get_oldest", X                     - listing X oldest messages

Answer:

^SCDATA:<type_of_record>,<time_stamp>,<sequential_number>,<protocol>,<index>,<error_code>,<device_identification>,<data>

<type of record> - type of record - AMS (Autonomous Metering System) or WMBUS (Wireless M-BUS)

<time_stamp> - time mark (32-bit Unix timestamp)

<sequential_number> - sequential number of saved record (increasing +1)

<protocol> - name of protocol (IEC62056-21", "MBUS", "AIN_DIN", "Unknown")

<index> - index of device from table of devices

<error_code> - number 0 = without error

<device_identification> - only used for IEC 62056-21 (not used in M-Bus and "AIN_DIN")

<data> - raw data


Example:

at^scdata="get_oldest",2

^SCDATA: "AMS",1449585962,4,"MBUS",1,0,"","685E5E680800726817030865329906AF0000000C13022000000B22746404046D0511E81C326C00000C786817030806FD0C0A000100FA010DFD0B05313248465701FD0E004C1374180000426CDF1C0F37FD170000000000000000027A2502027825021F16"

^SCDATA: "WMBUS",1449586020,5,-68,20,"44B409466316140A077A9B0800000C1305000000"


Command "del_oldest"

at^scdata="get_oldest"            - delete oldest message

at^scdata="get_oldest"            - delete X oldest messages

at^scdata="del_all"                  - delete all saved messages

Command "get_filtered"

Commnad for filtering saved messages. It is possible to use up to 10 conditions in one "get_filtered" command


AT^SCDATA="GET_FILTERED",<filter>

General format for <filter> is <condition>;.......;<condition>

Answer is listed only when all conditions are passed


General format for <condition> is> <parameter><relation><value><parameter>


Available <parameters>:

RECORD_TYPE - Type of record - AMS or WMBUS

TIME - timestamp in unix format - "32-bit Unix timestamp"

TABLE_ID - index of the device in the table

ERROR_CODE - error code


Available <relation>:

== - is equal

!= - not equal

> - greather then

>= - greather then or equal

< - is less then

<= - is less then or equal


Available <value>:

text string or value


Examples:

listing of all Wireless M-BUS messages in memory

AT^SCDATA="GET_FILTERED","RECORD_TYPE==WMBUS"


listing of all AMS messages with timestamp from 1388665085 till 1388668685 including

AT^SCDATA="GET_FILTERED","RECORD_TYPE==AMS;TIME>=1388665085;TIME<=1388668685"


listing of all AMS messages, which were receive from device 1 and have timestamp newer than 1388665085

AT^SCDATA="GET_FILTERED","RECORD_TYPE==AMS;TIME>1388665085;TABLE_ID==1"


listing of all messiges without error (error code is 0)

AT^SCDATA="GET_FILTERED","ERROR_CODE!=0"


listing of all AMS messages without error (error code is 0) and and have timestamp newer than 1388668685

AT^SCDATA="GET_FILTERED","ERROR_CODE==0;RECORD_TYPE==AMS;TIME>1388668685"

Troubleshooting:

Test 2N® SmartCom (PRO) - Terminal error buffer code description