Professional Documents
Culture Documents
L1LODL16 CreateRoutine Labs
L1LODL16 CreateRoutine Labs
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 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 Creating Routines
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_Lab16.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.
Create Routines
We currently have logic for the control of a conveyor in the main routine of a program that will
control a packaging line. We know that we will require a similar routine for the second line
conveyor. Furthermore, we would like to include a routine that monitors and reports status.
Thus, we need to create several subroutines and a main routine from wherein we will call the
subroutines. In this section of the lab, you will create routines to meet these 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_Lab16.ACD file.
We currently have all of our Conveyor 1 control logic programmed into the main routine of the
program. So, let’s begin by renaming this routine to reflect its function, and then we can remove
it from the program’s main routine assignment.
3. Within the MainProgram of the MainTask, right-click the MainRoutine and select
Properties:
6. Go to the Configuration tab, set the Main assignment to <none>, and click the OK
button:
Now that we have changed our conveyor control routine into a subroutine, let’s create a
new program main routine.
8. Name the routine ‘Dispatch’ and then verify that is in the Ladder Diagram language, it is
scheduled within the MainProgram, and it has the Main Assignment before clicking the
OK button:
10. Name the routine ‘Status’ and then verify that is in the Ladder Diagram language and it
is scheduled within the MainProgram before clicking the OK button:
Since our conveyor control logic is now within a subroutine, and our new Status routine
is also a subroutine, we need to direct the processor to scan them from within the main
routine. Otherwise, they will not run.
13. In the dropdown for the Jump to Subroutine (JSR) instruction, select the Conveyor_01
routine:
14. Right-click rung 0, select Copy, and then right-click rung 0 again and select Paste:
15. In the dropdown for the JSR on rung 1, select the Status routine:
Because these rungs are unconditional, the processor will scan the Conveyor_01 routine
and then the Status routine every time it comes around to scanning these rungs of code.
16. Close the Dispatch routine.