3.8 Autonomous Metering System (AMS)

The AMS solution provides an automatic remote reading of not only such appliances as electric meters, gas meters or water meters, but also variable sensors and detectors. Data are read, remotely collected and transmitted to central software. This provides the building manager or power supplier with fresh consumption data for further processing (service billing, e.g.). IEC 62056-21 or M-Bus via the RS 232/RS 485/M-Bus interface is used for meter communication. Data can thus be read out periodically and stored in the 2N® SmartCom PRO  internal memory for sorting and filtering. Integration of other communication protocols can be solved according to the customer's needs.

The AMS is configured via the AT interfaces described below. Log in via your terminal to an AMS-supporting 2N® SmartCom PRO and follow the instructions below. Add up to 64 independent meters to the meter list. The data space size is determined by the HW version. All records are written into a circular buffer, which means that whenever the memory is full, the oldest record will be deleted and replaced with a new one.

Note

  • The standard baud rate is 300 bps. 2N® SmartCom PRO can start communication at a higher rate if necessary, which is then decreased to the standard. To achieve the typical increased initial rate of 2400 bps, set a higher rate on port RS 485 in the 2N® SmartCom PRO configuration. When the AMS communication stops at 300 bps, the preset higher rate is reset automatically.
  • 2N® SmartCom PRO supports the A, C and E modes according to IEC 62056-21.

AMS Device Configuration

The commands below are used for meter configuring.

AT^SCAMS=?

The command writes out the list of AMS module control commands, their parameters and parameter formats. 

Reply: 

^SCAMS: "ENABLE",0|1
^SCAMS: "RETRY",0-9
^SCAMS: "DEV_ADD",1-1000,"32"|1-1000,"32","3"
^SCAMS: "DEV_REMOVE",1-32
^SCAMS: "DEV_CLEAR"
^SCAMS: "DEV_INTERVAL","ALL"|1-32,"3"
^SCAMS: "DIRECT_READ",1-1000,"32"|1-1000,"32",110-230400,0|1
OK

AT^SCAMS?

The command writes out the contents of the device list to be served by the AMS module.

Table row format:
^SCAMS: <index>> <port>,<protocol>,<address>,<interval>
  • <index> - device index in the device list - number
  •   <port> - number of the physical port to which the device is connected - number
    • 2   -  RS232/RS485/MBUS communication port (depending on HW version)
    • 128 -  internal A/D input module communication port (analogue/digital input module)
  • <protocol> - name of the communication protocol used for device communication - text string
    • "IEC62056-21" - IEC 62056-21 protocol
    • "MBUS" - M-Bus protocol
    • "AIN_DIN" - A/D input protocol (analogue/digital input module data reading protocol)
  • <address> - device address - text string
    • device address in the format corresponding to the device address format for the given protocol
  • <interval> - data reading time interval - time interval symbol text string
    • minutes, hours or days; setting options:
    • "1M", "2M", "3M", "4M", "5M", "6M", "10M", "12M", "15M", "20M", "30M", "1H", "2H", "3H", "4H", "6H", "8H", "12H", "1D"
Example of a reply if the list is empty:

^SCAMS: NO DEVICE
OK
Example of a reply if the list includes 4 devices:
^SCAMS: 1> 2,"IEC62056-21","869551","1M"
^SCAMS: 2> 2,"IEC62056-21","869552","15M"
^SCAMS: 3> 128,"AIN_DIN","1/ADC/CAL","1M"
^SCAMS: 4> 128,"AIN_DIN","2/PULSE/ABS","1H"
OK

AT^SCAMS="ENABLE",<zapnuto>

The AMS module command writes out the current state (on/off) of the AMS module (without additional details) or sets the on/off state for the AMS module (according to the parameter below).

  • <on> - if included, the parameter specifies the required new AMS on/off state and the command sets the new state; if the parameter is not included, the command writes out the currently set state - logical value
    • 0 - AMS off request
    • 1 - AMS on request

Reply format (AMS set to on):

^SCAMS: "ENABLE",1
OK

Reply format (AMS state setting command) - action succeeded:

OK

Reply format (AMS state setting command) - action failed

ERROR

AT^SCAMS="RETRY"[<retry_count>]
The AMS module command writes out the current setting of the count of the data reading retries in case reading failed (without any additional parameters) or sets the count of the device data reading retries (according to the parameter below).
  • <retry_count> -  if included, the parameter specifies the required device data reading attempts in case reading failed with an error, which allows for retrying data reading; if the parameter is not included, the command writes out the currently set retry count value.
      • number, range: 0 to 9

Reply format (currently set value identifying command):

^SCAMS: "RETRY",<current_retry_count>
OK

Example (find the currently set device data reading attempts):

AT^SCAMS="RETRY"

Example (set the count of the device data reading retries; when the first data reading attempt fails, up to 2 more attempts will follow): 

AT^SCAMS="RETRY",2

Reply format - action succeeded:

OK

Reply format - action failed:

ERROR

AT^SCAMS="DEV_ADD",<port>,<protocol>,<address>,<interval>
 The AMS module command adds a device to the device list .
  • <port> - number of the physical port to which the device is connected - number
    • 2   - RS232/RS485/M-Bus communication port (depending on the HW version)
    • 128 - internal A/D input module communication port (analogue/digital input module)
  • <protocol> - name/number of the communication protocol used for device communication
    • numerical format (number) or symbolic name (text string)
      • for number
        • 1 - denotes the IEC 62056-21 protocol
        • 2 - denotes the M-Bus protocol
        • 128 - denotes the A/D input reading rotocol (for reading data from the  analogue/digital input module )
      • for text string
        • "IEC62056-21" - denotes the IEC 62056-21 protocol
        • "MBUS" - denotes the M-Bus protocol
      • "AIN_DIN" - denotes the A/D input reading protocol (for reading data from the  analogue/digital input module )
  • <address> - device address - text string
    • for IEC 62056-21 the address consists of a text string  <address> [@ <default_baudrate>][% <switches>], where:
      • <address> - device address (identical with the original device address)
      • < default_baudrate > - an optional parameter defining the default baud rate in Bauds
      • <switches> - an optional parameter - switch array for data reading process control. Now an 'R' switch is only implemented to prevent a change of the default baud rate
    • for M-Bus the  address consists of a text string  <address>@<baudrate>
      • <address> - M-Bus device (meter) address
        • primary address - <address> is a number ranging from 0 to 250
        • secondary address - <address> has the format *<address_8>, where <address_8> consists of 8 characters of the secondary address, where each character is:
          • a digit ranging from 0 to 9
          • a wildcard 'F' character (substituting any numerical value on the given position in the range between 0 and 9)
      • <baudrate> - communication rate in Bauds; if the parameter is not included, the default value is used. Setting options: 300, 600, 1200, 2400, 4800, 9600, 19200, 38400. Default value: 2400.
    • for A/D input protocol the  address consists of a text string  <input>/<parameter>[/<option>]
      • <input> - number of the input for which data reading is to be made, setting options:
        • 1 - input 1
        • 2 - input 2
      • <parameter> - text string specifying the data to be read; setting options:
        • ADC - analogue signal measurement on an analogue input
        • DIN - logical value reading on analogue input; result values: 0 to 1
        • PULSE - digital input pulse counter reading
      • <option> - text string specifying the parameter options; setting options: 
        • for ADC:
          • CAL - the data reading result is a calibrated value ranging from 0 to 100
          • ABS - the data reading result is a value obtained directly from the A/D converter ranging from 0 to 1023
        • for DIN - <option> is undefined and thus unavailable for this parameter
        • for PULSE:
          • ABS - the data reading result is the current pulse count read in the input pulse counter ranging from 0 to (2^64 - 1)
          • REL - the data reading result is the pulse count read after the last data reading (or pulse counter deletion/resetting) ranging from 0 to (2^64 - 1)
  • <interval> - data reading interval - time interval symbol  text string
    • count of minutes, hours or days; setting options:
    • "1M", "2M", "3M", "4M", "5M", "6M", "10M", "12M", "15M", "20M", "30M", "1H", "2H", "3H", "4H", "6H", "8H", "12H", "1D"

 — Examples of Use — 

As configuration is not easy, let us give a few examples to help you set the required function(s) successfully.

Example 1 - suppose you want to add a device to the device list, which is connected to physical port 2, communicates via IEC 62056-21, the device address is 869551 and the data reading interval is 3 minutes. The command is as follows:

AT^SCAMS="DEV_ADD",2,"IEC62056-21","869551","3M"
Example 2 - same as above, but the protocol is given in a numerical format:
AT^SCAMS="DEV_ADD",2,1,"869551","3M"

Example 3 - suppose you want to add a device to the device list, which is connected to physical port 2, communicates via M-Bus, the device address is 128, the baud rate is 2400 Bd and the data reading interval is 1 hour:

AT^SCAMS="DEV_ADD",2,"MBUS","128@2400","1H"
 Example 4 - same as above, but the baud rate is not specified and so the default baud rate of 2400 Bd is used:
AT^SCAMS="DEV_ADD",2,"MBUS","128","1H"

Example 5 - same as above, but the protocol is given in a numerical format:

AT^SCAMS="DEV_ADD",2,2,"128","1H"

 Example 6 - suppose you want to add a device to the device list, which is connected to physical port 2, communicates via M-Bus, the secondary device address is 01579411, the baud rate is 2400 Bd   and the data reading interval is 1 hour:

AT^SCAMS="DEV_ADD",2,"MBUS","*01579411@2400","1H"

 Example 7 - s uppose you want to add a device to the device list, which is connected to physical port 2, communicates via M-Bus, the secondary device address with two wildcard positions is 015794FF, the baud rate is 2400 Bd  and the data reading interval is 1 hour:

AT^SCAMS="DEV_ADD",2,"MBUS","*015794FF@2400","1H"

 Example 8 - s uppose you want to add a device to the device list, which is connected to the  A/D input port, and the interval of calibrated analogue value reading on analogue input 1 is 1 hour:
AT^SCAMS="DEV_ADD",128,"AIN_DIN","1/ADC/CAL","1H"
Example 9 - s uppose you want to add a device to the device list, which is connected to the  A/D input port, and the interval of logical value  reading on analogue input 2 is 2 hours:
AT^SCAMS="DEV_ADD",128,"AIN_DIN","2/DIN","2H"

Example 10 - same as above, but  the protocol is given in a numerical format 

AT^SCAMS="DEV_ADD",128,128,"2/DIN","2H"

Example 11 - s uppose you want to add a device to the device list, which is connected to the  A/D input port, and the interval of pulse counter reading on digital input 1 is 2 hours: 

AT^SCAMS="DEV_ADD",128,"AIN_DIN","1/PULSE/ABS","2H"

Reply format - action succeeded: 

OK

Reply format - action failed: 

ERROR

— End of Examples — 

AT^SCAMS="DEV_REMOVE",<index>

The AMS module command removes a device from the device list.

  • <index> - index of the device (in the device list) to be removed
Example - suppose you want to remove the index 4 device from the device list:
AT^SCAMS="DEV_REMOVE",4

Reply format - action succeeded:

OK

Reply format - action failed: 

ERROR
AT^SCAMS="DEV_CLEAR"

 The AMS module command removes all the devices from the device list.

Reply format - action succeeded: 

OK

Reply format - action failed: 

ERROR

AT^SCAMS="DEV_INTERVAL",<index>,<interval>

The AMS module command changes the data reading time interval for a device included in the device list.

  • <index> - index of the device (in the device list) for which time is to be changed
    • numerical format (number) or symbolic name (text string)
      • for number: index of the device (in the device list) for which time is to be changed
      • for text string: "ALL" - change time for all the devices included in the device list
  • <interval> - time interval symbol text string (minutes/hours/days), setting options:
    • "1M", "2M", "3M", "4M", "5M", "6M", "10M", "12M", "15M", "20M", "30M", "1H", "2H", "3H", "4H", "6H", "8H", "12H", "1D"

Example 1 - suppose you want to change the data reading interval to 1 hour for the index 3 device:

AT^SCAMS="DEV_INTERVAL",3,"1H"

Example 2 - suppose you want to change the data reading interval to 30 minutes for all the devices listed:

AT^SCAMS="DEV_INTERVAL","ALL","30M"

Reply format - action succeeded: 

OK

Reply format - action failed: 

ERROR
AT^SCAMS="DIRECT_READ",<port>,<protocol>,<address>,{<extra_parameter1>[<extra_parameter2>]}

The AMS module command performs immediate data reading from a device and writes out the data.

  • <port> - number of the physical port to which the device is connected - number
    • 2   - RS232/RS485/MBUS communication port (depending on HW version)
    • 128 - internal A/D input module communication port (analogue/digital input module)
  • <protocol> - name of the communication protocol used for device communication
    • for number:
      • 1   - denotes the IEC 62056-21 protocol
      • 2   - denotes the M-Bus protocol
      • 128 - denotes the A/D input protocol (for reading data from the  analogue/digital input module )
    • for text string:
      • "IEC62056-21" -  denotes the  IEC 62056-21 protocol
      • "MBUS" -  denotes the  M-Bus protocol
      • "AIN_DIN" -  denotes the A/D input protocol (for reading data from the  analogue/digital input module )
  • <address> - device address - text string
    • for IEC 62056-21 -  the address consists of a text string  <address> [@ <default_baudrate>][% <switches>], where:
      • <address> -  device address (identical with the original device address)
      • < default_baudrate > - an optional parameter defining the default baud rate in Bauds
      • < switches > - an optional parameter - switch array for data reading process control. Now an 'R' switch is only implemented to prevent a change of the default baud rate
    • for M-Bus- the  address consists of a text string  <address>[@<baudrate>]
      • <address> - M-Bus device (meter) address
        • primary address - <address> is a number ranging from 0 to 250
        • secondary address - <address> has the format *<address_8>, where <address_8> consists of 8 characters of the secondary address, where each character is:
          • a digit ranging from 0 to 9
          • a wildcard 'F' character (substituting any numerical value on the given position in the range between 0 and 9)
      • <baudrate> - communication rate in Bauds; if the parameter is not included, the default value is used. Setting options: 300, 600, 1200, 2400, 4800, 9600, 19200, 38400. Default value: 2400 .
    • for A/D input protocol  - t he  address consists of the text string  <input>/<parameter>[/<option>]
      • <input> - number of the input for which data reading is to be made, setting options:
        • 1 - input 1
        • 2 - input 2
      • <parameter> - text string specifying the data to be read; setting options:
        • ADC   - analogue signal measurement on an analogue input
        • DIN   - logical value reading on analogue input; result values: 0 to 1
        • PULSE - digital input pulse counter reading
      • <option> -  text string specifying the parameter options; setting options :
        • for ADC:
          • CAL - the data reading result is a calibrated value ranging from 0 to 100
          • ABS -  he data reading result is a value obtained directly from the A/D converter ranging from 0 to 1023
        • for DIN - <option> is undefined and thus unavailable for this parameter
        • for PULSE:
          • ABS -  the data reading result is the current pulse count read in the input pulse counter ranging from 0 to (2^64 - 1)
          • REL -  the data reading result is the pulse count read after the last data reading (or pulse counter deletion/resetting) ranging from 0 to  (2^64 - 1)
  • < extra_parameter1 > - optional protocol parameter
    • specifies the protocol default baud rate
    • IEC 62056-21 - specifies the required default baud rate of the protocol; if the parameter is not included, the default value is used
    • M-Bus - no meaning (ignored)
    • A/D inputs - no meaning (ignored)
  • < extra_parameter2 > - optional protocol parameter 
    • specifies whether to deny or accept a higher baud rate offer for the "Protocol mode C"
    • IEC 62056-21 - logical value (if the parameter is not included, 0 is used)
      • 0 - the protocol accepts the higher baud rate offer from the device for the "Protocol mode C"
      • 1 - the protocol denies the higher baud rate offer from the device for the "Protocol mode C" and communication goes on at the default rate
    • M-Bus - no meaning (ignored)
    • A/D inputs  no meaning (ignored)

Reply format:

^SCAMS: <error_code>,<device_identification>,<data>
OK
  • <error_code> - error code returned as a result of the data reading process (0 means no error) - number 
    • 32-bit signless decimal number
  • <device_identification> - device identification - text string<data> - raw data read from a device - text string
    • 32-bit signless decimal number

— Examples of Immediately Readings — 

Example 1 - suppose you want to read immediately and write out data for a device connected to port 2, communicating via IEC 62056-21 and having the address 947833. The command is as follows:

AT^SCAMS="DIRECT_READ",2,1,"947833"

Example 2 - same as above, but 1200 Bd is the default baud rate:

AT^SCAMS="DIRECT_READ",2,"IEC62056-21","947833",1200

Example 3 - same as above, but the higher baud rate offer for the "Protocol mode C" from the device is denied:

AT^SCAMS="DIRECT_READ",2,1,"947833",1200,1

Example 4 - suppose you want to read immediately and write out data for a device connected to port 2, communicating via M-Bus, having the primary address  128 and communicating at 2400 Bd:

AT^SCAMS="DIRECT_READ",2,"MBUS","128@2400"


Example 5 - same as above, but  the baud rate is not specified and thus the default baud rate of 2400 Bd is used:

AT^SCAMS="DIRECT_READ",2,"MBUS","128"

Example 6 - same as above, but the protocol is given in a numerical format :

AT^SCAMS="DIRECT_READ",2,2,"128"

Example 7 - suppose you want to read immediately and write out data for a device connected to port 2, communicating via M-Bus, having the secondary address 01579411  and communicating at 2400 Bd:

AT^SCAMS="DIRECT_READ",2,"MBUS","*01579411@2400"

Example 8 - suppose you want to read immediately and write out data for a device connected to port 2, communicating via M-Bus, having the secondary address with two wildcard positions 015794FF   and communicating at 2400 Bd :

AT^SCAMS="DIRECT_READ",2,"MBUS","*015794FF@2400"

Example 9 -  suppose you want to read the immediate signal value for analogue input 1 via the A/D input port and calibrate and write out the result :

AT^SCAMS="DIRECT_READ",128,"AIN_DIN","1/ADC/CAL"

Example 10 -  suppose you want to read the immediate signal value for analogue input 2 via the A/D input port, convert the result into logical interpretation of the signal level and write out the result :

AT^SCAMS="DIRECT_READ",128,"AIN_DIN","2/DIN"

Example 11 -  suppose you want to read the immediate pulse counter value for digital input 1 via the A/D input port and write out the result :

AT^SCAMS="DIRECT_READ",128,"AIN_DIN","1/PULSE/ABS"

— End of Examples of Immediate Readings — 

Automatic Meter Detection

The command is used for automatic detection of a device on a bus.

Caution

  • When you enter this command, the SCDATA (record memory) and meter list will be deleted!
AT^SCAMSADD=,<port>,<protocol>,<baudrate>,<interval>,<count_of_expected_devices>

The command detects a device on the bus, adds it to AMS device list, deletes data in the data space and writes out the result including the addresses of the meters detected.

  • <port> - number of the physical port to which the device is connected - number
    • 2   - RS232/RS485/M-Bus communication port (depending on the HW version)
    • 128 - internal A/D input module communication port (analogue/digital input module)
  • <protocol> -  name/number of the communication protocol used for device communication
    • for number:
      • 1   - denotes the IEC 62056-21 protocol
      • 2   - denotes the M-Bus protocol
      • 128 - denotes the A/D input reading protocol (for reading data from the  analogue/digital input module )
    • for text string:
      • "IEC62056-21" -  denotes the IEC 62056-21 protocol
      • "MBUS" -  denotes the M-Bus protocol
      • "AIN_DIN" -  denotes the A/D input protocol (for reading data from the  analogue/digital input module )
  • <baudrate> - communication rate in Bauds; if the parameter is not included, the default value is used
    • setting options: 300, 600, 1200, 2400, 4800, 9600, 19200, 38400; default value: 2400.
  • <interval> -  time interval symbol   text string  (minutes/hours/days); setting options:
    • "1M", "2M", "3M", "4M", "5M", "6M", "10M", "12M", "15M", "20M", "30M", "1H", "2H", "3H", "4H", "6H", "8H", "12H", "1D"
  • <count_of_expected_devices> - number specifying the count of newly added devices
    • count of devices expected to be on the bus. If the count is met, automatic detection will be terminated. 

Reply format:

^SCAMSADD: <error_code> , <count_of_devices> , <primary_address1> ; <secondary_address1> ; <primary_address2> ; <secondary_address2> ; ..................... "OK

Examples of commands (3 meter detection on M-Bus, 2400 Bd 2 hour AMS reading interval) - one command written in different ways:

AT^SCAMSADD=2,2,"default","2h",3
AT^SCAMSADD=2,2,"2400","2h",3
AT^SCAMSADD=2,mbus,"default","2h",3
AT^SCAMSADD=2,mbus,"2400","2h",3

Examples of replies:

No error (detection of 3 meters): With error (a different meter count was detected: 2 meters in this case): 

^SCAMSADD: 65286,2,"1,00660421;19,08780251"OK

With error (secondary address collision of the M-Bus slave devices): 

^SCAMSADD: 131094,0,""OK

Reading of AMS Records

AT interface for AMS-type data record reading.

AT^SCDATA=?
The command writes out the list of commands for data record reading module control.

Reply:

^SCDATA: "MESS_CNT"^SCDATA: "GET_SPACE"^SCDATA: "GET_OLDEST"^SCDATA: "GET_FILTERED","0-150"^SCDATA: "DEL_OLDEST"^SCDATA: "DEL_ALL"OK
AT^SCDATA="MESS_CNT"

The data record reading module command returns the count of data records stored.

 Reply format: 

^SCDATA: "MESS_CNT",<count>OK

Example of reply (the data record memory contains 44 records): 

^SCDATA: "MESS_CNT",44OK

The data record reading module command returns the memory size available for data record storing (in bytes).

Reply format: 

^SCDATA: "GET_SPACE",<count>OK

Example of reply (the available free memory space is 7,008,089 B) 

^SCDATA: "GET_SPACE",7008089OK

AT^SCDATA="GET_OLDEST",<count>

The data record reading module command returns the listing of the oldest data records .

  • <count> - specifies the count of the oldest records to be listed - number

Tip

  • If you enter AT^SCDATA="GET_OLDEST" without specifying the count of records, the last record will only be read.

Reply format for a known data format and meaning of the parameters in the row:

AT^SCDATA: <record_type>,<time_stamp>,<sequence_number>,<protocol>,<index>,<error_code>,<device_identification>,<data>OK

 

  • <record_type> - data record type -  text string
    • "AMS" - AMS (Autonomous Metering System) record
    • "WMBUS" - Wireless M-Bus record
    • "WMBUS2" - Wireless M-Bus record captured by the other module (if available)
  • <time_stamp> - data storing timestamp -  number
    • 32-bit Unix timestamp
  • <sequence_number> - record sequence number (incrementing with every new record) - number
  • <protocol> -  name of the communication protocol used for device communication  - text string
    • "IEC62056-21", "MBUS", "AIN_DIN" and "Unknown" are available at present
  • <index> - device index in the device list at the time of data recording - number
  • <error_code> - error code returned as a result of the device data reading process (0 means no error) - number
    • 32-bit decimal signless number
  • <device_identification> - device identification - text string
    • for IEC 62056-21 - text identification string (as received from the device)
    • for M-Bus - empty text string (identification string does not exist)
    • for A/D input protocol - empty text string (identification string does not exist)
  • <data> - raw data read from the device - text string
    • for IEC 62056-21 - received data text string (as received from the device)
    • for M-Bus - data framework text string received from the device in the ASCII HEX format (data byte is represented by two consecutive ASCII characters specifying the data byte value in the hexadecimal format)
    • for A/D input protocol - result value text string in the decimal format
Reply format: 
^SCDATA:"WMBUS",1452142010,36617,-14,70,"44A2057714005401377277140054A2050137E70000002F2F046D052707210167460DFD11106563616B696E756D6F6B656C65544E320E138545030000002F2F2F2F2F2F2F2F2F"OK

Reply format for unknown data format: 
AT^SCDATA: <record_type>,<time_stamp>,<sequence_number>,"Unsupported record format"OK

Filtering of AMS Records

AT^SCDATA="GET_FILTERED",<filter>

The data record reading module command returns the listing of records according to the preset record filter. 

  • <filter> - specifies the filtering requirements for data record listing and is applied to all data records in the record memory.

Reply format for a known data format and meaning of the parameters in the row:

AT^SCDATA: <record_type>,<time_stamp>,<sequence_number>,<protocol>,<index>,<error_code>,<device_identification>,<data>  
OK
  • <record_type> - data record type -  text string
    • "AMS" - AMS (Autonomous Metering System) record
    • "WMBUS" - Wireless M-Bus record
    • "WMBUS2" - Wireless M-Bus record captured by the other module (if available)
  • <time_stamp> - data storing timestamp -  number
    • 32-bit Unix timestamp
  • <sequence_number> - record sequence number (incrementing with every new record) - number
  • <protocol> -  name of the communication protocol used for device communication  - text string
    • "IEC62056-21", "MBUS", "AIN_DIN" and "Unknown" are available at present
  • < index> - device index in the device list at the time of data recording - number
  • <error_code> - error code returned as a result of the device data reading process (0 means no error) - number
    • 32-bit decimal signless number
  • <device_identification> - device identification - text string
    • for IEC 62056-21 - text identification string (as received from the device)
    • for M-Bus - empty text string (identification string does not exist)
    • for A/D input protocol - empty text string (identification string does not exist)
  • <data> -  raw data read from the device - text string
    • for IEC 62056-21 - received data text string (as received from the device)
    • for M-Bus - data framework text string received from the device in the ASCII HEX format (data byte is represented by two consecutive ASCII characters specifying the data byte value in the hexadecimal format)
    • for A/D input protocol - result value text string in the decimal format

Filter Settings

The general format for <filter> is "<condition>;<condition>;........;<condition>", where <condition> specifies the filtering condition. The maximum count of conditions in the <filter> array is 10. The data record listing is sent only if it meets all the <filter> conditions.

<condition> - the general format for <condition> is <parameter><session><value>

<parameter> - text string defining the condition parameter. The supported strings are as follows:

  • RECORD_TYPE - data record type
  • TIME - data record timestamp
  • TABLE_ID - device index in the device list
  • ERROR_CODE - data record error code

<session> - text string defining the required session between the condition parameter and condition value. The supported strings are as follows:

  • == - is equal to
  • != - is not equal to
  • > - is greater than
  • >= - is greater than or equal to
  • < - is smaller than
  • <= - is smaller than or equal to

<value> - numerical value/name text string


Examples of Use

The command writes out all the Wireless M-Bus data records contained in the data record memory.

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

The command writes out all the AMS data records whose timestamps fall into the interval ranging from 388665085 to 1388668685 inclusive. 

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

The command writes out all the AMS data records whose timestamps are greater than 1388665085 and whose device index in the AMS device list is 1. 

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

The command writes out all the data records whose error code is non-zero .

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

The command writes out all the data records whose error code is  0, whose record type is AMS and timestamp is greater than 1388668685.

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

Record Deleting

AT^SCDATA="DEL_OLDEST",<count>

The data record reading module command deletes the oldest data record .

  • <count> - specifies the count of the oldest records to be deleted.

Example: remove the five oldest data records from the memory. 

AT^SCDATA="DEL_OLDEST",5

Reply format - action succeeded: 

OK

Reply format - action failed: 

ERROR
AT^SCDATA="DEL_ALL"

 The data record reading module command deletes all the data records .

Reply format - action succeeded:

OK

Reply format - action failed: 

ERROR

AMS Error Codes in Data Reading Lists

General AMS Core Errors

0No error (no error has occurred)
1Error in the input of parametric reading data to protocol module
2Error in the output of reading data from protocol module
3Required protocol cannot be connected to the specified physical port
4Data reading from device was not started
IEC 62056-21 Support Plug-In Module Errors
65536 Non-specific error (module internal error)
65537Data reading interrupted and terminated by user
65538Wrong device address string format
65539Non-supported baud rate character in device reply
65540Physical port baud rate was not set
65541Identification message timeout
65542AMS-unsupported protocol mode is used in AMS
65543Acknowledgement/option select message timeout
65544Physical port baud rate was not set
65545Two consecutive message character timeout
65546Two consecutive message timeout
65793Invalid character in Manufacturer's identification in Identification message received
65794Invalid character in Baud rate identification) Identification message received
65795Invalid character in Identification in Identification message received
65796Invalid character in CR and LF arrays in Identification message received
66049Invalid character in Data block in Data message received
66050Insufficient size of AMS internal received data buffer for the amount of data in Data block in Data message received
66051Invalid character in CR and LF arrays in Data message received
66052Invalid character in ETX in Data message received
66053Data integrity error in Data message, BCC value does not match the calculated block control character

M-Bus Support Plug-In Module Errors

131072Non-specific error (module internal error)
131073Data reading interrupted and terminated by user
131074Wrong device address (and baud rate) string format
131075Physical port baud rate was not set
131076"SND_NKE" communication framework was not sent to device within defined timeout
131077"SND_NKE" communication framework was not sent to device within defined timeout
131078Reply reception timeout from device to "SND_NKE" communication framework
131079Wrong communication framework type in reply from device to "SND_NKE" communication framework
131080"REQ_UD2" communication framework was not sent to device within defined timeout
131081"REQ_UD2" communication framework was not sent to device within defined timeout
131082Reply reception timeout from device to"REQ_UD2" communication framework
131083Wrong communication framework type in reply from device to "REQ_UD2" communication framework
131084Wrong reply type from device to "REQ_UD2" communication framework
131085Wrong device address in reply from device to "REQ_UD2" communication framework
131329Wrong first "start" character of reply framework from device
131330Wrong second "start" character of reply framework from device
131331Wrong "stop" character of reply framework from device
131332Wrong checksum of reply framework from device
131333Integrity error of data defining length of reply framework from device
131334Invalid value of data defining length of reply framework from device

A/D Input Support Plug-In Module Errors

8388608Non-specific error (module internal error)
8388609Data reading interrupted and terminated by user
8388610Wrong device address string format
8388611Request communication framework sending timeout to A/D input module
8388612Request communication framework sending timeout to A/D input module
8388613Reply framework receiving timeout from A/D input module
8388865Wrong reply framework type from A/D input module
8388866Wrong reply framework sequence number from A/D input module
8388867Insufficient size of AMS internal data buffer for the amount of A/D input module reply framework data
8388868Wrong checksum of reply framework from A/D input module
8388869Wrong synchronisation array of reply framework end from A/D input module

ONF Customer Module Errors (Pseudo-AMS Error Codes)

65280Non-specific error (module internal error)
65281User-defined expected count of M-Bus slave devices is greater than the maximum device count to be served by AMS
65282AMS searching start error for M-Bus slave devices
65283AMS searching result reading error for M-Bus slave devices
65284AMS device list deleting error
65285AMS searching result parsing error for M-Bus slave devices
65286Count of slave devices found on M-Bus differs from user-defined expected count of M-Bus slave devices
65287M-Bus slave device adding error to AMS device list
65288User output SMS count exceeds the maximum allowed SMS count

 

AT^SCAMS="DIRECT_READ",128,"AIN_DIN","2/DIN"