Skip to end of metadata
Go to start of metadata
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

General AMS errors
0                  - without error 
1                  - error of input data 
2                  - error of output data 
3                  - protocol cannot be used for this port
4                  - readout not started

M-Bus AMS errors
131072                 - non specific error (internal error of module)
131073                 - readout was stopped by user
131074                 - bad format address and speed of the device
131075                 - parameters of the port were not set
131076                 - message "SND_NKE" was not send in defined time interval to the device
131077                 - message "SND_NKE" was not send in defined time interval to the device
131078                 - timeout - receiving "SND_NKE" message response
131079                 - bad frame when receiving "SND_NKE" message from the device
131080                 - message "REQ_UD2" was not send
131081                 - message "REQ_UD2" was not send
131082                 - timeout - receiving "REQ_UD2" message response
131083                 - incorrect communication frame for "REQ_UD2" message
131084                 - incorrect response for "REQ_UD2" message
131085                 - incorrect device address in response for "REQ_UD2" message
131086                 - message "SND_UD slave selection" was not send in defined time interval
131087                 - message "SND_UD slave selection" was not send in defined time interval
131088                 - timeout - receiving "SND_UD slave selection" message response
131089                 - bad frame for "SND_UD slave selection" response message
131090                 - message "SND_UD slave selection" was not send in defined time interval during searching slaves on bus
131091                 - message "SND_UD slave selection" was not send in defined time interval during searching slaves on bus
131092                 - message "REQ_UD2" was not send in defined time interval during searching slaves on bus
131093                 - message "REQ_UD2" was not send in defined time interval during searching slaves on bus
131094                 - collision of secondary addresses during searching slaves on bus (two or more devices have same secondary address)
131329                 - bad first "start" byte for device´s response message
131330                 - bad second "start" byte for device´s response message
131331                 - bad first "stop" byte for device´s response message
131332                 - bad checksum of the response frame
131333                 - bad value of the response frame length
131334                 - bad value of the response frame length