Skip to end of metadata
Go to start of metadata

2N® SmartCOM PRO supports communication protocol IEC62056-21 for reading data. This functionality is provided by special FW which is distributed on request.

 

In this FAQ 2N® SmartCOM PRO is set for reading data from electricity meter. Electricity meter with RS485 and standard IEC62056-21 support had been used.

 

RS485 parameters need to be set as the very first step. Connect to the 2N® SmartCOM PRO via putty and use the set of following at commands:

Settings RS485: speed 2400bd/s - data bits 7 – stop bits 1 – parity – even

at^scport2="baudrate",2400           - set baudrate

at^scport2="DATA_BITS",7            - set data bits

at^scport2="STOP_BITS",1           - set stop bits

at^scport2="PARITY",1                  - set parity even

at^scport2?                                   - check settings on RS485

at^scport2="srestart"                     - save settings and restart RS485 interface

 

AMS AT commands:

 at^scams=?          - display available commands for AMS and parameters of these commands

at^scams="enable",1     - switching on AMS system (0 means switch off)

at^scams="dev_add",2,"IEC62056-21","947834","3M"          - add device to the table

Where 2  -   RS485 port of 2N® SmartCOM PRO
"IEC62056-21" – defined used protocol in string form,
"947834"  - serial number of device used like device address
"3M" is time interval. Supported reading intervals "1M", "2M", "3M", "4M", "5M", "6M", "10M", "12M", "15M", "20M", "30M", "1H", "2H", "3H", "4H", "6H", "8H", "12H", "1D"

 

at^scams?     – show listed devices

 at^scams="dev_remove",1-32      – remove one device on defined position

 at^scams="dev_clear"                 – remove all devices

Reading data from electricity meter:

Direct reading data:

at^scams="direct_read",2,"IEC62056-21","947834",2400


Where 2 is a port of 2N® SmartCOM (PRO),
"IEC62056-21" – defined used protocol in string form,
"947834" serial number of device used like device address
2400 is baudspeed

Reading saved data from 2N® SmartCOM PRO

at^scdata=? - display available parameters for work with data

"MESS_CNT"  - number of saved messages in memory

"GET_SPACE" – available memory in bytes

"GET_OLDEST" – listing of oldest message

"GET_FILTERED" – listing messages by applied filter

"DEL_OLDEST" – delete oldest message

"DEL_ALL" – delete all saved messages

 

Example: Check how many messages are saved and display 4 oldest messages. Delete all saved messages from 2N® SmartCOM PRO internal memory:

 at^scdata= "MESS_CNT"
at^scdata="get_oldest",4
at^scdata="del_all"

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
 
IEC 62056-21 AMS errors
65536                 - internal error
65537                 - readout was stopped by user
65538                 - bad format address of the device
65539                 - not supported character, that describe communication speed in the device answer
65540                 - communication port was not set
65541                 - timeout - Identification message not arrived
65542                 - the device using unsupported AMS mode
65543                 - timeout - Acknowledgement/option select message
65544                 - speed was not set
65545                 - timeout while receiving two consecutive characters of the message
65546                 - timeout while receiving two messages
65793                 - not supported character in the field "Manufacturer's identification" of received "Identification message"
65794                 - not supported character in the field Baud rate identification of received "Identification message"
65795                 - not supported character in the field Identification of received "Identification message"
65796                 - not supported character in the fields "CR" and "LF" of received "Identification message"
66049                 - not supported character in the field "Data block" of received "Data message"
66050                 - internal AMS buffer overflow because too long "Data block" of received "Data message"
66051                 - not supported character in the fields "CR" and "LF" of received "Data message"
66052                 - not supported character in the field "ETX" of received "Data message"
66053                 - field "BCC" of received "Data message" is not equal to calculated check character