We will now use AdvancedHMI to communicate to our Omron CP1H controller. 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 Omron CP1H PLC.
Our sample CP1H PLC program will use buttons and indicators to control a start/stop jog circuit. An analog input into the PLC will be scaled and displayed on a gauge on our AdvancedHMI screen. We will also write information to our 7 segment display on the CPU from our AdvancedHMI screen. This communication will be done using Omron serial host link protocol over an RS485 serial cable. The AdvancedHMI package will run on a windows PC and communicate out the port using a USB to RS485 adapter. Let’s get started.
Previously in this CP1H series, we have discussed:
System Hardware – Video
CX-Programmer – Video
Establish Communication – Video
Setting, Forcing, and Online Editing – Video
Numbering System and Addressing – Video
CP1H Timers – Video
Counters – Video
Data Movement – Video
Compare Instructions – Video
Data Shift Instructions
– Video Part 1
– Video Part 2
Math Instructions – Video
Data Conversion – Video
Program Control Instructions – Video
Table Data Instructions – Video
Data Control Instructions – Video
AdvancedHMI Communication – Video
AdvancedHMI – Omron Communication
AdvancedHMI can communicate to many devices. The CP1H PLC can communicate Host Link (C Mode Commands) Serial – RS232, RS485, RS422. It can also communicate Ethernet FINS via a communications module. 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
• Beckhoff TwinCAT Driver
• ModbusTCP Driver
• Modbus RTU 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.
Installing AdvancedHMI – Visual Studio
Advanced HMI runs on Visual Studio 2008 or higher and will need to be installed on your PC. Visual Studio Community Edition 2017 is the latest version of the software. If you do not have it installed, please download and install it from the following link.
Click on Free download to start the installation process.
We will now need the Advanced HMI project. Here is the link to download the zip file.
Click the download button for the latest version. (AdvancedHMI V3.99w)
Omron Driver for AdvancedHMI
Here are the steps to start using AdvancedHMI.
1. Open the solution file (.sln) with Visual Studio.
2. Build the project.
3. From the ToolBox (AdvancedHMIDrivers group), add an OmronSerialHostLinkCom1 to the form.
4. Set the Communication Settings property of the OmronSerialHostLinkCom1 driver.
The Omron serial default parameters are 9600 baud, Even parity, 7 data bits, and 2 stop bits.
You can use the device manager to review see the communication port that you are using. In my case, it is communication port COM5.
The following post will review setting up the AdvancedHMI program.
Creating the Omron AdvancedHMI Screen
We can now add the rest of the components to our HMI (Human Machine Interface) screen.
Place items from the toolbox. (AdvancedHMIControls Components) Settings will be discussed below for the components.
The Omron PLC defaults to Run mode. (Use programming console(Run)) This is the mode of the CP1H when it is powered. (Supply voltage applied) Communication to the CP1H will be done through the serial port. In order to change parameters in the PLC, this mode must be in Monitor for the Omron PLC.
Using CX-Programmer we can go to the PLC Settings and change the Startup to Monitor.
Start Stop Jog Circuit
The following link will explain the code for the circuit.
The AdvancedHMI (AHMI) Screen will use three momentary buttons and one pilot light.
Under the PLC Properties set the following:
Start – PLCAddressClick 21.0 – ComComponent OmronSerialHostLinkCom1
Stop – PLCAddressClick 22.0 – ComComponent OmronSerialHostLinkCom1
Jog – PLCAddressClick 23.0 – ComComponent OmronSerialHostLinkCom1
Output – PLCAddressValue 100.00 – ComComponent OmronSerialHostLinkCom1
Note: Controlling the bit using the momentary button will use the entire word. Ex. 21.0 represents the first bit of word 21. We cannot use the rest of the bits in the word.
Analog Input – Gauge display
Using the built-in analog on the CPU unit we attach our analog device and then use the scaling instruction. The scaling instruction will take our signal in and convert this to a number between 0 and 100. This will represent the percent on the gauge.
Here are the properties for the gauge display:
Appearance: ForColor – Red / Text – Analog 1
Misc: ComComponent – OmronSerialHostLinkCom1 / Maximum – 100 / Minimum – 0 / PLCAddressValue – D0
CPU LED Display – Digital Panel Meter
The Omron CP1H has a two-digit LED display that can be used to display information. We use the SCH(047) instruction to display either the upper or lower two digits. In our case, we will be displaying the lower two digits from data memory 1 (D1). The information will be coming from our AHMI screen.
Here are the properties for the DigitalPanelMeter:
Numeric Display: NumberOfDigits – 4 (Lowest Setting Possible)
Misc: KeypadMaxValue – 256 (Maximum Hex Display for two digits is FF.)
Misc: KeypadMinValue – 0
PLC Properties: ComComponent – OmronSerialHostLinkCom1 / PLCAddressKeypad – D1 / PLCAddressValue – D1
The keypad is used to input variables into the PLC.
We can now connect to the Omron CP1H PLC and run the AdvancedHMI application.
You can see that communication to the Omron CP1H using AdvancedHMI is very simple. This free package that runs in visual studio can be expanded because everything is opened sourced. Items such as database communication and email (SMS) can be added to the VB.net program. This should give you a good idea of what is possible using AdvancedHMI.
See the YouTube video below on using the AdvancedHMI software to communicate to the Omron CP1H PLC.
The following is a list of manuals associated with the CP1H programmable logic controller. See the descriptions for each of these manuals in the first post: Omron CP1H System Hardware
W450 – SYSMAC CP Series CP1H CPU Unit Operation Manual
W451 – SYSMAC CP Series CP1H CPU Unit Programming Manual
W342 – SYSMAC CS/CJ series Communications Commands Reference Manual
W446 – SYSMAC CX-Programmer Ver. 6.1 Operation Manual
W447 – SYSMAC CX-Programmer Ver. 6.1 Operation Manual Function Blocks
W444 – CX-One FA Integrated Tool Package Setup Manual
W445 – CX-Integrator Operation Manual
W344 – CX-Protocol Operation Manual
You can download the PLC and AdvancedHMI program as discussed above here.
This concludes our Omron CP1H series. Thank you all for your questions and comments.
Watch on YouTube : Omron CP1H AdvancedHMI Communication
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 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.