We will now look at using the Horner XL4 with AdvancedHMI. 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. Continue Reading!
Modbus RTU will be the serial (RS485) method in which we will communicate between the AdvancedHMI Screen and the Automation Direct Solo Process Temperature Controller.
We can address up to 247 (Solo 1 to 247) devices on this master-slave protocol. A maximum of 32 devices (Nodes) on the network can communicate to the master. A review of the Modbus RTU protocol can be seen at the following URL.
AdvancedHMI is a free HMI programming package the runs on Microsoft Visual Studio. It can be downloaded at the following URL.
Connections – AdvancedHMI to Solo Process Temperature Controller
We will be running the AdvancedHMI software on the computer. One of the USB ports will have a USB to RS485 adapter and communicate RS485 to the Solo process temperature controller.
See the following post to install the USB to RS485 adapter.
Solo Controller Settings
In the Initial Setting Mode we will change the online configuration and make the changes to the Modbus settings as follows: 9600 Baud, Even, 7 Data Bits, 1 Stop Bit, Modbus ASCII Format. We will leave the default unit number as 1. See the following post to set the controller:
AdvancedHMI will use the Modbus Decimal value in the PLCAddressValue to determine the information that you want to get. For a list of all Modbus addresses that can be used in your project, refer to the Solo Manual located a the following URL:
Screen Display: (AdvancedHMI)
Here is what our screen will look like:
We have mimicked the look of the solo process temperature controller. Our PV and SV values are DigitalPanelMeters from the AdvancedHMI toolbar. The eight output indicators are just labels.
Our ModbusRTUCom1 settings are as follows:
Settings: 9600, 8, Even, One StopBit and Station 1 should all match the settings in the Solo process temperature controller that we did previously.
PollRateOverride will allow us to determine how often communication will take place to the controller. (250msec)
The PortName will be the same port number that the computer will communicate out of. This will be set when you install the USB to RS485 adapter. It may change if a different USB port is used.
We read the value of the eight status bits and convert this into a string so we can determine the status of each of the individual bits. Here is the code that is used to do this. It is the only code required for this application.
Private Sub DataSubscriber1_DataChanged(sender As Object, e AsDrivers.Common.PlcComEventArgs) Handles DataSubscriber1.DataChanged Dim i As Integer = DataSubscriber1.Value Dim Status As String Status = Convert.ToString(i, 2).PadLeft(8, "0") '8 bits 'There are 8 bits that we need to check and account for on our screen. 'Modbus Decimal - 44139 'Bit 0 - ALM3 - Alarm 3 'Bit 1 - ALM2 - Alarm 2 'Bit 2 - C degrees 'Bit 3 - F degrees 'Bit 4 - ALM1 - Alarm 1 'Bit 5 - OUT 2 'Bit 6 - OUT 1 'Bit 7 - AT - Auto Tuning
The complete AdvancedHMI code for this application can be downloaded at the end of the post.
They both have four digits with a decimal position of 1. This will give us a value between 000.0 and 999.9.
The SV includes a keypad to change the set value. KeypadScaleFactor is set to 0.1 to allow for the decimal place.
You want to make sure that the YMaximum and YMinimum settings are set to the values will not go past these settings. If they do then the graph line will disappear from the chart at that point and time.
This will show a running trend for the last 5 minutes.
Polling rate is 250msec x 1200 points in the chart = 300 000msec
300 000msec / 1000 = 300 seconds
300 seconds / 60 (seconds in minute) = 5 minutes
Notes: Displaying Extended ASCII Symbols in Visual Studio (VB.NET)
You can display any symbol in the visual studio environment by holding the ‘Alt’ key down and typing the decimal number of the symbol that you want. In our example, the degrees symbol is Alt 248.
Here are the extended ASCII symbols:
As you can see, programming the AdvancedHMI to communicate to the Solo process temperature controller is very easily done.
Watch on YouTube: AdvancedHMI to Solo Process Temperature Controller
If you have any questions or need further information please contact me.
If you’re like most of my readers, you’re committed to learning about technology. Numbering systems used in PLCs 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.