User Manual Anybus® M-Bus to Modbus-TCP Gateway Doc: HMSI-27-300 Rev. 1.10 HMS Industrial Networks Mailing address: Box 4126, 300 04 Halmstad, Sweden Visiting address: Stationsgatan 37, Halmstad, Sweden E-mail: info@hms-networks.com Web: www.anybus.
Table of Contents Table of Contents About This Document Related Documents.................................................................................................................................. 1 Document History ................................................................................................................................... 1 Conventions & Terminology ..................................................................................................................
1-2 Troubleshooting Hardware errors...................................................................................................................................... 28 Gateway does not respond ............................................................................................................... 28 Current consumption too high ......................................................................................................... 28 Network errors..............................................
Preface P. About This Document For more information, related documentation, etc., please visit the HMS website www.anybus.com. P.1 Related Documents Document - Author - P.2 Document History Revision List Revision 1.00 1.10 Date Author(s) 2015-02-26 ThN 2016-04-08 ThN Chapter(s) Description All First official release 1, 6, A Added model with max 80 loads P.3 Conventions & Terminology The following conventions are used throughout this manual: 1. Numbered lists provide sequential steps.
About This Document 2 P.3.
Important User Information This document contains a general introduction as well as a description of the technical features provided by the Anybus M-Bus to Modbus-TCP Gateway, including the PC-based configuration software.The document only describes the features that are specific to this product. The reader of this document is expected to be familiar with PLC technology and communication systems in general. The reader is also expected to be familiar with the Microsoft® Windows® operating system.
Chapter 1 1. General Information 1.1 Introduction The M-Bus (Meter-Bus) is defined in the standard EN 13757, and is an established and well known interface for automated meter reading. Ease of installation (simple two-wire system with powering by the bus) and robustness are the most important features. M-Bus has its own physical layer and protocol, so a translation is necessary to connect it to other systems. In the field of automation, Modbus TCP is one of the most common communication standards.
General Information 3 1.2 Description 1.2.
Chapter 2 2. Installation 2.1 Startup After connecting the supply voltage the gateway will boot up automatically. The following calls are made on system startup: • Configuration of the network interface (Ethernet) via DHCP or static configuration • Providing a RAM drive as drive C: • Obtaining the system time via SNTP • Starting the main program The main program provides the entire functionality including the web interface of the gateway. 2.
Installation 5 2.2.1 CHIPtool 1. Download and install CHIPtool, then start it using the link in the Windows Start Menu. The first window will show a list of all detected devices in the local network. 2. Right-click on the gateway that you wish to configure, then select IP configuration from the context menu. 3. If your network has a DHCP server, check Use DHCP for automatic configuration.
Installation 6 Connection test (ping) The Ping command in the CHIPtool context menu can be used for testing the connection. It will open a Windows command line window and run a standard ping command. File access (FTP) The FTP command in the CHIPtool context menu opens a built-in FTP client, allowing access to the file system in the gateway. FTP access is restricted to certain users, see also 3. Configuration.
Chapter 3 3. Configuration The Anybus M-Bus to Modbus-TCP Gateway is normally configured via the web interface, which gives access to all gateway parameters, meter configuration and services. The gateway can also be configured by uploading configuration files directly to the gateway via FTP, see 7. Advanced features. Changes to the files and file system should only be carried out by trained personnel as it may restrict the functionality of the gateway. 3.
Configuration 8 3.1.1 General tab The General tab shows an overview of the current gateway configuration..
Configuration 9 3.1.2 Meter tab The Meter tab displays a list of connected meters and allows you to search, add and edit entries. The meter list is initially empty. After connecting one or several meters to the gateway, click Scan to start populating the list. The scan is configured on the Configuration tab. See also 5. Acquiring and processing meter data. Scanning can take a long time, depending on the mode and number of connected meters. The scan process cannot be interrupted.
Configuration 10 Meter tab fields Field Interface S Serial MAN Medium Version Value Scale Unit Cycle User label Description Register Active Description Interface of meter (M-Bus) Entry status – E indicates that value has been edited Serial number of meter Manufacturer of meter (abbreviation) Medium of meter (see 5.2.1 Predefined Media ID Values) Version number of meter Meter reading or measurement value Scale factor (scientific notation) Unit (see 5.2.
Configuration 11 Editing meter and value entries Meter and value entries can be configured by right-clicking the entry and selecting Edit in the context menu, or by double-clicking the entry. The fields in the Edit dialog correlate with the fields in the meter list. Depending on the used interface some fields may be disabled for editing. The readout interval in seconds can be set independently for each meter in the field Cycle. If no value is entered the global readout interval is used, see 3.1.
Configuration 12 3.1.3 Configuration tab The Configuration tab provides global meter settings. Reload discards the changes made on the page and reloads the currently active settings. Save saves the changes and reinitializes the gateway. Anybus M-Bus to Modbus-TCP Gateway User Manual Doc: HMSI-27-300, Rev: 1.
Configuration 13 Configuration tab fields Field Readout interval (s) Description mode Maximum gateway count Maximum value count RAW log active M-Bus mode Primary start address Primary final address Secondary address mask M-Bus baud rate M-Bus timeout M-Bus idle timeout M-Bus full timeout M-Bus request mode M-Bus reset mode M-Bus max. multipage Description Standard readout cycle of meters (in seconds).
Configuration 14 3.1.4 Server tab The Server tab provides settings for the Modbus TCP interface. Field Modbus Mode Modbus Port Description Select Modbus TCP (normal mode) or dummy data (see 4.2.1 Dummy data) Port number to which the Modbus TCP client (master) should connect Write access Yes Yes Reload discards the changes made on the page and reloads the currently active settings. Save saves the changes and reinitializes the gateway. 3.1.
Configuration 15 3.1.6 User tab The User tab allows you to create and manage users and assign them specific access rights. The following users are pre-configured on delivery: User admin Password admin web web ftp ftp Description Administrator user with root access, allows full access to all services (HTTP, FTP, flash update, IP configuration). Default user for the web interface. Allows full access to the web interface.
Configuration 16 User tab fields Field Name Overwrite password Change password Sessions Maximum sessions Read General Write General Read Meter Write Meter Read Config Write Config Read Server Write Server Read Security Write Security Read Service Write Service Write User FTP Description Username Not used User is allowed to change his/her password Number of currently open session with this user account Maximum number of simultaneous sessions for this user (-1 = unlimited) Read access for tab General Write
Configuration 17 3.1.7 Service tab The Service tab provides information about the hardware and software for maintenance use. The values on this tab are read-only. Reload will refresh the information. Reboot will restart the gateway. All internal processes will be reinitialized after the reboot. 3.1.8 Print page Clicking the Print button (bottom right) will export the complete configuration as a print-formatted HTML page in a new browser tab or window.
Chapter 4 4. Modbus TCP specification The Modbus protocol was originally developed by the company Modicon (now Schneider Electric) for the communication with their controllers. Data is transmitted in the terms of 16 Bit registers (integer format) or as status information in terms of data bytes. Over the years, the protocol has been continuously expanded. Modbus TCP is a variant of Modbus and part of the standard IEC 61158. A full specification for Modbus can be found here: www.modbus.
Modbus TCP specification 19 4.2 Data format The arrangement of data in the Modbus registers corresponds to the usual structure. It uses big endian representation. For the 16 bit registers, the higher byte is sent first, then the lower byte. Example: value: 0x1234 transmission order: 0x12, 0x34 If number and data ranges go beyond 16 bits, representation is similar. Again, the most significant 16 bit register is sent first and is addressed with the lowest register address.
Chapter 5 5. Acquiring and processing meter data The main task of the Anybus M-Bus to Modbus-TCP Gateway is the processing and transmission of meter data. For proper operation, the following issues must be considered: • The available meters must be configured correctly. Required meters or meter values must be enabled by the checkbox Active and must have a valid register address. • The read out meter data must be transmittable from the gateway to a PLC via Modbus TCP.
Acquiring and processing meter data 21 5.1.2 Adding meters manually Meters that are connected to the M-Bus interface of the gateway but not found automatically during a scan can be added manually from the Meter tab, see 3.1.2 Meter tab. The configuration of the meter must be known to be able to add it manually. The fields in the Add meter dialog correspond to the fields in the meter list.
Acquiring and processing meter data 22 5.2 Meter data format The media and value types and units used in meter data are pre-defined in the standard EN 13757-3. Custom types and units may also be defined depending on the meter interface. 5.2.
Acquiring and processing meter data 23 5.2.
Acquiring and processing meter data 24 Index 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 - 255 Description Baud rate Response delay time Retry Remote control (gateway specific) First storagenum. for cyclic storage Last storagenum.
Acquiring and processing meter data 25 5.2.
Acquiring and processing meter data 26 5.2.4 Modbus register layout The Anybus M-Bus to Modbus-TCP Gateway uses a fixed address structure of 10 Modbus registers per address. Addresses are enumerated starting with 0. • Data types using more than one register are encoded with the most significant word at the lowest address. • The function code 0x03 (Read Holding Register) is used for reading the data. Within the Modbus protocol, data is formatted as either integer or float.
Acquiring and processing meter data 27 Example Example configuration of Modbus addresses via the web interface: In this example, the following data will be transmitted to the Modbus master Address Value Gateway entry 0 0x0002 1 0x993A 2 0x0001 3 0x006F 4 0x519C 5 0xC16D 6 0x0000 7 0x0100 8 0x0000 9 0x0000 Meter entry 10 0x03F8 11 0x3CAA 12 0x32A7 13 Version / medium 0x0204 14 0x519C 15 0xC16D 16 0x0000 17 0x0200 18 0x0000 19 0x0000 Meter value entry 20 0x0000 21 0x0000 22 0x0000 23 0x010B 24 0x4882 25
Chapter 6 6. Troubleshooting This section lists some of the most common problems and suggestions how to solve them. If you still cannot solve your problem, please contact Anybus support. 6.1 Hardware errors 6.1.1 Gateway does not respond After powering the gateway it does not operate. Current consumption is about 0 mA and both Ethernet LEDs are unlit. 1. Check that the power supply is connected with the correct polarity. 2.
Troubleshooting 29 6.2 Network errors 6.2.1 Web interface and FTP server not accessible The gateway web interface and the FTP server are not accessible. 1. Run CHIPtool and check if the gateway appears in the list (see 2.2.1 CHIPtool). - If the gateway is not visible in CHIPtool, continue to 6.2.2 No network connection. - If the gateway is visible in CHIPtool, run a connection test (ping). - Try to access the FTP server from CHIPtool. 2.
Troubleshooting 30 6.2.3 No write access to the web interface The web interface is accessible but the settings cannot be changed. 1. Check if you are logged in as a user with write access (see 3.1.6 User tab). If not, log out and log in as another user with write access. 2. Write access is only allowed for one of the currently logged in users. If another user with write access is already logged in, they will have to log out before you can log in with write access.
Troubleshooting 31 6.3 Meter reading errors 6.3.1 No meters are detected A scan has been completed but none of the connected meters appear in the meter list. 1. Check the cable between the gateway and the meter and replace faulty cables. 2. Check that the M-Bus connection voltage is approximately 36 VDC measured between terminals “MBUS+” and “MBUS-”. 3. Check that the M-Bus interface (M-Bus mode) is enabled in the Configuration tab (see 3.1.3 Configuration tab). 4.
Troubleshooting 32 6.3.3 Meters are detected but have no data Some meters may contain an erroneous declaration of the secondary address. This is why these meters are not addressable for meter readouts, although they are visible in the meter list. The system parameter MBUS_SELECTMASK makes it possible to mask parts of the secondary address and replace them with a wildcard character. The version field especially is a frequent cause of this problem (MBUS_SELECTMASK=4). See 7.4.1 System configuration file. 6.
Troubleshooting 33 6.3.6 Webserver capacity error message After a scan or a change in the meter list, the gateway (even after a reboot) may show the following error message in the meter list: The meter list exceeds the capacity of the internal webserver This error message is caused by an internal limitation of the webserver.
Chapter 7 7. Advanced features 7.1 Software update In order to provide new features to the Anybus M-Bus to Modbus-TCP Gateway, the operating system and gateway software can be updated using CHIPtool (see 2.2 Network configuration). The update consists of two steps. In the first step, the operating system (RTOS) on the controller is updated. In the second step the firmware of the gateway is transferred. In most cases, updating the RTOS is not necessary.
Advanced features 35 7.1.1 Updating the operating system (RTOS) RTOS is provided as an image file named “SC1x3V0[version]_FULL.hex”, where [version] represents the RTOS version (e.g. 154). 1. Start CHIPtool and right-click on the gateway that is to be updated. In the context menu, select Program flash image. 2. In the dialog that opens, click to browse to and select the RTOS image file on your computer, then click Start in the section Use UDP/IP. Do not change any other settings.
Advanced features 36 7.1.2 Updating application software (firmware) The Anybus M-Bus to Modbus-TCP Gateway application software is provided as a zip archive. 1. Unpack the contents of the zip archive to an empty directory on your PC. 2. Open the web interface and log in as admin. 3. On the Service tab, check that the button Reboot system is active (not grayed out). 4. Log in to the FTP server as admin. 5. Select all files and folders in drive A:\ and download them to an empty directory on your PC.
Advanced features 37 7.2 Telnet connection Administrative access to the gateway can be obtained using a standard Telnet client connecting to the gateway with admin credentials. There is also a Telnet client built into CHIPtool. After logging in as admin you can use standard Telnet commands to access the file system. 7.3 FTP connection The file system in the gateway can be accessed with any standard FTP client, or with the FTP client built into CHIPtool.
Advanced features 38 7.4 Configuration files The A:/ directory of the gateway contains configuration files for the system and for the connected meters. The configuration files are updated when changes are made via the web interface, but can also be edited manually. Some parameters can only be changed by editing the configuration files manually. When editing configuration files you must use an UTF-8 capable text editor, such as Notepad++.
Advanced features 39 Parameter MBUS_PARITY MBUS_RAWLOGENABLE MBUS_REQUESTMODE MBUS_RESETDISABLE MBUS_RESETMODE MBUS_SCANMODE Description M-Bus parity: 0: no, 1: odd, 2: even, 3: mark, 4: space Enables raw data log to drive B: Defines request sequence for read-out Disables reset command Reset mode: 0: Reset after select, 1: Reset prior to select 2: No reset Scan mode for M-Bus Valid range 0-4 Default value 2 0, 1 DEFAULT, EXT, ONLY, FREEZE 0, 1 0-2 0 DEFAULT PRIMARYSCAN, SECONDARYSCAN, SECONDARYSC
Advanced features 40 Parameter MUC_LOG MUC_METERDESCRIPTION_ENABLEFLAGS MUC_SETgatewayS MUC_PROTOCOL_VERMUC_SHOWTIMESTAMPENTRIES MUC_USE_FREEZE SNTP_ENABLE SNTPIP WATCHDOG_IDLE WATCHDOG_PROCESS WATCHDOG_READOUT WATCHDOG_SCAN WEBCOM_TIMEOUT Description Sets the level for output of system data to STDOUT Valid range DEFAULT, NONE, ERRORONLY, ALL Enable flags that control the display of the 0-16 descripton field in the meter view: Bit 0: Description Bit1: Storage-number, tariff, value type Bit2: DIF/VIF
Advanced features 41 7.4.2 Meter configuration file Meter configuration is stored in the file A:/gateway_handle.cfg. If this file does not already exist it will be generated when the meter list in the Meter tab of the web interface is populated. Only entries which differ from the default values are stored (except “version”). Manual changes to the configuration file will take effect after the gateway has been rebooted.
Appendix A A. Technical Specifications A.1 General A.1.1 Dimensions and weight • Width: 35 mm • Height: 89 mm • Depth: 58 mm • Weight: 80 g A.1.2 Installation This gateway is intended for installation in a switch cabinet. • Operating temperature: 0–50 °C • Humidity: 10–95 % relH • Protection class: IP20 • DIN rail mounting: 35 mm DIN rail A.1.3 Customs declaration • TARIC: Anybus M-Bus to Modbus-TCP Gateway User Manual 85176200 Doc: HMSI-27-300, Rev: 1.
Technical Specifications 43 A.2 Electrical A.2.1 Power supply This gateway needs an external power supply. For pin assignments, see 1.2 Description. • Input voltage: 24 ±5 VDC • Connector wire range: 2.5 mm² • Power consumption: 2 W idle state, 10 W max • Protection: Reverse polarity Overvoltage (transient) A.2.2 Meter interfaces M-Bus interface compliant with EN 13757-2. For pin assignments, see 1.2 Description. • Uspace: 36 V • Umark: 24 V • Connector wire range: 2.