AN 620-0026

refer to the MicroLink-HM RS-485 Quick Start Guide or the MicroLi

620-0026 Using Modbus with the MicroLink-HM

Manuals – Microflex

PDF preview unavailable. Download the PDF instead.

Using Modbus with the MicroLink-HM Accumulator ?16716294252280552725
By: Juan Castillo www.microflx.com

AN 620-0026 April 2017

Using Modbus with the MicroLink-HM Accumulator

This application note provides information on the following:
· Hardware requirements between a MicroLink-HM (RS232/RS-485), a Modbus Master, and a HART device
· Configuring a MicroLink-HM to continuously poll a HART device and fill Modbus registers with variable data.
· Configure Modbus Poll software to connect to MicroLink-HM
· Use Modbus Poll software as a Modbus-RTU master to read MicroLink-HM Modbus registers (filled with HART variable data).
INTRODUCTION
Engineers are often faced with issues stemming from systems utilizing different protocols, and integrating those systems can be difficult and costly. When systems are set to use the Modbus Protocol, yet the instrumentation uses the HART Protocol, many are forced

to purchase expensive converters that often have no other use.
The MicroLink-HM is a HART modem which not only can be used to calibrate and configure your HART devices, but it can also store HART data retreivable via Modbus-RTU commands. This versatility allows users to poll up to 16 HART devices within the same loop, and have a HART protocol modem for calibrations and configuration.
The primary purpose of this application note is to help users or developers to have a basic understanding of the process of configuring a MicroLink-HM to continuously poll a HART device, connect a MicroLink-HM to a Modbus master, and read Modbus registers (containing HART variable data) from a MicroLink-HM. In this document the Modbus master will be Modbus Poll software which is a Modbus master simulator, but the Master could be a PLC, SCADA, or any other Modbus master. Figure 1 illustrates a diagram of the MicroLink-HM in a typical HART to Modbus Accumulator application.

POWER SUPPLY
MODBUS MASTER

250

5 to 30 VDC (+) GND TX/A RX/B GND

MICROLINK HM

Figure 1.
620-0026

MICROLINK-HM TYPICAL APPLICATION

HART DEVICE
Page 1

AN 620-0026

CONNECTING THE HARDWARE

USING A MICROLINK-HM RS-485
To configure the MicroLink-HM RS-485 to continuously poll a HART device and fill Modbus registers, first make the necessary connections. Figure 2 illustrates the connections necessary for a MicroLink-HM RS-485 - HART to Modbus Accumulator application. For details on how to make all the necessary connections refer to the MicroLink-HM RS-485 Manual.

POWER SUPPLY

250

HART

DEVICE

MODBUS MASTER
Figure 2.

5 to 30 VDC (+) VDC ( - ) GND RS-485 B RS-485 A

MICROLINK HM RS-485
V+ V- g B A

MICROLINK-HM RS-485 TYPICAL APPLICATION

USING A MICROLINK-HM RS-232
To configure the MicroLink-HM RS-232 to continuously poll a HART device and fill Modbus registers first make the necessary connections. Figure 3 illustrates the connections necessary for a MicroLink-HM RS-485 - HART to Modbus Accumulator application. For details on how to make the necessary connections refer to the MicroLink-HM RS-232 Manual.

POWER SUPPLY
MODBUS MASTER
Figure 3.

250
MICROLINK HM RS-232
54321

HART DEVICE

5 -GROUND 4 -(5 to 30 VDC+) 3 -TX 2 -RX
MICROLINK-HM RS-232 TYPICAL APPLICATION

620-0026

Page 2

AN 620-0026
Figure 4 illustrates a MicroLink-HM RS-485 in a typical HART to Modbus Accumulator application. Modbus Poll is reading Modbus registers from the MicroLink-HM containing HART variable data using standard Modbus-RTU commands.

NOTE: A USB to RS-485 Converter was used to communicate with the MicroLink-HM RS-485. Microflex offers the 101-0020 USB to RS-485
Converter and the 1010009 RS-232 to RS-485
Converter.

Figure 4.

MICROLINK-HM RS-485 IN A TYPICAL HART TO MODBUS APPLICATION

Figure 5 illustrates a MicroLink-HM RS-232 in a typical HART to Modbus Accumulator application. Modbus Poll is reading Modbus registers from the MicroLink-HM containing HART variable data using standard Modbus-RTU commands.

NOTE: A USB to RS-232 Converter was used to communicate with the MicroLink-HM RS-232.

Figure 5.

MICROLINK-HM RS-232 IN A TYPICAL HART TO MODBUS APPLICATION

620-0026

Page 3

AN 620-0026

CONFIGURING THE MICROLINK-HM
DOWNLOAD AND INSTALL THE HM CONFIGURATOR APP
The MicroLink-HM configuration software is included on a CD with the MicroLink-HM unit. For information on how to download and install the included software refer to the MicroLink-HM RS-485 Quick Start Guide or the MicroLink-HM RS-232 Quick Start Guide. The configuration app can also be downloaded at no cost from the following link: MicroLink-HM Configurator App. After Installation the MicroLink-HM Icon will be added to your system. The MicroLink-HM configuration and setup software is used to configure the MicroLink-HM serial port and accumulator mode. All of the configuration settings are saved in Modbus registers that can also be set using Modbus-RTU commands 6 or 16. Details including register definitions are included in the MicroLink-HM RS-485 and MicroLink-HM RS-232 manuals.
NOTE: Before opening the HM configurator app, make sure all the necesary connections were made and that the MicroLink-HM and the HART Device are powered ON.
SETTING THE COM PORT
To connect to and configure the MicroLink-HM open the HM Configurator app and set the app to use the same COM port that the MicroLink-HM is connected to. For details on how to connect refer to the MicroLink-HM RS-485 and MicroLink-HM RS-232 manuals.
CONFIGURE HART PROTOCOL SETTINGS
After connecting to the MicroLink-HM with the HM Configurator app you will need to navigate to the HART protocol settings. The MicroLink-HM ships configured to operate as a HART modem with Modbus Register accumulation disabled. In order to use Modbus-RTU commands to read MicroLink-HM's Modbus registers, the HM will need to be configured to enable Fill Modbus registers. Do this by clicking:
Setup > HART
from the top drop-down menu. The HART protocol settings window will open. Check the Fill Modbus registers option to enable Modbus register accumulation. The HART Protocol settings window will expand to
620-0026

show the Polled devices settings. Set the polling address for HART device 1 to address 0. HART polling address 0 is used when only 1 HART device is connected to the HART loop. Set the following HART protocol settings using the HM Configurator app.
HART PROTOCOL SETTINGS
· Master Mode: Primary · Command Retries: 1 · Polled Devices: Fill Modbus Registers Enabled · Polling Address: 0 (for Polled Device #1)
Click Save to set the new settings and Close to exit the window. For more information on how to use the HM Configurator app refer to the MicroLink-HM RS-485 and MicroLink-HM RS-232 manuals.
CONFIGURE MOBUS-RTU SETTINGS
To configure MicroLink-HM's Modbus settings click:
Setup > Modbus...
from the top drop-down menu. The Modbus-RTU setings window will open. The baud and parity settings have to be the same for the Modbus master and all Modbus slave nodes in a Modbus network. Baud and parity are not specified by Modbus, therefore 9600 baud rate, no parity should be selected as this is a typical configuration used when speed and parity are not critical.The Modbus slave address should be a unique number from 1 to 247. In this application note setup, there is only 1 Modbus slave node (MicroLink-HM) so the modbus slave address should be set to 1. The holding registers map should be set to Use HART Device Map. Floating point byte order should be set to use ABCD-Standard using the HM-Configurator app. For more information on how to set these settings refer to the MicroLink-HM RS-485 and MicroLink-HM RS-232 manuals. Configure MicroLink-HM with the following settings:
MODBUS-RTU SETTINGS
· Baud Rate: 9600 · Parity: No Parity · Modbus Address: 1 · Holding Registers Map: Use HART Device Map · Floating Point Byte Order: ABCD-Standard · HART Device Failed Register Value:Set to Preset
Value
Page 4

AN 620-0026

Click Save to set the new settings and Close to exit the window. The MicroLink-HM is now configured to continuously poll 1 HART device with HART polling address 0. The HART status LED on the front side of the MicroLink-HM should be alternating between Green and RED. The Green LED indicates the MicroLink-HM is transmitting while the Red LED indicates a reply is being received. You can now proceed to exit the HM Configurator app by clicking:
File > Exit
from the top drop-down menu. Using the previously configured settings we can now use a Modbus master to connect and read Modbus registers containing HART variable data from the MicroLink-HM using standard Modbus-RTU commands. For more information on the Modbus protocol please refer to the following website: http://www.modbus.org/
CONFIGURING MODBUS POLL TO CONNECT TO MICROLINK-HM
The Modbus master software used in this application note (Modbus Poll) is available via a free download from the following website: http://www.modbustools. com/download.html. Download and install the Modbus Poll software version that is compatible with your computer.
With the MicroLink-HM configured and polling a HART device, open the Modbus Poll app.
CONFIGURE CONNECTION SETUP
To connect to the MicroLink-HM first click:
Connection > Connect...
from the top drop-down menu. This will open the Connection Setup window. See Figure 6 for an example screen shot. In this window under Connection select Serial Port. Serial settings will need to be set to match the COM port number of the MicroLink-HM. Baud and parity settings need to match the configured baud and parity of the MicroLink-HM. In this case set the baud rate to 9600, parity to None, select 8 data bits and 1 stop bit. Under Mode, RTU must be selected. Finally click OK to connect to the MicroLink-HM. Configure Modbus Poll to have the following connection settings:

CONNECTION SETUP SETTINGS
· Connection: Serial Port · Serial Settings: COM port # of the MicroLink-HM · 9600 Baud · 8 Data Bits · None Parity · 1 Stop Bit · Mode: RTU · Response Timeout: 1000ms · Delay Between Polls: 1000ms ·

Figure 6.

MODBUS POLL CONNECTION SETUP

CONFIGURING MODBUS POLL TO READ MODBUS REGISTERS FROM THE MICROLINK-HM
CONFIGURE READ/WRITE DEFINITION
Modbus Poll needs to be configured to read the Modbus registers containing HART variable data for HART Device 1. The locations for these registers depends on which Modbus Registers map the MicroLink-HM was configured to use. The MicroLink-HM was previously

620-0026

Page 5

AN 620-0026

configured to use the HART Device map. For information on what Modbus register locations hold the variable data for HART Device 1 please reference the MicroLink-HM RS-485 and MicroLink-HM RS-232 manuals under section Modbus Register Map- Grouped by HART Device.
The Modbus Register map Grouped by HART Device informs you that PV, SV, TV, and QV values in float format are stored in Modbus Registers 256 - 263 for HART Device 1. Configure Modbus Poll to read these registers by clicking:
Setup > Read/Write Definition
from the top drop-down menu. This will open the Read/ Write Definition setup window. In this window, the slave ID should be set to match the previously configured Modbus slave address 1 of the MicroLink-HM. Function should be set to Modbus command 3. Command 3 allows you to read holding registers. Address box allows you to input the first Modbus address to read. Input 256 for the starting address followed by the quantity box which allows you to input the number of Modbus registers to read after the starting address set in the previous box. For Quantity set 8 Modbus registers to read. Scan Rate can be left at default 1000ms. Finally select Fit to quantity under the View section and click OK to save the configured settings. See Figure 7 for an example screen shot. Select the following settings in the Read/Write Definition window:
READ/WRITE DEFINITION SETTINGS
· Slave ID: 1 · Function: 03 Read Holding Registers (4x) · Address: 256 · Quantity: 8 · Scan Rate: 1000 (ms) · View: Fit to Quantity

Figure 7.

READ WRITE DEFINITION SETUP

CONFIGURING DISPLAY TYPE
The MicroLink-HM was previously configured to save the floating point data in Floating Point Byte Order: ABCD- Standard. See Page 4. Configure Modbus Poll to display Modbus register data in ABCD-Standard format by clicking:
Display > FLOAT ABCD
from the top drop-down menu. Using Modbus Poll as the Modbus Master you are now reading Modbus registers from the MicroLink-HM containing HART variable data for HART device 1 with HART polling address 0. The Modbus Poll software allows you to label and add unique colors to each Modbus register value. See Figure 8 for an example screen shot.

620-0026

Page 6

AN 620-0026

Figure 8.

MODBUS POLL READING MODBUS REGISTERS FOR HART DEVICE 1

CONCLUSION
The MicroLink-HM is a HART to Modbus accumulator that is able poll up to 16 HART devices in a single HART multi-drop loop and save the HART device data in Modbus Registers. The HART variable data can then be read using standard Modbus-RTU commands. The Modbus master used in this application note is a Modbus master simulator that is available free of charge via a digitial download. Modbus Poll can help with the design and development of projects using the MicroLink-HM HART to Modbus Accumulator. In addition to being a HART to Modbus Accumulator, the MicroLink-HM is also a full HART interface capable of being used to configure and calibrate your HART devices.

620-0026

Page 7

REFERENCES / USEFUL LINKS:
· Microflex Home Page · MicroLink-HM RS-232 Manual · MicroLink-HM RS-485 Manual · USB to RS-485 Converer · RS-232 to RS-485 Converter · MicroLink-HM RS-232 Quick Start Guide · MicroLink-HM RS-485 Quick Start Guide · MicroLink-HM Configurator App · Modbus Organization · Modbus Poll Software Download · Field Comm Group

AN 620-0026

620-0026

Page 8


Adobe PDF Library 15.0 Adobe InDesign CC 2017 (Windows)