Horner XL4 Modbus TCP AdvancedHMI Communication

Advanced HMI is a powerful, adaptable HMI/SCADA (Supervisory Control and Data Acquisition) development package that takes advantage of Visual Studio. There is no coding required and you can simply drag and drop items onto the page. The best thing is that the software is free. We will look at using AdvancedHMI with the Horner APG XL4 Controller. Using the program on the process tank application we created previously, we will be controlling and displaying information to the network. The AdvancedHMI package will communicate Modbus TCP over Ethernet to the PLC. We will be able to start and stop our process tank and monitor the parameters via the AdvancedHMI window.

Previously we discussed the following in our Horner APG XL4 Series:
System Hardware
Installing the Software Cscape
Cscape Software Setup
Establishing Communication
Numbering System and Addressing
User Interface
Timers and Counters
Compare and Move Instructions
Math Instructions
Program Control Instructions
Rotate and Shift Register
Recipe Instruction
Report Generator
Modbus RTU Instructions
FTP File Transfer Protocol Server
Horner XL4 HTTP Web Server

The first thing that we will do is to enable the Modbus TCP Slave on our unit.
From the main menu goto Controller | Hardware Configuration… Alternativly you could also goto the Project Navigator and select Hardware Configuration under the program that you are working with.

Under the Ethernet port settings (LAN1) select Config.

Ensure that Modbus Slave is checked and then hit Configure Selected Protocol.

Ensure that Modbus TCP is selected and the port is set for 502. (This is the default port number for Modbus TCP.

We will now take our existing program from last time and add the following rungs.

Here is a list of our memory areas that we will be using:
Mixer Time – %R10 – Modbus 43010
Ing A Time – %R12 – Modbus 43012
Ing B Time – %R14 – Modbus 43014
Ing C Time – %R16 – Modbus 43016
Process Tank Level – %R1000 – Modbus 44000
Ind Product A – %T304 – Modbus 06304
Ind Product B – %T305 – Modbus 06305
Ind Product C – %T306 – Modbus 06306
Ind Fill – %T301 – Modbus 06301
Ind Mix – %T302 – Modbus 06302
Ind Empty –%T303 – Modbus 06303
Start PB – %T200 – Modbus 06200
Stop PB – %T201 – Modbus 06201

Here is the overall Modbus Master Mapping for the Horner APG OCS XL4 Controller. You can see from the chart how we get our Modbus address.

AdvancedHMI can communicate to many devices. The Click PLC can communicate Modbus TCP (Ethernet) or Modbus RTU (Serial – RS232, RS485, RS422) Communications drivers currently included in AdvancedHMI are as follows. These drivers are fully accessible via VB or C# code:

  • Allen Bradley DF1 RS232 Driver
  • Allen Bradley Ethernet/IP Driver for SLC, MicroLogix, ControlLogix, and CompactLogix
  • Beckhof TwinCAT Driver
  • ModbusTCP Driver
  • ModbusRTU Driver
  • Omron Ethernet FINS Driver – Ethernet for newer controllers such as CP1H with Ethernet module
  • Omron Serial FINS Driver – Serial (RS232 / RS485) for newer controller such as CP1H
  • Omron Serial HostLink Driver – Serial (RS232 / RS485) for controllers such as CQM1, C200H, K-Series (C28K), C200, etc

The power of Advanced HMI is that it works within Visual Studio. This is a program integrated development environment (IDE) that you can take advantage of to modify or create new features including data logging applications.

The following is an AdvancedHMI Software Comparison video. It will show how easily you can have this software communicating and logging information.
Advanced HMI runs on Visual Studio 2008 or higher and will need to be installed on your PC. Visual Studio Community Edition 2015 is the latest version of the software. If you do not have it installed, please download and install from the following link.

We will now need the Advanced HMI project. Here is the link to download the zip file.

Here is a post that will walk through setting up AdvancedHMI on your computer.

We will design our AdvancedHMI screen as follows:

Our communication driver will be set for ModbusTCPCom1. The IP address is and our update time will be set for 100 ms. (PollRateOverride)

The program and screen information can be downloaded with the link below.
Here are a few screen shots of the program running:

See this logic in action by watching the YouTube video below.

You can download this application here. It will contain all of the screens and logic programming.

All of the documentation for the XL4 can be downloaded at the following URL:

Next time we will look at updating the firmware on our controller.

Watch on YouTube : Horner XL4 Modbus TCP AdvancedHMI Communication
If you have any questions or need further information please contact me.
Thank you,

If you’re like most of my readers, you’re committed to learning about technology. Numbering systems used in PLC’s are not difficult to learn and understand. We will walk through the numbering systems used in PLCs. This includes Bits, Decimal, Hexadecimal, ASCII and Floating Point.

To get this free article, subscribe to my free email newsletter.

Use the information to inform other people how numbering systems work. Sign up now.

The ‘Robust Data Logging for Free’ eBook is also available as a free download. The link is included when you subscribe to ACC Automation.

2 thoughts on “Horner XL4 Modbus TCP AdvancedHMI Communication”

Leave a Reply

Your email address will not be published. Required fields are marked *