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

Micro800™ controller programming basics lab

Hands-on ladder logic programming of the


Micro800 Simulator using Connected Components
Workbench™ software – Developer Edition

c
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.
Micro800™ controller programming basics lab - Hands-on ladder logic
programming of the Micro800 Simulator using Connected Components
Workbench™ software – Developer Edition

Contents
Before you begin ........................................................................................................................................... 4
About this lab .................................................................................................................................................................................... 4
Tools & prerequisites ........................................................................................................................................................................ 4

Exercise 1 - Create a Connected Components Workbench project and add a Micro850 Simulator ............ 5

Exercise 2 - Create a ladder program configured for Logix theme and add traffic control ladder logic........ 8

Exercise 3 - Create a Spy List for viewing the status of the traffic lights .................................................... 23

Exercise 4 - Power up the Micro800 Simulator and download your project to it. ....................................... 26

Exercise 5 - Test project by enabling car sensor inputs via the Micro800 Simulator graphic display. ....... 30

Exercise 6 - Test project using virtual wiring to automate traffic control sequencing. ................................ 35

3 of 40
Before you begin

About this lab


This lab will guide you in using Connected Components Workbench software to program a Micro800 Simulator to control a traffic
light at a 4-way intersection, shown below.

Inputs to the Micro800 Simulator are the four car sensors embedded in the road for each direction:
 N_Car_Sensor (_IO_EM_DI_00)
 S_Car_Sensor (_IO_EM_DI_01)
 E_Car_Sensor (_IO_EM_DI_02)
 W_Car_Sensor (_IO_EM_DI_03)
Outputs from the Micro800 Simulator control the red, yellow and green lights in the North/South and East/West directions:
 NS_Red_Lights (_IO_EM_DO_00)
 NS_Yellow_Lights (_IO_EM_DO_01)
 NS_Green_Lights (_IO_EM_DO_02)
 EW_Red_Lights (_IO_EM_DO_03)
 EW_Yellow_Lights (_IO_EM_DO_04)
 EW_Green_Lights (_IO_EM_DO_05)

Tools & prerequisites


 Software: Connected Components Workbench software Version 12.00 – Developer Edition.

4 of 40
Exercise 1 - Create a Connected Components Workbench project and add a Micro850 Simulator

In this exercise, you will create a new Connected Components Workbench project and learn how to:
 Add a Micro850 Simulator to your project by selecting a new device from the ‘Catalog’.

5 of 40
1. Start the Connected Components Workbench software by double-clicking the icon on the desktop.

2. Add a Micro850 Simulator to your project.

Click New… from the Start Page. Accept the New Project defaults by clicking Create. Expand the Controllers
folder under Catalog. Expand the Micro850 folder, click catalog number 2080-LC50-48QWB-SIM, click Select
then click Add To Project. This will add a Micro850 Simulator to your project.

6 of 40
3. Notice that the Micro850 Simulator shows up both in the Project Organizer on the left-hand side navigation and
as a large graphic in the middle.

7 of 40
Exercise 2 - Create a ladder program configured for Logix theme and add traffic control ladder
logic.

In this exercise, you will learn how to:


 Add and rename a ladder diagram program.
 Configure the ladder logic theme for Logix controller.
 Add five rungs of traffic control ladder logic.

8 of 40
4. Add a ladder diagram program.

Right-click Programs under the Micro850 Simulator in your Project Organizer and select Add  New LD:
Ladder Diagram.

5. Notice a new ladder diagram program called Prog1 has been added under Programs.

Micro800 controllers allow you to create multiple programs and use multiple types of programs
(such as structured text or function block diagram) in the same controller application.

Since we are creating a program that does traffic control, let’s rename it Traffic_Control.

9 of 40
6. Right-click the Prog1 program icon and select Rename.

7. Rename the program Traffic_Control.

10 of 40
8. Double-click Global Variables to bring up the Micro850-VAR global variable list. Embedded input/output (I/O)
variable names start with ‘_IO_EM_’, followed by DI for digital input or DO for digital output, concluding with the
input or output point number that starts with 0. Enter in the Alias names for the outputs and inputs that you will
be using in your program as shown below.

11 of 40
9. Double-click the Traffic_Control program icon. A ladder diagram editor will appear in the main project
workspace with one empty rung. Connected Components Workbench software Version 12 adds the ability to
change the ladder editor theme between Default and Logix. Select Logix from the Theme pull-down as shown
below. The Logix theme uses instruction symbols and terminology that will be more familiar to users of RSLogix
500® and Studio 5000 Logix Designer® programming software. Another new feature for Version 12 is a tabbed
Instruction Library toolbar, which should also look familiar to Logix users.

10. Your first rung of ladder logic will control the changing of the East/West lights from green to yellow with the
following logic:

If the NS_Red_Lights and the EW_Green_Lights are on AND either the N_Car_Sensor OR the
S_Car_Sensor are on, then start a five second time delay. When the time delay is complete, turn off the
EW_Green_Lights and turn on the EW_Yellow_Lights.

11. When you hover your mouse over a symbol in the Instruction Library, the tooltip shows you the name of the
symbol.

12 of 40
12. Click-and-drag a Direct Contact/Examine If Closed symbol down onto the empty rung 1 as shown below.
Release the mouse button once the mouse pointer is hovering over the ‘+’ at the beginning of the rung.

13 of 40
13. The Variable Selector window then opens automatically. In this window, select the I/O – Micro850 tab.

14 of 40
14. Select digital output 0 (NS_Red_Lights) and click OK to assign this output to the direct contact.

15. Your rung should look like the following. This rung is TRUE when this direct contact is TRUE, which is when the
NS_Red_Lights output is on.

15 of 40
16. Drag-and-drop another Direct Contact/XIC to the right of the first one. From the I/O – Micro850 tab, select
digital output 5 (EW_Green_Lights) and click OK. Your rung should look like the following. This rung is TRUE
when the NS_Red_Lights output is on AND the EW_Green_Lights output is on.

17. Drag-and-drop another Direct Contact/XIC to the right of the second one. From the I/O – Micro850 tab, scroll
down and select digital input 0 (N_Car_Sensor) and click OK. Your rung should look like the following.

18. Locate the Branch symbol and drag-and-drop it as shown so that it goes below the third Direct Contact.

16 of 40
19. Drag-and-drop a Direct Contact/XIC onto the branch that you just added. From the I/O – Micro850 tab, select
digital input 1 (S_Car_Sensor) and click OK. Your rung should look like the following. This rung is TRUE when
the NS_Red_Lights output is on AND the EW_Green_Lights output is on AND either the N_Car_Sensor input
OR the S_Car_Sensor input is on.

20. Click the Timer/Counter instruction folder and drag-and-drop a TON instruction to the right of the branch.

21. To make this a five second delay timer, enter ‘T#5s’ (‘T#’ for timer data type and ‘5s’ for five seconds) into the
upper half of the gray box to the left of PT (Programmed Time).

17 of 40
22. Your rung should look like the following. This rung is TRUE when the NS_Red_Lights output is on AND the
EW_Green_Lights output is on AND either the N_Car_Sensor input OR the S_Car_Sensor input is on AND
timer TON_1 has timed out after five seconds.

23. Click the Favorites instruction folder and drag-and-drop a Reset Coil/OTU symbol to the right of the TON Q
output. From the I/O – Micro850 tab, select digital output 5 (EW_Green_Lights) and click OK. Your rung should
look like the following.

24. Drag-and-drop a Branch on top of the Reset/Unlatch Coil you just added, then drag-and-drop a Set Coil/OTL
onto the branch that you just added. From the I/O – Micro850 tab, select output 4 (EW_Yellow_Lights) and
click OK. Your first rung is now programmed and should look like the following. When the rung conditions are
TRUE, the EW_Green_Lights output will be reset (turned off) and the EW_Yellow_Lights output will be set
(turned on).

25. It is always a good programming practice to document your work so that somebody else looking at it can
understand what you did (or at least intended to do). Double-click the box above the ladder rung and type in “If
the North/South red lights and East/West green lights are on and a car trips either the North or South car sensor,
start a five second time delay. When the time delay is complete, switch the East/West lights from green to
yellow.”

26. Your first rung is now complete and should look like the following.

18 of 40
27. To add a second rung, click the Rung symbol.

28. Your second rung of ladder logic will control the changing of the East/West lights from yellow to red and the
North/South lights from red to green with the following logic:

If the EW_Yellow_Lights are on, start a two second time delay. When the time delay is complete, turn off the
EW_Yellow_Lights and the NS_Red_Lights and turn on the EW_Red_Lights and the NS_Green_Lights.

29. Try to program this rung based on the description above without looking at the solution below. When you are
done, it should look like the following.

19 of 40
30. The ladder logic that we need to trip and change the East/West lights from red to green will be the same ladder
logic that we used for the North/South lights – only the input or output assignments on the contacts and coils
need to be changed. Therefore, we start by copying rungs 1 and 2, and pasting them to create rungs 3 and 4.
While holding the Shift key down, click the leftmost side of rung 1 and then rung 2 to select both. Then press
Ctrl+C to copy and Ctrl+V to paste. You should now have four rungs of ladder logic as shown below:

20 of 40
31. Now you need to modify the input/output assignments. On rung 3, click the _IO_EM_DO_00 above the first
direct contact, then select EW_Red_Lights (_IO_EM_DO_03) from the pull-down menu.

32. Similarly, for the rest of the contacts and coils in rungs 3 and 4, change the EW_*_Lights assignments to
NS_*_Lights, the NS_*_Lights assignments to EW_*_Lights, the N_Car_Sensor to E_Car_Sensor and the
S_Car_Sensor to W_Car_Sensor. Remember to correct the rung descriptions to match your changes. Rungs 3
and 4 should look like the following.

33. We need to program one more rung that will configure the initial conditions when the ladder logic is run. If all
lights are off to begin with (their default state), none of the rungs will ever be true and the logic will be useless.
To help prevent this, you will program the North/South lights to be red initially while the East/West lights will be
green at the start.

21 of 40
34. Add a new Rung. Since you only want this rung to be true when the program is first run (or scanned), drag-and-
drop a Direct Contact/XIC onto the rung. In the Variable Selector window, click the System Variables –
Micro850 tab, select the __SYSVA_FIRST_SCAN variable (which is only on or true during the first scan) and
click OK.

35. Next, add two Set Coils/OTLs; one on a branch beneath the other, with output assignments NS_Red_Lights
and EW_Green_Lights. Document the rung with “Begin with the North/South red lights on and the East/West
green lights on.” Your final rung should look like the following.

22 of 40
Exercise 3 - Create a Spy List for viewing the status of the traffic lights

In this exercise, you will learn how to:


 Create a data monitor “Spy List” for viewing the six traffic light outputs and the four car sensor inputs.

23 of 40
36. Double-click Global Variables.

37. From the Device menu, select Spy Lists  Create Spy List.

You must be using the Developer Edition of Connected Components Workbench software in order to create
Spy Lists.

24 of 40
38. Enter in Traffic Light Status for the Name.

39. Position the Spy List over the Global Variables. Select the _IO_EM_DO_00 (NS_Red_Lights) variable, then
click-and-drag and release onto the Spy List so that the variable now appears in the Spy List as shown.

40. Repeat for the remaining _Light and _Sensor variables. Adjust the width of the Name and Alias columns in the
Spy List so that all text is displayed. Your Spy List should look like the following.

41. Close the Spy List.

25 of 40
Exercise 4 - Power up the Micro800 Simulator and download your project to it.

In this exercise, you will learn how to:


 Power up the Micro800 Simulator.
 Download your project to the Micro800 Simulator.

26 of 40
42. The Micro800 Simulator must be started up before the project can be downloaded to it. Click the Start Micro800
Simulator icon.

43. Make sure the loopback IP Address 127.0.0.1 is selected, then click the Power on icon.

27 of 40
44. Click the Micro850 tab and download the project to your Micro800 Simulator by clicking the Download icon.

45. Browse to the Micro800 Simulator and click OK.

28 of 40
46. Click Download and Yes to change the controller to Remote Run to execute the project.

47. Next, take note of the warning display. As we are running the Micro800 Simulator within the Developer Edition of
Connected Components Workbench software, the maximum Simulator runtime is 24 hours. For the free
Standard Edition of Connected Components Workbench software, the maximum Simulator runtime is 10
minutes. Click OK.

29 of 40
Exercise 5 - Test project by enabling car sensor inputs via the Micro800 Simulator graphic display.

In this exercise, you will learn how to:


 Use the Micro800 Simulator graphic to change the inputs.
 Monitor the outputs using the previously created Spy List.

30 of 40
48. Once the project is Connected and online with the Micro800 Simulator, open the Spy List named Traffic Light
Status that you created previously.

49. Click the Micro800 Simulator icon in the taskbar at the bottom of the screen to maximize the Simulator, then
position it so that it can be viewed together with the Spy List.

31 of 40
50. Initially, digital outputs 00 and 05 are on (amber colored), which control the North/South red lights and the
East/West green lights (so traffic can currently flow in the East/West directions). In the Traffic Light Status Spy
List, this is indicated by check marks in the Logical Value column.

32 of 40
51. Click digital input 00 to turn it on (indicating that a car is now waiting at the North red light). After five seconds,
the EW_Green_Lights turn off and the EW_Yellow_Lights turn on. Two seconds later, the EW_Yellow_Lights
turn off, the EW_Red_Lights turn on, the NS_Red_Lights turn off and the NS_Green_Lights turn on. Now
traffic can flow in the North/South directions.

33 of 40
52. Click digital input 00 again to turn it off and click digital input 03 to turn it on (indicating that a car is now waiting
at the West red light) and watch the light pattern similarly return to NS_Red_Lights on and EW_Green_Lights
off.

53. Click digital input 03 again to turn it off.

54. Click the Exit Micro800 Simulator icon.

34 of 40
Exercise 6 - Test project using virtual wiring to automate traffic control sequencing.

In this exercise, you will learn how to:


 Use virtual wiring to automate the traffic control sequencing.

35 of 40
55. Click the Start Micro800 Simulator icon.

56. The test objective is to have a North car appear (_IO_EM_DI_00 turns on) ten seconds after the North/South
lights turn red (_IO_EM_DO_00 turns on) and to disappear once the North/South lights are no longer red
(_IO_EM_DO_00 turns off). Similarly, a West car should appear (_IO_EM_DI_03 turns on) ten seconds after the
East/West lights turn red (_IO_EM_DO_03 turns on) and to disappear once the East/West lights are no longer
red (_IO_EM_DO_03 turns off). This is easy to accomplish with no additional programming using the virtual
wiring!

57. Click the Configure I/O Wiring icon.

36 of 40
58. Click Add. A default Output/Input pair is added, which happens to be just what we wanted.

59. Enter 10000 milliseconds of Output to Input Delay.

37 of 40
60. Click Add. Use the pull-down menus to select _IO_EM_DO_03 for the Output and _IO_EM_DI_03 for the Input,
enter a Delay of 10000 milliseconds and click OK.

61. If you scroll over the markers on any of the configured inputs and outputs, the virtual wire connecting them
together will appear. Click the Power on icon.

38 of 40
62. Reconnect to the Micro800 Simulator in Connected Components Workbench software and use the Traffic Light
Status Spy List to monitor the automated simulation. Because of the 10 second delay we configured between
Outputs and Inputs, the cars don’t disappear until ten seconds after the light has changed from red to green,
which isn’t exactly what we wanted, but it doesn’t affect the overall traffic light sequencing simulation.

63. When you have finished testing, close the Spy List and click the Exit Micro800 Simulator icon.

64. Congratulations on completing the lab! You may now shut down the RAcbi image.

39 of 40
Allen-Bradley, Connected Components Workbench, Micro800, Micro850, PanelView, Rockwell Automation, Rockwell Software, RSLogix 500, Studio 5000 Logix Designer and TechConnect are trademarks of
Rockwell Automation, Inc.
Trademarks not belonging to Rockwell Automation are property of their respective companies.

Copyright© 2019 Rockwell Automation, Inc. All Rights Reserved.

40 of 40

You might also like