L1LODL09 AddInstructions Labs

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 25

Adding Bit-Level Ladder

Diagram Elements
Important User Information
This documentation, whether, illustrative, printed, “online” or electronic (hereinafter “Documentation”) is intended for use only as
a learning aid when using Rockwell Automation approved demonstration hardware, software and firmware. The Documentation
should only be used as a learning tool by qualified professionals.

The variety of uses for the hardware, software and firmware (hereinafter “Products”) described in this Documentation, mandates
that those responsible for the application and use of those Products must satisfy themselves that all necessary steps have been
taken to ensure that each application and actual use meets all performance and safety requirements, including any applicable
laws, regulations, codes and standards in addition to any applicable technical documents.

In no event will Rockwell Automation, Inc., or any of its affiliate or subsidiary companies (hereinafter “Rockwell Automation”) be
responsible or liable for any indirect or consequential damages resulting from the use or application of the Products described in
this Documentation. Rockwell Automation does not assume responsibility or liability for damages of any kind based on the
alleged use of, or reliance on, this Documentation.

No patent liability is assumed by Rockwell Automation with respect to use of information, circuits, equipment, or software
described in the Documentation.

Except as specifically agreed in writing as part of a maintenance or support contract, equipment users are responsible for:
• properly using, calibrating, operating, monitoring and maintaining all Products consistent with all Rockwell Automation
or third-party provided instructions, warnings, recommendations and documentation;
• ensuring that only properly trained personnel use, operate and maintain the Products at all times;
• staying informed of all Product updates and alerts and implementing all updates and fixes; and
• all other factors affecting the Products that are outside of the direct control of Rockwell Automation.

Reproduction of the contents of the Documentation, in whole or in part, without written permission of Rockwell Automation is
prohibited.

Throughout this manual we use the following notes to make you aware of safety considerations:

Identifies information about practices or circumstances that can cause an explosion in a hazardous
environment, which may lead to personal injury or death, property damage, or economic loss.

Identifies information that is critical for successful application and understanding of the product.

Identifies information about practices or circumstances that can lead to personal injury or death, property
damage, or economic loss. Attentions help you:
• identify a hazard
• avoid a hazard
• recognize the consequence

Labels may be located on or inside the drive to alert people that dangerous voltage may be present.

Labels may be located on or inside the drive to alert people that surfaces may be dangerous temperatures.
Level 1: Logix - On Demand Adding Bit-Level Ladder Diagram Elements

Before You Begin

About this Lab


Once we have determined how our logic needs to function, adding the various bit-level
instructions within the Studio 5000 Logix Designer® application is easy. In this lab you will:
 Add bit-level ladder diagram elements
This lab takes approximately 25 minutes to complete.

Hardware
To complete this lab, you will require the following hardware:
 PC-based programming workstation with access to the RAcbi learning environment

Software
To complete this lab, you will require the following software:
 Studio 5000 Logix Designer version 32

Files
To complete this lab, you will require the following files:
 Machine_1_Lab09.ACD

Setup
To complete this lab, you will need to perform the following setup procedure:
1. Log on to your instance of the RAcbi learning environment.

© Rockwell Automation, Inc. All rights reserved. 1


Adding Bit-Level Ladder Diagram Elements Level 1: Logix - On Demand

Add Bit-Level Ladder Diagram Elements


When programming the logic in a Logix Designer project, we must first open the routine wherein
we want the logic to reside. Then, to meet the programming preferences of a broad audience,
the Logix Designer application provides a variety of ways in which a programmer can add
instructions to the routine. In this section of the lab, you will add bit-level instructions to the main
routine of your Logix Designer project in order to satisfy previously defined requirements.
1. If you have completed all labs up to this point in the Level 1: Logix - On Demand course,
then you may continue using your Machine_1.ACD file from previous labs:
a. Open the Studio 5000® environment.
b. Under Recent Projects, select your Machine_1 project:

1.b.

2. If you have NOT completed all labs up to this point in the Level 1: Logix - On Demand
course (e.g., you are just doing this individual lab as a refresher), then open the starting
file for this lab:

a. Use the shortcut on the desktop of your instance of the RAcbi learning
environment to open the LabFiles.
b. Open the Machine_1_Lab09.ACD file.
3. In the Controller Organizer of your project, verify that the Tasks, MainTask, and
MainProgram folders are expanded by clicking the plus sign next to them.
The logic that we enter in our project is contained in a main routine or a subroutine.
These routines and subroutines are contained within programs and programs are
contained within tasks. When we first created our project, a MainRoutine was
automatically created within a MainProgram and a MainTask. These names can be
changed, and we will do so in a later lab. But, for now, let’s begin coding in the
MainRoutine just as it is. By default, the MainRoutine of the MainProgram in the
MainTask is a Ladder Diagram routine.

2 © Rockwell Automation, Inc. All rights reserved.


Level 1: Logix - On Demand Adding Bit-Level Ladder Diagram Elements

4. Under the MainProgram, double-click the MainRoutine to open it:

5. Notice that, upon opening, a new rung is automatically created in the empty
MainRoutine. Click the area to the left of the rung so that it is highlighted in blue as
seen here:

© Rockwell Automation, Inc. All rights reserved. 3


Adding Bit-Level Ladder Diagram Elements Level 1: Logix - On Demand

The logic solution that we have previously developed appears as follows:

So, let’s begin by adding an instruction for the machine interlocks. As mentioned, instructions
may be added to a routine in multiple ways. One method is dragging an instruction down from
the Language Element toolbar and dropping it in the desired location within the routine.

6. Notice the tabs along the bottom of the Language Element toolbar:

4 © Rockwell Automation, Inc. All rights reserved.


Level 1: Logix - On Demand Adding Bit-Level Ladder Diagram Elements

Instructions are organized by functionality into these tabs. Since there are more categories than
can be displayed along the width of the toolbar, there are navigational arrows that allow us to
scroll left and right to view all of the tabs:

Furthermore, if the number of instructions within a category exceeds the horizontal space, there
are arrows for scrolling left and right through the instructions as well:

Bit-level instructions may be located within the Favorites and Bit tabs. The Favorites tab is
selected by default.

7. Select the Bit tab:

8. Click and drag an Examine On instruction from the Language Element toolbar
onto the beginning of rung 0:

© Rockwell Automation, Inc. All rights reserved. 5


Adding Bit-Level Ladder Diagram Elements Level 1: Logix - On Demand

9. You may also add instructions by simply clicking them in the Language Element toolbar,
and they will appear to the right of whichever element is currently selected in the logic:

a. Select the Examine On instruction that you just added to rung 0.

b. Click the Examine On instruction in the Language Element toolbar to add


an instruction for the machine permissives.

c. Click the Examine On instruction in the Language Element toolbar to add


an instruction for the start pushbutton.

d. Click the Examine On instruction again to add an instruction for the motor
stop pushbutton:

9.a.

9.b.

9.c.

9.d.

We may also open a browser to search for an instruction using the Insert key on our
keyboard. As always, the instruction is placed to the right of whichever element is
currently selected.

6 © Rockwell Automation, Inc. All rights reserved.


Level 1: Logix - On Demand Adding Bit-Level Ladder Diagram Elements

10. Press the Insert key on your keyboard to open the Add Ladder Element browser and:
a. Type ‘OTE’ in the Ladder Element search box.
b. Select the OTE Output Energize instruction.
c. Click the OK button:

10.a.

10.b.

10.c.

Now we need to add a Branch element around the second and third XICs for our seal-in logic.
The Branch element may be found towards the beginning of any category tab, and may also be
searched for in the Add Language Element browser using the keyword Branch:

© Rockwell Automation, Inc. All rights reserved. 7


Adding Bit-Level Ladder Diagram Elements Level 1: Logix - On Demand

11. Select the first instruction on your rung:

12. Using the method of your choice, add a Branch element after the first instruction on your
rung:

13. Click and drag the right side of the Branch element such that it surrounds the second
and third instructions on your rung:

8 © Rockwell Automation, Inc. All rights reserved.


Level 1: Logix - On Demand Adding Bit-Level Ladder Diagram Elements

14. Select the left side of the Branch:

Instructions may be added to a Branch in the same ways that they may be added to a
rung.
15. Add an XIC instruction to the Branch:

Now let’s assign program parameter names to our instructions.

16. Double-click the question mark over the Output Energize on rung 0, type
‘Motor_On’, and notice that there is a look ahead function that assists us by auto-
completing what we are typing with tags or program parameters that already exist:

17. When the tag box shows the desired tag or program parameter (Motor_On_01 in this
example), press Enter on your keyboard to assign that tag or program parameter to the
instruction:

© Rockwell Automation, Inc. All rights reserved. 9


Adding Bit-Level Ladder Diagram Elements Level 1: Logix - On Demand

In addition to the Look Ahead functionality, we may also browse for a tag or program
parameter.
18. Double-click the question mark over the third XIC and click the dropdown arrow:

The checkboxes allow us to narrow down our search by choosing to show controller tags, local
tags and program parameters, or both (default). The dropdown box at the bottom allows us to
display program parameters from other programs:

10 © Rockwell Automation, Inc. All rights reserved.


Level 1: Logix - On Demand Adding Bit-Level Ladder Diagram Elements

The filter box allows us to search on a portion of a tag or program parameter name:

19. Locate the Start_PB_01 program parameter, select it, and press Enter on your keyboard
twice to assign it to the instruction:

If multiple instructions in the same routine are to be assigned the same tag or program
parameter, we may drag and drop the tag or program parameter from one instruction to another.

© Rockwell Automation, Inc. All rights reserved. 11


Adding Bit-Level Ladder Diagram Elements Level 1: Logix - On Demand

20. Drag Motor_On_01 from the OTE instruction and drop it on the XIC located on the
Branch element:

21. Assign the Stop_PB_01 program parameter to the fourth XIC on the rung:

22. Hover your mouse over one of the tags in your logic editor and notice the tooltip that
appears, providing the details of the tag or program parameter:

12 © Rockwell Automation, Inc. All rights reserved.


Level 1: Logix - On Demand Adding Bit-Level Ladder Diagram Elements

In addition to assigning existing tags and program parameters to instructions, we may simply
enter the name of a tag or program parameter that we have not yet created, and then create it
directly from within the logic editor.
23. Double-click the question mark over the first XIC instruction, type ‘Machine_Interlocks’
(don’t forget to use an underscore rather than a space), and press Enter on your
keyboard:

24. Hover your mouse over Machine_Interlocks and read the tooltip:

Up until this point, our rung has been red, and there has been an X to the left of the rung,
indicating that the rung has one or more errors. If we do not know what the error is, we can
verify the routine and the Logix Designer application will tell us what the error is.
25. Click the Verify Routine button:

© Rockwell Automation, Inc. All rights reserved. 13


Adding Bit-Level Ladder Diagram Elements Level 1: Logix - On Demand

26. Notice the Errors window that appears, and the two errors:

27. In the logic editor, right-click Machine_Interlocks and select New


‘Machine_Interlocks’:

14 © Rockwell Automation, Inc. All rights reserved.


Level 1: Logix - On Demand Adding Bit-Level Ladder Diagram Elements

28. In the New Parameter or Tag window that appears:


a. In the Description, type ‘Supervisory Output’.
b. From the Usage dropdown, select Input Parameter.
c. Click the Create button:

28.a.
28.c.

28.b.

29. Enter ‘Machine_Permissives’ for the second XIC:

© Rockwell Automation, Inc. All rights reserved. 15


Adding Bit-Level Ladder Diagram Elements Level 1: Logix - On Demand

30. Right-click Machine_Permissives and select New ‘Machine_Permissives’:

16 © Rockwell Automation, Inc. All rights reserved.


Level 1: Logix - On Demand Adding Bit-Level Ladder Diagram Elements

31. In the New Parameter or Tag window that appears:


a. In the Description, type ‘Supervisory Output’.
b. From the Usage dropdown, select Input Parameter.
c. Click the Create button:

31.a.
31.c.

31.b.

32. Now that we have fixed all of the errors, notice that the rung is no longer red, and the X
has gone away:

© Rockwell Automation, Inc. All rights reserved. 17


Adding Bit-Level Ladder Diagram Elements Level 1: Logix - On Demand

The first rung of logic is complete. Now we need to add another rung to contain our motor off
logic. We may add a rung by right-clicking the rung above where we want the new rung and
selecting Add Rung, or by clicking the rung element in the Language Element toolbar.
33. Add rung 1 to your logic:

For more advanced users who have instruction abbreviations memorized, there is a quicker way
to add logic using ASCII.
34. Double-click in the blue area to the left of rung 1 and notice the ASCII box that appears:

18 © Rockwell Automation, Inc. All rights reserved.


Level 1: Logix - On Demand Adding Bit-Level Ladder Diagram Elements

35. In the ASCII text box, type ‘XIC’ and notice the tooltip that appears:

The tooltip is telling us that this instruction requires a Boolean operand (the
Motor_On_01 program parameter in this example).
36. Complete the rest of the logic in the ASCII text box as shown below and then press
Enter on your keyboard, or click the checkmark:

37. Verify that your logic appears as follows:

Looking back at our desired logic, we see that we actually need an XIO on rung one, rather than
an XIC. So, let’s see how to change an instruction.

© Rockwell Automation, Inc. All rights reserved. 19


Adding Bit-Level Ladder Diagram Elements Level 1: Logix - On Demand

38. Double-click the XIC instruction on rung 1:

39. Notice that you may type the abbreviation directly in the box, or you may click the
dropdown arrow to browse for the desired instruction:

40. Type XIO and press Enter on your keyboard:

20 © Rockwell Automation, Inc. All rights reserved.


Level 1: Logix - On Demand Adding Bit-Level Ladder Diagram Elements

41. Your logic should now appear as follows:

In addition to verifying the currently-open routine, we may also verify the entire project.
42. Click the Verify Controller button:

© Rockwell Automation, Inc. All rights reserved. 21


Adding Bit-Level Ladder Diagram Elements Level 1: Logix - On Demand

43. You should have no errors or warnings:

44. Save your project by clicking the save icon in the upper left corner of the project
window.

Our seal-in, motor control logic is now complete. At this point, because we have no errors, we
could download our project to the controller and test its logic by manually toggling the
instructions. This is one of the major benefits to using program parameters. Even though they
are not currently connected to anything, there are no errors and the logic may be tested.
Furthermore, we could make the connections with the project running in the controller without
having to stop the controller from running the logic. This capability is critical to certain customers
who are unable to shut down their process when making changes to the project.

22 © Rockwell Automation, Inc. All rights reserved.

You might also like