hmi integration 171213 hmi integration lab€¦ ·  · 2018-02-06hmi integration 171213 hmi...

29
HMI Integration 171213 HMI Integration Lab Pg 1 of 29 Section 1 Creating the HMI Interface Project 1. Open CCW and Start a New Project > Project Name HMITutorial 2. From the Add Device window: a. Select the Micr850 family. b. Select 2080-LC50-24QBB c. Version 9 d. Select Add to Project

Upload: lenga

Post on 14-May-2018

219 views

Category:

Documents


1 download

TRANSCRIPT

HMI Integration 171213 HMI Integration Lab

Pg 1 of 29

Section 1 Creating the HMI Interface Project 1. Open CCW and Start a New Project > Project Name HMITutorial

2. From the Add Device window: a. Select the Micr850 family. b. Select 2080-LC50-24QBB c. Version 9 d. Select Add to Project

HMI Integration 171213 HMI Integration Lab

Pg 2 of 29

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

1. Select Configure IP address and Settings

2. Type in the IP Address

192.168.1.10

(NOTE Subnet Mask should automatically

fill in

HMI Integration 171213 HMI Integration Lab

Pg 3 of 29

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

5. Build and Save this portion

a. “Build” the Project b. “Save” the Project as “HMI_Interface”

OF4

TC-2 MEMBAK

IF4

HMI Integration 171213 HMI Integration Lab

Pg 4 of 29

Section 2 Adding the Human Machine Interface (HMI) 1. Select View drop down Menu > select “Device Toolbox” or Select Device Tool Box from the Right Hand Menu

a. Expand “Graphic Terminals” b. Expand PanelView Component c. Double click on 2711C-T6T to add it to the Project.

Select Device Toolbox

in either Location

HMI Integration 171213 HMI Integration Lab

Pg 5 of 29

2. Double Click on PVc Application1 to open its properties

This is the configuration page for the HMI to Read & Write data to a specific controller.

3. A quick tour:

MAKE NO CHANGES- leave everything at default values at this time.

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.

Communication Protocol to use with the PLC

Name, Type and address of the target PLC

HMI Integration 171213 HMI Integration Lab

Pg 6 of 29

4. 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.

HMI Integration 171213 HMI Integration Lab

Pg 7 of 29

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?

In the HMI

Mach Start PB

Mapped address in PLC

HMI_PB_Mach_Start

Target PLC1

In PLC1

Global Connection in PLC

HMI_PB_Mach_Start

HMI Tag Name

To this PLC

Mapped to this address in the PLC

Global Input for Ladder Programming

…OR….

HMI Integration 171213 HMI Integration Lab

Pg 8 of 29

5. In the Project Organizer

a. Double click on Screen 1 > Right click on the red box and ‘zoom in’ as much as you can > Then right click again and select “Set as Startup”. This page will be the first page of possibly many to display.

6. If not already displayed a. Click on the “View’ pulldown tab > Select Toolbox > Then position the Toolbox close to Screen 1.

7. 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.

HMI Integration 171213 HMI Integration Lab

Pg 9 of 29

8. Assigning Objects: Properties of this “Push Button”

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.

c. Click on OK when finished

Your Momentary Push Button should look like this

(it could be blue or green)

d. Right click on the button and select Properties. This will bring up the properties of this object on Screen 1

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.

Appearance attributes of the Object

Location, Size & Name*

Connections to the PLC*

Navigation

*In Red denotes initial edits we will make in this lab

HMI Integration 171213 HMI Integration Lab

Pg 10 of 29

9. Object Name a. Under the ‘Properties’ for this object. b. Under Common- and at Name. c. Edit its name to “StartButton”.

10. Connections

a. Under the Connections Properties

b. Click on ‘Write Tag’

c. Click on ‘New’

d. Assigning HMI Tag Addresses

- This brings up the Tag Editor within the HMI Application.

- By setting a ‘Write Tag’ we’ll be mapping the HMI Object ‘StartButton’ to a Global tag in the PLC.

We can either use an existing PLC Global Tag or we can create one.

- Tag Name Mach_ON_PB_Req

- Data Type Boolean

HMI Integration 171213 HMI Integration Lab

Pg 11 of 29

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”

This HMI tag

Mapped to

This PLC address

Click OK to close the PLC Tag entry

Back to the HMI Tag Properties, enter the following:

Name (tag Name)

This is a pulldown of the Controller(s) you assigned the HMI to communicate to.

Description

Descriptive text of the HMI tag, useful in determining what the Tag is or does

2.10 Adding more HMI Tags and PLC Addresses

HMI Integration 171213 HMI Integration Lab

Pg 12 of 29

While we’re in the HMI Tag editor

Click on “Add” and add 2 more tags:

Go back to Screen1 pallet

Add another Momentary Push Button

and set its State Properties as follows

Assign the following Name and Tag

(Notice the HMI Write Tag was already there

in the tags in the pull down.

That’s because we created it in the HMI in the

previous step.

HMI Integration 171213 HMI Integration Lab

Pg 13 of 29

2.11 Multistate Indicators

Add a Multistate indicator

By default, a Multistate indicator has (4) states.

We can add more if we wanted to- but the ‘read’

tag from the PLC would have to be BCD, Integer-

or something other than Boolean in order to

provide multiple states.

All we want is an On/OFF indicator

Highlight and delete States 3 & 4

Program the Multi-Indicator States as follows

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?

Your MultiState Indicator should look like this.

Problem is…the Height and Width isnt big enough to display the text.

HMI Integration 171213 HMI Integration Lab

Pg 14 of 29

3.0 Programminmg to Specifications

In HMI coding the the “customer’ of the machine gives the maching builder ‘specs’- guidlines or ‘standards’ to

follow for not only the PLC coding but also the HMI coding. Functionaliity, appearance, order of excution, colors and

layouts are all part of the “build specs’.

Industry standard it to keep everything uniform. Not only on all screen displays and their associated objects, but

also from maching to machine. So that no matter what screen or machine you’re on- the sizes, colors, locations, and

functionality are all the same.

So lets set a simple ‘spec’

Operator Pushbutton functionality:

All Pushbuttons are to be “Momentary” in scope

Number of STATES shall be 3 0=OFF, 1=ON, 3=Error

? Why not ‘Maintained’ or ‘Latched’

All PushButton Write Tags shall write to the Global Defined tags in the PLC database NOT directly to a DI or

DO assigned to the PLC.

? Why

Background and text color of standard control function BP’s shall be

STATE is OFF Blue background color / Black text /Arial Font size 14

STATE is ON Green background color / Black text /Arial Font size 14

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

Operator Multistate Indicators

Number of STATES shall be 3 0=OFF, 1=ON, 3=Error

Background and text color of standard control function Multistate indicators shall be

Informational State;

STATE is OFF Blue background color / Black text /Arial Font size 14

STATE is ON Green background color / Black text /Arial Font size 14

Safety State;

Not SAFE STATE OFF= Red background color / Black text /Arial Font size 14

SAFE STATE ON = Green background color / Black text /Arial Font size 14

Caution STATE;

Not SAFE STATE OFF= Red background color / Black text /Arial Font size 14

SAFE STATE ON = Yellow background color / Black text /Arial Font size 14

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

Select Multi-State Indicator > Select

Properties > Set Read Tag to Mach_is_ON

HMI Integration 171213 HMI Integration Lab

Pg 15 of 29

For commonality between all screens the screen layout shall consist of the following.

Using the programming ‘standard’, before we go any further on our HMI code:

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

And for the bottom rectangle

Operator Information

And Process Function Read / Write

data

Machine Function Status & Message area Machine Status heads up display area

Basic Machine Control area

HMI Integration 171213 HMI Integration Lab

Pg 16 of 29

Position the objects as shown,

(drag and drop using each objects properties box to adjust the

‘top’ height so the buttons are even and symmetrical in

appearance)

In the top rectangle, enter a text box that says

MACHINE STATUS

HMI Integration 171213 HMI Integration Lab

Pg 17 of 29

Edit its properties as follows

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

HMI Integration 171213 HMI Integration Lab

Pg 18 of 29

Your final screen should look like this

Final Steps and then we’ll test this (1) screen

In the Project Orginizer

Right click on the PVc Application1

Click on Validate

Validating the HMI program checks for ojjectts

with missing tags, overlapping, missing PLC paths,

ect.

Correct errors you may have.

If all your code is good and validates-

you should get only (1) warning that says

“…must contain at least 1 GOTO Config Button

If the Operator needs to access the configuration

screen”

The ability to stop the screens from running on the

HMI (called the runtime application) and return to

the “Configuration Screen” is something we need

during development and debug.

HMI Integration 171213 HMI Integration Lab

Pg 19 of 29

Section 3: Download HMI Program to HMI Interface

In the final code we can prevent the customer from accessing the HMI Configuration screen by always having our

“runtime’ execute on power up of the HMI, by removing access to stopping it, or requesting a password to access the

Configuration of the HMI.

1. Add the GoTo Congiguration button

a. Close the Validation window

b. Scroll down the Toolbox window and find the

GoTo Terminal Configuration object

c. Place it on the screen as shown below

d. Change the name to ‘Config’

e. Re-Validate your Vc Application- you should have no errors or warnings.

Invalid code may not download- or may not run corrwectly.

2. Download Code using USB Port

a. Plug in USB Drive to Computer

b. Right Click on PVcApplication1 > Select Export > Navigate to USB Port save file. (NOTE file

extentsion is a .cha)

HMI Integration 171213 HMI Integration Lab

Pg 20 of 29

3. Downloading the HMI ‘runtime’ application

a. Main Screen:

a. File Manager: Allows user to run various programs

downloaded to HMI

b. Communications: Allows user to setup IP address for

ethernet communication

c. Display: Allows user to adjust brightness, timeout (sleep)

Calibration of Touchscreen, etc.

d. System Information: Allows user to see firmware version

and open memory

e. Date and Time: Allows user to integrate year, day

and time into their program

b. Select (Press) File Manager > Following screen will appear

DO NOT ever delete

this file. It controls

the setup for the HMI

HMI Integration 171213 HMI Integration Lab

Pg 21 of 29

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

d. Switch Source back to Internal

e. Highlight the program to be run > Select (Press) Run

Move Arrow to select

USB Source

Select Run when the program to

run is selected from the USB

Select Copy to transfer file to HMI

Harddrive

HMI Integration 171213 HMI Integration Lab

Pg 22 of 29

2. Setup IP Address on HMI to communicate to the PLC

a. Select Main to get back to the Main Screen > Select Communications > Select (Press) Set Static IP Address

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

Select Set Static IP Address

HMI Integration 171213 HMI Integration Lab

Pg 23 of 29

….We still need to write the PLC code!

6.0 Write the PLC Code

Create the following ladder program called Machine Ops and enter the following;

Build, download and test your HMI screens.

Save your Project

Response time may seem a little slow.

That’s because of the priority given to the local I/O updates, PLC housekeeping and Class 3 packet priority.

Within 1 scan (or update) interval of a PLC it must prioritize what is the most important data to handle first, then

housekeeping, followed by non-critical updates, and it will repeat that cycle on every update interval.

These are defined by (3) types of Class Messaging

Updating the I/O is called the “I/O Update Interval.

In PLCs it’s referred to as “Class 1 Messaging” which means priority scan time is reserved to read in the Inputs,

execute the PLC code, and write the Outputs to local I/O first.

The time it takes to do that is not a user adjustable time. It is what it is.

If a system has 100 Inputs, 100 lines of Code and 50 outputs the I/O update interval could be 10ms.

If a system has 1000 Inputs, 1000 lines of Code and 150 outputs the I/O update interval could be 250ms.

Poor programming practices or large function blocks that move or do large mathematical functions on a large data

file can eat up a lot of time. To cut down on the scan time of the ladder, prioritize the importance of the rungs.

i.e. if a push button is to start a multiplication instruction on a large file or word, then comparison of the resultant

to another file, then turn on an Output- put the condition in the beginning of the rung.

If the condition is false, then the whole rung is skipped. If true, only then does the processor execute it.

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.

HMI Integration 171213 HMI Integration Lab

Pg 24 of 29

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.

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?

6.1 Now, let’s put in some permissive conditions

When the Start Machine button is depressed, it turns on the machine but in order to keep the machine on it must

also turn in the air compressor and achieve a certain amount of pressure.

Air pressure below or above certain set points may cause damage to the machine or produce inferior parts and/or

operation.

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:

Read in all Inputs

Scan Logic

Write all Outputs

Internal Operations (Class 2)

Class 3 HMI

1 Processor Scan

Start

HMI Integration 171213 HMI Integration Lab

Pg 25 of 29

• 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.

The 10v potentiometer will simulate the pressure switch

You will write HMI code to:

Display on the HMI what the actual air pressure reading is.

Turn on indicators that the air pressure is Off, LOW, OK, or HIGH

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

HMI Integration 171213 HMI Integration Lab

Pg 26 of 29

HMI Integration 171213 HMI Integration Lab

Pg 27 of 29

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?

6.2 In the HMI – add the following:

You can also take this time to cosmetically clean up the screen if you want.

Was the white background too bright? – try grey.

Buttons to small? Change height and width.

But everything must be kept symmetrical as this will be a template in later labs.

On Screen 1, from the toolbox add a multi-level indicator set it for

HMI Integration 171213 HMI Integration Lab

Pg 28 of 29

? 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.

Your screen should look like this

Validate and download (either via Ethernet or USB)

Download the PLC code to the M850

SAVE YOUR PROJECT

Turn the pot down to 0

Press and hold the start button

? Does the HMI show the Machine stays ON?

Using the potentiometer to simulate air pressure-

Press and hold the start button

Increase the pot. to simulate an air pressure between the low and high set points of 100-120psi

? When you let go of the Start Button- does the Machine stay on?

? What happens if the pressure goes above or below set points?

? Explain rung 3- what are we looking for.

? Why is Air status OFF is considered to be less than 1? Why not 0?

Build, download and test your HMI screens.

Save your Project

? Why- when you download to the PLC, you get a lot of errors on the HMI?

HMI Integration 171213 HMI Integration Lab

Pg 29 of 29

End of written lab- but more is to come.

? 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-