Professional Documents
Culture Documents
HMI Integration Lab
HMI Integration Lab
Pg 1 of 29
HMI Integration 171213 HMI Integration Lab
3. On the configuration screen for the M850 > Select the General tab and enter “HMI_Interface” for the name of
this controller
a. Set the IP Address (NOTE: This will be used later to connect the PLC to the HMI)
Select Ethernet
3. Subnet: 255.255.0.0
Pg 2 of 29
HMI Integration 171213 HMI Integration Lab
4. Assign Plug-In IO
a. Go to “Plug-In Modules and “Expansion Modules” and configure the I/O modules of your system as you
have in previous labs.
Be sure to configure the properties of each I/O module as you did in previous lab as you will be rewriting ladder code
to reuse these modules in the same fashion as in previous labs
OF4
Pg 3 of 29
HMI Integration 171213 HMI Integration Lab
Pg 4 of 29
HMI Integration 171213 HMI Integration Lab
This is the configuration page for the HMI to Read & Write data to a specific controller.
Ethernet|Allen-Bradley CIP
Name: My Machine
Pg 5 of 29
HMI Integration 171213 HMI Integration Lab
Take a moment to also explore the settings in “User Accounts”, Languages” and “Advanced”-
BUT MAKE NO CHANGES- leave everything at default values at this time.
5. Notice In the Project Organizer window, under PVc Application 1 there is a “Tags” database file. We will be
building these shortly.
Tag names (addresses) in the HMI are very similar to those in the PLC- but they are
not the same identical tags. (This pertains only to the Micro800 PLCs when used
with the PanelView Component style HMI’s) There are many reasons for this but
the big one is this: It’s a good practice when programming machinery to program
in such a way that ‘core operational’ code of the machines functions are in its
own ‘container’. Meaning the operational function of the code never changes-
but by directing (mapping) Inputs into that container, and direction (mapping)
outputs from that container- you can use the same proven PLC and HMI code in
any application or project, you’re just going to READ & WRITE (map) data to &
from those proven containers without rewriting code for every project. If you
use this ‘container’ code (also sometimes referred to as User Defined Function
Block, routine or Add On Instruction) for various Projects and machines, then
everything in the plant, or on a specific line is identical. If one singular change is
needed to be made (i.e. an address change from a 00 to a 01) than the code only
needs to be edited once and reloaded to the PLC or HMI instead of uploading
the code from each PLC/HMI and making the single edit multiple times in
multiple PLC/HMIs. If all ‘functional’ code it the same- it makes it very easy to
edit, maintain and troubleshoot. So, that being said- in previous labs you
‘mapped’ input data to output data in the PLC Ladder editor.
i.e. IO_EM_DI_00 turns on IO_EM_DO_00.
But, those addresses are already identifiable by their name and we know where they’re going to & coming
from. IO_EM is Inputs/Outputs Embedded in the PLC and DI or DO is digital IN and OUT. In the HMI, we
will create objects (indicators, push buttons, and analog displays) that have tag names specific to and
within the HMI and not in common to the PLC. But, those HMI Tags will be mapped to a specific PLC to
Write or Read data within that PLC. This will give us the ability to use the HMI code on many machines, all
we need to do is make the I/O connections of the HMI mapped to the I/O connections of the PLC.
You should always name the HMI objects Tags and the mapped tag in the PLC in an easy to understand
format- and knowing that vernacular.
Pg 6 of 29
HMI Integration 171213 HMI Integration Lab
Example:
If I have a pushbutton object on an HMI, and I want that button to turn on a motor.
I name the HMI object, assign it a HMI tag name in the HMI Tags file, then map the HMI Tag name to a PLC Global
Address.
I touch the object, it turns on the HMI tag that has a mapped address in a specific PLC
Which of the following would be easier to read, debug- and in implementing your HMI code- know where to put
the Motor Start PB in the code?
…OR….
Pg 7 of 29
HMI Integration 171213 HMI Integration Lab
8. What is in that red box will be the objects of Screen 1 that we will create and map to the PLC.
a. Highlight ‘Momentary Push Button’ and drag it over on the build pallet as shown.
Pg 8 of 29
HMI Integration 171213 HMI Integration Lab
a. Double click on the blue box called “Rele*” > This brings up the “States” of this Momentary Push Button, its
ON state color, OFF state color, what it says when it’s OFF vs when it’s ON…Font, font size…etc.
b. Set yours up from the left side of the page to that on the right side of the page.
- Notice- the blue box currently has the word ‘Rele*’ displayed.
At this time, please only change what the steps instruct you to change. You can make modifications later, but let’s
keep your project looking like the instructions for the moment.
Navigation
Pg 9 of 29
HMI Integration 171213 HMI Integration Lab
11. Connections
a. Under the Connections Properties
b. Click on ‘Write Tag’
c. Click on ‘New’
Pg 10 of 29
HMI Integration 171213 HMI Integration Lab
e. Click on Address
Your see the User Global Variable Tags that are in the PLC being displayed.
We could map the HMI Object Tag of Mach_ON_PB_Req directly to the IO_EM_DIO output that turns on the
Machine, but we would have no control over such direct connection, no ability to monitor, difficult to
troubleshoot, wouldn’t be able to duplicate the HMI code to work with other PLCs because their Input/Output
addresses may differ and worst of all- since this is a “Momentary” Push Button…
So- we will create a User Defined Tag in the PLC that we will map the HMI input to.
2.9 Assigning the PLC Tag that this HMI Tag writes to.
Type in the Name of “HMI_BP_Mach_ON”
Select Boolean for Type
By using a structure like ‘HMI’-‘PB’- ‘Mach’-‘ON’ - all of the interfacing HMI mapped to the PLC will be displayed in
the PLC in a simple structure:
‘Requesting Location – Type of Input/Output – Type of Function – Type of Action’.
Which makes writing, reading and debugging the PLC faster and easier, because we’ll know where these Inputs are
coming from.
Notice- all addresses mapped into the PLC go into the ‘Global Connections”
Mapped to
Pg 11 of 29
HMI Integration 171213 HMI Integration Lab
Pg 12 of 29
HMI Integration 171213 HMI Integration Lab
Although we only need (2) states (OFF & ON), the best practice is to always be sure to leave the last state as an “Error”
state on all HMI Objects.
? Why do you think this is?
Pg 13 of 29
HMI Integration 171213 HMI Integration Lab
Problem is…the Height and Width isnt big enough to display the text.
Background and text color of STOP or EMERGENCY STOP function BP’s shall be
STATE is OFF= Red background color / Black text /Arial Font size 14
STATE is ON = Red background color / Black text /Arial Font size 14
Multi-State Indicator Properties
Pg 14 of 29
HMI Integration 171213 HMI Integration Lab
For commonality between all screens the screen layout shall consist of the following.
Operator Information
3.1 On Scteen1:
Add the following (2) rectangles to the screen and set accordingly its attributes in the property field.
For the top rectangle
Pg 15 of 29
HMI Integration 171213 HMI Integration Lab
Pg 16 of 29
HMI Integration 171213 HMI Integration Lab
Now, our multistate indicator in the upper right hand corner is too small to display the text “Machine ON”- and all
we need to to know if its “ON” or “OFF” anyway…the title bar at the top (according to the spec sheet) tells us this
is a Machine Status Indicator
So change the text of the Multistate Indicator to OFF and ON
Pg 17 of 29
HMI Integration 171213 HMI Integration Lab
Pg 18 of 29
HMI Integration 171213 HMI Integration Lab
the “Configuration Screen” is something we need
during development and debug.
Pg 19 of 29
HMI Integration 171213 HMI Integration Lab
Pg 20 of 29
HMI Integration 171213 HMI Integration Lab
c. Select the up arrow from the USB until the source is USB > Programs (.cha files) should show up (If not
unplug the USB and replug it in) > Select (Press) Copy to transfer the code to the HMI to run the program
Pg 21 of 29
HMI Integration 171213 HMI Integration Lab
Pg 22 of 29
HMI Integration 171213 HMI Integration Lab
b.IP Address: Type in the following IP Address 192.168.1.15 (NOTE: IP address is different from the PLC so the
two machines will be able to talk to each other without overwriting each others data.)
c.Mask: Subnet Mask will be the same for both the PLC and HMI at 255.255.255.0
Pg 23 of 29
HMI Integration 171213 HMI Integration Lab
In programming any PLC controlling a machine the I/O update time is a critical element of the functionality and
safety of a machine.
? Why?
? What could happen if the time to read Inputs, update ladder and write outputs is excessively long?
Class 2 Messaging in a PLC is reserved for ‘housekeeping’ which means after the local I/O scan the PLC takes care
of internal priorities i.e. clearing buffers, clock update, processor status etc..
This is called the PLC’s “Overhead Time Slice” and is shared with the Class 3 Messaging. While this time (in some
PLC’s) is adjustable, the minimum it can be adjusted to is the minimum it takes to take care of the housekeeping.
Class 3 Messaging in a PLC is reserved for non-critical I/O update and is taken care of with whatever time is left
over, or shared with Class 2 Messaging, the Overhead Time Slice.
Class 3 messages are user triggered events like a print instruction, end of shift reports and HMI communications.
Pg 24 of 29
HMI Integration 171213 HMI Integration Lab
The % or Overhead Time slice allowed for class 3 messaging will determine how much time is allowed to take care
of these types of I/O update- before the scan has to stop and go back and execute class 1 and class 2 update. So it
is possible that it could take several system scans for a Class 3 message to complete.
If the Class 3 message is a very large data packet, and time runs out, then a marker is placed where the processor
left of and the processor executes the Class 1 and 2 again- then continues where it left off on the class 3 packet.
? Why then, would you NEVER want to put an Emergency Stop Button on an HMI screen?
Class 3 Start
HMI
Read in all Inputs
Internal Operations
(Class 2)
1 Processor Scan
Next you will add some PLC code that will simulate turning on an air compressor and monitoring the pressure to
allow the machine to remain on.
You will write PLC code:
• If the air pressure does not achieve a preset value, the machine will not turn on.
• If the air pressure is not maintained at a certain minimum- the machine shuts off.
• If the air pressure exceeds a certain maximum- the machine shuts off.
Pg 25 of 29
HMI Integration 171213 HMI Integration Lab
PLC Code
Enter the Ladder into Machine_Ops (as shown on the following page)
PLC tag names will be as follows
Pay attention to the preset values you are to enter and the data types
Pg 26 of 29
HMI Integration 171213 HMI Integration Lab
Pg 27 of 29
HMI Integration 171213 HMI Integration Lab
Local Variables
Global Variables
? Why should you program some of the User defined addresses only Local to Machine Ops while others are in the
Global Variables?
Pg 28 of 29
HMI Integration 171213 HMI Integration Lab
? What should the ‘Read Tag” be set to for this Multistate Indicator?
Hint- we want the Air Pressure status word
Add a Numeric Input to read “AirPressure” with a number of digit set to 5 and decimal point of 1.
? Why- when you download to the PLC, you get a lot of errors on the HMI?
Pg 29 of 29
HMI Integration 171213 HMI Integration Lab
? Can you add a numeric entry on the screen to change the Air Pressure LOW and HIGH set points instead of
using the potentiometer?
? Can you add a text banner that will appear when the Air pressure is not OK
-END OF LAB-
Pg 30 of 29