Getting Started with Connected Components Workbench™ In this getting started module, you will use Connected Components Workbench™ to create a Traffic Light project that includes a Micro830™ controller (2080-LC16QWB) and a 2080-MEMBAK-RTC plug-in module. In the Traffic Light project, using four inputs and six outputs, you will configure the Micro830 controller program to run during peak hours and cycle traffic lights through green, yellow, and red in the North-South and East-West directions. The inputs are based on car sensors placed in each of the four directions at an intersection. The traffic sequence begins when an automobile is waiting at a red light in either the North-South or East-West direction. Later, you will configure the Micro830 controller program to support off-peak hours (where the traffic lights will change to blink yellow in the North-South direction and blink red in the East-West direction). This Getting Started includes the following steps: Step

Task

1

Create a new Connected Components Workbench project

2

Add a controller plug-in module

3

Create a User-Defined Function Block (UDFB)

4

Create a new ladder program

5

Use Simulation mode to test the ladder program

6

Establish communications to the Micro830 controller

7

Download the project to the controller

8

Test the running program

9

Make runtime program changes

10

Connect to the existing controller

Note: If you have any questions while working with the Connected Components Workbench, you can press F1 to display the online help.

Rockwell Automation, Inc.

1

Hardware and Software Components: The following summarizes the hardware and software components used in this getting started module: Connected Components Workbench v1.00 Micro830 controller (2080-LC16QWB) 24-volt DC power supply (2080-PS120-240VAC or equivalent) Plug-in module (2080-MEMBAK-RTC) RSLinx Classic version 2.57 Standard (Type A to Type B) USB cable (3 meter maximum)

2

Connected Components Workbench 1 - Getting Started with Con-

Create a new Connected Components Workbench project Prerequisites: To begin this step, Connected Components Workbench must be is installed on your computer. Introduction: In this step, you will do the following: Open Connected Components Workbench Create a new Connected Components Workbench project Add a Micro830 controller to the project Name the Connected Components Workbench project for the traffic example

Rockwell Automation, Inc.

3

Step: 1.

From the Start menu, click Programs, then Rockwell Automation, then CCW, and then Connected Components Workbench. Connected Components Workbench is displayed in its default screen configuration, displaying the Project Organizer, Device Toolbox, and Properties windows.

Note: You can customize the layout of the Connected Components Workbench environment by clicking and dragging any window to an alternate location. You can also dock any window into another window that has tabs.

4

Connected Components Workbench 1 - Getting Started with Con-

2.

In the Device Toolbox, double-click the 2080-LC30-16QWB (Micro830 controller).

The selected Micro830 controller is displayed in the Project Organizer:

3.

In the Name field of the Project Organizer, rename the project by typing Traffic Light.

Rockwell Automation, Inc.

5

Result: You have created a new Connected Components Workbench project for your traffic light example, added a 2080-LC30-16QWB Micro830 controller to control the traffic operations, and named the project Traffic Light. Step 1 of the Connected Components Workbench Getting Started is complete. The following steps remain: Status

Step

Completed 1

Task Create a new Connected Components Workbench project

2

Add a controller plug-in module

3

Create a User-Defined Function Block (UDFB)

4

Create a new ladder program

5

Use Simulation mode to test the ladder program

6

Establish communications to the Micro830 controller

7

Download the project to the controller

8

Test the running program

9

Make runtime program changes

10

Connect to the existing controller

Add a controller plug-in module Prerequisites: A Connected Components Workbench project named Traffic Light that contains a 2080-LC30-16QWB Micro830 controller. Introduction: In this step, you will add a 2080-MEMBAK-RTC plug-in module to the Traffic Light project. Steps: 1.

In the Project Organizer, double-click the Micro830 controller. The following is displayed:

Rockwell Automation, Inc.

7

2.

In the Controller Tree, right-click 2080-MEMBAK-RTC plug-in module.

Plug-in

Modules

and

select

a

Note: You can also right-click an empty slot in the Controller Overview graphic, and then select a 2080-MEMBAK-RTC plug-in module.

8

Connected Components Workbench 1 - Getting Started with Con-

Note: The 2080-MEMBAK-RTC plug-in module can only be added to the first slot (slot 1). When complete, the graphic in the Controller Overview pane changes to reflect the newly added 2080-MEMBAK-RTC plug-in module and the Controller Configuration Properties pane displays the configuration options for the 2080-MEMBAK-RTC plug-in module.

Result: You have added a 2080-MEMBAK-RTC plug-in module to the Traffic Light project. Step 2 of the Connected Components Workbench Getting Started is complete. The following steps remain: Status

Step

Task

Completed 1

Create a new Connected Components Workbench project

Completed 2

Add a controller plug-in module

Rockwell Automation, Inc.

9

Status

10

Step

Task

3

Create a User-Defined Function Block (UDFB)

4

Create a new ladder program

5

Use Simulation mode to test the ladder program

6

Establish communications to the Micro830 controller

7

Download the project to the controller

8

Test the running program

9

Make runtime program changes

10

Connect to the existing controller

Connected Components Workbench 1 - Getting Started with Con-

Create a User-Defined Function Block (UDFB) Prerequisites: A Connected Components Workbench project named Traffic Light that contains a 2080-LC30-16QWB Micro830 controller and a 2080-MEMBAK-RTC plug-in module. Introduction: In this step, you will do the following: Create a user-defined function block Add a ladder diagram Add input and output variables Populate the ladder diagram Build and save the Traffic Light project Steps: 1.

In the Project Organizer, select Function Blocks, then Add, and then New LD : Ladder Diagram.

By default, the ladder diagram is named Untitled LD.

Rockwell Automation, Inc.

11

2.

Right-click UntitledLD, and select Rename.

3.

Name the ladder diagram TRAFFIC_CONTROLLER_FB, and then press Enter.

4.

Under TRAFFIC_CONTROLLER_FB, double-click Local Variables.

The Variable Editor is displayed.

12

Connected Components Workbench 1 - Getting Started with Con-

5.

In the Variable Editor, enter four Boolean inputs (for a car sensor in each of the four positions in the intersection) and six Boolean outputs (for red, yellow and green lights in each of the two directions). When complete, the Variable Editor is displayed as follows:

Note: To add columns in the Variable Editor, right-click the header row, select Show Column, and then select the column name. To move columns, click and hold a column header, and then drag it to an alternate location. Note: Inputs must have a Direction of VarInput and outputs must have a Direction of VarOutput.

Rockwell Automation, Inc.

13

6.

In the Project Organizer, double-click TRAFFIC_CONTROLLER_FB to begin editing the ladder logic program.

The Ladder Editor is displayed with an empty first rung:

14

Connected Components Workbench 1 - Getting Started with Con-

7.

For this example, the first rung must work as follows: If the North/South red lights and East/West green lights are on, and a car trips either the North Sensor or the South Sensor for at least five seconds, then change the East/West Lights from green to yellow. To begin the creation of your ladder program, click Toolbox, and then click the plus sign (+) in front of Ladder to list the available ladder elements.

Rockwell Automation, Inc.

15

8.

To implement the first part of our example, you must create two direct contacts in series (since the logic is North/South red lights and East/West green lights). To create the first direct contact, click and drag a Direct Contact element from the Toolbox to the first rung and release.

When you release the mouse, the Variable Selector is displayed.

16

Connected Components Workbench 1 - Getting Started with Con-

9.

In the Variable Selector, select the NS_RED_LIGHTS variable and click OK.

10. Repeat steps 8 and 9 to add a second direct contact and assign the EW_GREEN_LIGHTS variable to this contact. At this point, your first rung is displayed as follows:

Rockwell Automation, Inc.

17

11. To implement the second part of our example, you must create two direct contacts in parallel (since there is either an North Car Sensor or a South Car Sensor). From the Toolbox, click and drag a Branch to the end of the first rung and release.

12. From the Toolbox, click and drag a Direct Contact element to the upper branch and release. To this contact, assign the N_CAR_SENSOR variable. 13. From the Toolbox, click and drag a Direct Contact element to the lower branch and release. To this contact, assign the S_CAR_SENSOR variable. At this point, your first rung is displayed as follows:

14. Next, you must enter a five second time delay. From the Toolbox, click and drag a Block element to the right of the existing branch and release. The Instruction Block Selector is displayed.

18

Connected Components Workbench 1 - Getting Started with Con-

Note: From the Category column, you can select Time to display all of the time-based instruction blocks.

15. From the Name column, click TON for the On-delay timing instruction block and then click OK. Note: You can press F1 to display the context-sensitive online help that describes the instruction block inputs and outputs. 16. Click the top of the input block, type the programmed/preset time of T#5s (for a time format of 5 seconds), and then press Enter.

Now your first rung is displayed as follows:

Rockwell Automation, Inc.

19

17. To implement the final part of our example, you must create two coils in parallel (since you need to turn off the East/West green lights and turn on the East/West yellow lights). From the Toolbox, click and drag a Branch element to the end of the rung and release.

18. From the Toolbox, click and drag a Reset Coil element to the upper branch and release. Assign the EW_GREEN_LIGHTS variable to this coil (to turn off the East/West green lights). 19. From the Toolbox, click and drag a Set Coil element to the lower branch and release. Assign the EW_YELLOW_LIGHTS variable to this coil (to turn on the East/West yellow lights). Now your completed rung is displayed as follows:

20. Document the rung by double-clicking in the green block above the rung and entering the following rung comment: If the North/South red lights and East/West green lights are on and a car trips either the North sensor or the South sensor for at least five seconds, then change the East/West lights from green to yellow.

20

Connected Components Workbench 1 - Getting Started with Con-

21. For our example, the second rung must work as follows: If the East/West yellow lights are on for at least two seconds, then change the East/West Lights from yellow to red and the North/South Lights from red to green. Use steps 11 through 20 to enter the second rung so that it displays as follows:

22. The third and fourth rungs of our example have the same form as the first two rungs, so you can cut and paste the existing rungs, and then edit the variable assignments for each element. Select the rungs 1 and 2 by clicking the dark blue region to the left of rung 1, then hold the Shift key down and click the dark blue region to the left of rung 2. Right-click and select Copy.

23. Click rung 1, then right-click and select Paste. The two copied rungs are pasted before the existing two rungs.

Rockwell Automation, Inc.

21

24. Double-click the TON instruction block in rung 3. Within the Instruction Block Selector, change the Instance from TON_1 to TON_3, and then click OK.

25. Repeat step 24, but change the Instance of the TON instruction block in rung 4 from TON_2 to TON_4. 26. In rungs 3 and 4, change each EW variable to NS and each NS variable to EW, and then enter respective rung comments. The new rungs should be displayed as follows:

22

Connected Components Workbench 1 - Getting Started with Con-

27. To finish our example, you must add one more rung to handle initial conditions. When the program is first downloaded to the controller and run, none of the lights are initially turned on. This last rung will check for this condition (all lights off) and turn on the North/South red lights and the East/West green lights. From the Toolbox, click and drag a Rung element to the white space below rung 4 and release. 28. From the Toolbox, click and drag six Reverse Contacts onto the new rung and assign one …LIGHTS variable (see step 5) to each contact. When complete, the rung should display as follows:

Rockwell Automation, Inc.

23

29. From the Toolbox, add two Set Coils in parallel to turn on the NS_RED_LIGHTS and the EW_GREEN_LIGHTS variables. Additionally, complete rung 5 by documenting its operation in a rung comment. When complete, the rung should display as follows:

When complete, the entire program displays as follows:

30. From the Build menu, select Build Project. The Build operation is verified in the Output window.

24

Connected Components Workbench 1 - Getting Started with Con-

31. From the File menu, select Save to save your project. Your project is saved to the following location: C:\Documents and Settings\\My Documents\CCW\Traffic Light\Traffic Light.ccwsln Result: You have developed a user-defined function block using ladder programming and added variables for the inputs and outputs to control the lights in both North-South and East-West directions. Additionally, you have saved your project. Step 3 of the Connected Components Workbench Getting Started is complete. The following steps remain: Status

Step

Task

Completed 1

Create a new Connected Components Workbench project

Completed 2

Add a controller plug-in module

Completed 3

Create a User-Defined Function Block (UDFB)

4

Create a new ladder program

5

Use Simulation mode to test the ladder program

6

Establish communications to the Micro830 controller

7

Download the project to the controller

8

Test the running program

9

Make runtime program changes

10

Connect to the existing controller

Rockwell Automation, Inc.

25

Create a new ladder program Prerequisites: A Traffic Light project that TRAFFIC_CONTROLLER_FB.

includes

a

user-defined

function

block

named

Introduction: In this step, you will do the following: Create a ladder program Populate the ladder program with the user defined function block created in the previous step Assign input and output variables Build and save project Steps: 1.

In the Project Organizer, right-click Programs, select Add, and then select New LD : Ladder Diagram.

By default, the ladder diagram is named Untitled LD.

26

Connected Components Workbench 1 - Getting Started with Con-

2.

Right-click UntitledLD and select Rename.

3.

Type Traffic_Light_Control and press Enter.

4.

In the Project Organizer, double-click Traffic_Light_Control to start editing the ladder program.

Rockwell Automation, Inc.

27

5.

28

From the Toolbox tab, click the plus sign (+) in front of Ladder to list the available ladder elements.

Connected Components Workbench 1 - Getting Started with Con-

6.

From the Toolbox, click and drag a Block element onto the first rung.

When you release the mouse, the Instruction Block Selector is displayed:

Rockwell Automation, Inc.

29

7.

30

In the Name column, type tr. Only instruction blocks starting with tr are listed. Click TRAFFIC_CONTROLLER_FB and view all of the Parameters associated with this user-defined function block.

Connected Components Workbench 1 - Getting Started with Con-

8.

Select TRAFFIC_CONTROLLER_FB in the list and click OK. The Traffic Controller user-defined function block is displayed on rung 1:

Rockwell Automation, Inc.

31

Note: Instruction blocks display inputs on the left side of the block and outputs on the right side of the block. In order to see the full names and data types of the variables that are associated with these inputs and outputs, hover your cursor over the instruction block and a tooltip is displayed:

The first function block input that connects directly to the ladder rung is the function block enable (EN) bit. The remaining four function block inputs are “real world” inputs that indicate whether a car is waiting at a red light in any of the four possible directions – North, South, East and West. These inputs get mapped to four Boolean input variables that are local to the function block: N_CAR_SENSOR, S_CAR_SENSOR, E_CAR_SENSOR and W_CAR_SENSOR. You must assign four Micro830 controller inputs to these function block inputs.

32

Connected Components Workbench 1 - Getting Started with Con-

9.

Click the top of the input variable block that connects to N_CAR_SENSOR; a dropdown menu of all the existing variable names that can be assigned to N_CAR_SENSOR are displayed. Scroll down and select _IO_Embedded_Digital_Input_0, and then press Enter.

Note: To see the entire _IO_Embedded_Digital_Input_0 name, hover your cursor over the function block and a tooltip is displayed:

Rockwell Automation, Inc.

33

Note: An alternate method is to assign shorter Alias names to these variables. Double-click the first input block and the Variable Selector is displayed. In the Alias column, type in Alias names for the six outputs (DO0-DO5) and the first six inputs (DI0-DI5).

34

Connected Components Workbench 1 - Getting Started with Con-

10. Assign the remaining three input variable blocks as follows: Boolean input variables Variable name S_CAR_SENSOR E_CAR_SENSOR W_CAR_SENSOR

_IO_Embedded_Digital_Input_1 _IO_Embedded_Digital_Input_3 _IO_Embedded_Digital_Input_4

When complete, the instruction block is displayed as follows:

Rockwell Automation, Inc.

35

11. The first function block output that connects directly to the ladder rung is the function block output enabled (ENO) bit – it reflects the status of the input enable (EN) bit. The remaining six function block outputs are “real world” outputs that connect to the red, yellow and green traffic signal lights for each direction. Assign the first six Micro830 digital outputs as follows: Boolean output variables Variable name NS_RED_LIGHTS NS_YELLOW_LIGHTS NS_GREEN_LIGHTS EW_ RED_LIGHTS EW_ YELLOW_LIGHTS EW_ GREEN_LIGHTS

_IO_Embedded_Digital_Output_0 _IO_Embedded_Digital_Output_1 _IO_Embedded_Digital_Output_2 _IO_Embedded_Digital_Output_3 _IO_Embedded_Digital_Output_4 _IO_Embedded_Digital_Output_5

When complete, the instruction block is displayed as follows:

36

Connected Components Workbench 1 - Getting Started with Con-

12. Double-click on the green block just above the rung and type the following rung comment: This rung assigns function block.

the

Micro830

I/O

to

the

TRAFFIC_CONTROLLER

13. From the Build menu, select Build Project. The Build operation is verified in the Output window.

14. From the File menu, select Save to save your project. Result: You have developed a new ladder program named Traffic_Light_Control using the user-defined function block created in the previous step of the Getting Started. At this point, the ladder program can now control when the North-South traffic light is red or the North South sensor is tripped. When that occurs, the traffic light in the East - West direction changes to yellow after five seconds, and then to red in two more seconds. Step 4 of the Connected Components Workbench Getting Started is complete. The following steps remain: Status

Step

Task

Completed 1

Create a new Connected Components Workbench project

Completed 2

Add a controller plug-in module

Completed 3

Create a User-Defined Function Block (UDFB)

Completed 4

Create a new ladder program

5

Use Simulation mode to test the ladder program

Rockwell Automation, Inc.

37

Status

38

Step

Task

6

Establish communications to the Micro830 controller

7

Download the project to the controller

8

Test the running program

9

Make runtime program changes

10

Connect to the existing controller

Connected Components Workbench 1 - Getting Started with Con-

Use Simulation mode to test the ladder program Prerequisites: A Connected Components Workbench project named Traffic Light that contains a user-defined function block named TRAFFIC_CONTROLLER_FB (including defined variables) and a ladder program named Traffic_Light_Control that uses it. Introduction: In this step, you will debug the Traffic_Light_Control program using Simulation mode. The benefit of using Simulation mode is that can test the Traffic_Light_Control program without a Micro830 controller. This can save you alot of time because you can test your program at any time during the development phase. Steps: 1.

In the Project Organizer, double-click the Traffic_Light_Control program. The following is displayed:

Rockwell Automation, Inc.

39

2.

From the Connected Components Workbench toolbar, select Simulation.

3.

From the Project Organizer, right-click the Micro830 controller and select Build.

4.

From the File menu, select Save to save your project.

5.

From the Debug menu, click Start Debugging.

You will notice four task bar entries, including one for the I/O Panel Simulation Tool. You will use the I/O Panel Simulation Tool to simulate the change of state of any variable in the program.

40

Connected Components Workbench 1 - Getting Started with Con-

6.

From the task bar, click I/O Panel Simulation Tool. The I/O Panel Simulation Tool is displayed. On the left, you will see entries for each of your digital and analog I/O variables. For this example, double-click 1:digitIn_Base to display the digital inputs.

7.

Change the state of digital input 0 to TRUE. To change from FALSE to TRUE, double-click on the cell to the right of (000)%Embedded.Digital.Input.0.

Rockwell Automation, Inc.

41

8.

Monitor the values of digital outputs 2 and 3. A few seconds after changing the state of digital input 0, digital outputs 2 and 3 will go to TRUE in the ladder program.

9.

From the Debug menu, select Stop Debugging. This will stop Simulation mode and you can make modifications to your program again.

10. From the Connected Components Workbench toolbar, select Online.

42

Connected Components Workbench 1 - Getting Started with Con-

Result: You have tested the Traffic_Light_Control ladder program that you created in the previous step and verified proper operation of the program in Simulation mode. Step 5 of the Connected Components Workbench Getting Started is complete. The following steps remain: Status

Step

Task

Completed 1

Create a new Connected Components Workbench project

Completed 2

Add a controller plug-in module

Completed 3

Create a User-Defined Function Block (UDFB)

Completed 4

Create a new ladder program

Completed 5

Use Simulation mode to test the ladder program

6

Establish communications to the Micro830 controller

7

Download the project to the controller

8

Test the running program

9

Make runtime program changes

10

Connect to the existing controller

Rockwell Automation, Inc.

43

Establish communications to the Micro830 controller Prerequisites: A Connected Components Workbench project named Traffic Light that contains a user-defined function block named TRAFFIC_CONTROLLER_FB (including defined variables) and a ladder program named Traffic_Light_Control that uses it. Additionally, the Traffic_Light_Control ladder program has been verified in Simulation mode. Introduction: In this step, you will do the following to get RSLinx Classic communicating with your Micro830 controller using USB: Connect the USB cable from the Micro830 controller to your computer Add a USB driver in RSLinx Classic Verify communications between the Micro830 controller and your computer using RSWho Note: These steps assume that you have installed RSLinx Classic v2.57 or later on your computer. Steps: 1.

Power-up the Micro830 controller.

2.

Plug the USB cable directly between your computer and the Micro830 controller.

44

Connected Components Workbench 1 - Getting Started with Con-

3.

Microsoft Windows discovers the Micro830 controller automatically and the Found New Hardware Wizard is displayed.

Select No, not this time, and then click Next.

Rockwell Automation, Inc.

45

4.

On the next screen of the Found New Hardware Wizard, select Install the software automatically (Recommended) and click Next.

The Found New Hardware Wizard searches for the Rockwell Automation USB CIP driver.

46

Connected Components Workbench 1 - Getting Started with Con-

5.

Once the Rockwell Automation USB CIP driver has been found, the appropriate driver software is automatically installed to your computer. Click Finish.

6.

Launch RSLinx Classic and click the

icon to launch RSWho.

The Micro830 controller is automatically displayed under the USB driver.

Result: The Rockwell USB CIP communication driver is installed to your computer and RSLinx Classic is properly configured to communicate with your Micro830 controller through a USB cable.

Rockwell Automation, Inc.

47

Step 6 of the Connected Components Workbench Getting Started is complete. The following steps remain: Status

Step

Task

Completed 1

Create a new Connected Components Workbench project

Completed 2

Add a controller plug-in module

Completed 3

Create a User-Defined Function Block (UDFB)

Completed 4

Create a new ladder program

Completed 5

Use Simulation mode to test the ladder program

Completed 6

Establish communications to the Micro830 controller

48

7

Download the project to the controller

8

Test the running program

9

Make runtime program changes

10

Connect to the existing controller

Connected Components Workbench 1 - Getting Started with Con-

Download the project to the controller Prerequisites: You have successfully connected to, and communicated with, the Micro830 controller using RSLinx Classic. Introduction: In this step, you will do the following: Connect to the Micro830 controller Download the Traffic Light project to the Micro830 controller Change the controller to Remote Run mode Steps: 1.

In Controller Details, click Connect.

2.

In the Project Organizer, right-click the Micro830 controller and then select Build.

Rockwell Automation, Inc.

49

3.

In the Output window, verify that the build has completed successfully.

Note: If you have errors, you must return to your ladder program and fix the errors before you can complete the download.

4.

From the File menu, select Save to save your project.

5.

In the Project Organizer, right-click the Micro830 controller and select Download.

6.

If your controller is in Remote Run mode, the following message is displayed:

Click Yes to continue.

50

Connected Components Workbench 1 - Getting Started with Con-

7.

After the download is complete, the following message is displayed asking if you want to change the Micro800 controller to Run mode:

Click Yes to begin running your program. Note: If you want to make further modifications to your ladder program, click No. Result: The Traffic Light project is running in the Micro830 controller. Step 7 of the Connected Components Workbench Getting Started is complete. The following steps remain: Status

Step

Task

Completed 1

Create a new Connected Components Workbench project

Completed 2

Add a controller plug-in module

Completed 3

Create a User-Defined Function Block (UDFB)

Completed 4

Create a new ladder program

Completed 5

Use Simulation mode to test the ladder program

Completed 6

Establish communications to the Micro830 controller

Completed 7

Download the project to the controller

8

Test the running program

9

Make runtime program changes

10

Connect to the existing controller

Rockwell Automation, Inc.

51

Test the running program Prerequisites: The Traffic Light project has been successfully downloaded to, and is running on, the Micro830 controller. Introduction: In this step, you will do the following in the running Traffic_Light_Control program: Debug and monitor the program in the Micro830 controller Force inputs Monitor outputs Note: In an earlier step, you monitored inputs and outputs in Simulation mode. In this step, you will monitor inputs and outputs on the actual controller. Steps: 1.

Confirm that you are in Run mode. In the Remote Run field of the Controller Details Header, verify that Run is selected.

2.

From the Debug menu, select Start Debugging.

52

Connected Components Workbench 1 - Getting Started with Con-

In the ladder editor, the running Traffic_Light_Control program is displayed:

3.

In the Project Organizer, double-click Global Variables. The Variable Selector is displayed:

Rockwell Automation, Inc.

53

4.

54

Left-click the variable you want to force (for example, _IO_Embedded_Digital_Input_0). Then, in the Lock column, select the checkbox to lock _IO_Embedded_Digital_Input_0.

Connected Components Workbench 1 - Getting Started with Con-

5.

In the Logical Value column, select the checkbox.

On your Micro830 controller, the output LEDs change state. In the ladder editor, the outputs change state in the Logical Value and Physical Value columns.

6.

To stop forcing the variable, clear the checkbox in the Logical Value column.

Note: To allow the program or external sources to change the value, you must clear the checkbox in the Lock column.

Rockwell Automation, Inc.

55

7.

From the Debug menu, click Stop Debugging.

Result: The Traffic_Light_Control ladder program has been tested and is working correctly. Step 8 of the Connected Components Workbench Getting Started is complete. The following steps remain: Status

Step

Task

Completed 1

Create a new Connected Components Workbench project

Completed 2

Add a controller plug-in module

Completed 3

Create a User-Defined Function Block (UDFB)

Completed 4

Create a new ladder program

Completed 5

Use Simulation mode to test the ladder program

Completed 6

Establish communications to the Micro830 controller

Completed 7

Download the project to the controller

Completed 8

Test the running program

56

9

Make runtime program changes

10

Connect to the existing controller

Connected Components Workbench 1 - Getting Started with Con-

Make runtime program changes Prerequisites: The current single rung Traffic_Light_Control program is loaded and running in the Micro830 controller. Additionally, the Traffic_Light_Control program has been tested and is working correctly. Introduction: In this step, you will do the following: Make program modifications that will flash the traffic lights between 11PM and 5AM every day (for example, the North/South lights will flash red and the East/West lights will flash yellow) Download these modifications as Run-time Downloads (meaning the controller remains in Run mode throughout the process) Verify that the Traffic_Light_Control project is working as expected

Rockwell Automation, Inc.

57

Steps: 1.

From the Project Organizer, select the Traffic_Light_Control program. The following is displayed:

58

Connected Components Workbench 1 - Getting Started with Con-

2.

From the Toolbox, click and drag a Block onto the rung between the left-hand rail and the TRAFFIC_CONTROLLER_FB instruction block, and release.

The Instruction Block Selector appears.

Rockwell Automation, Inc.

59

3.

From the Instruction Block Selector, select the Time of Week (TOW) instruction block and then click OK.

4.

Create a local variable for TimeA, a local variable that will disable TimeB, TimeC and TimeD, and a TOW is enabled local variable. In the Project Organizer, under Traffic_Light_Control, click Local Variables.

The Variable Editor appears. 5.

60

In the Variable Editor, create a new variable named Off_Peak_Hours of the type TOWDATA.

Connected Components Workbench 1 - Getting Started with Con-

6.

Expand the Off_Peak_Hours variable and enter in the Initial Values shown to start peak hours at 11PM and end off-peak hours at 5AM every day.

7.

In the Variable Editor, create another new variable named Disabled of the type TOWDATA, expand it, and select FALSE for the Disabled.Enable parameter.

8.

In the Variable Editor, create a new variable named Off_Peak_Enabled of the type BOOL.

Rockwell Automation, Inc.

61

9.

In the Project Organizer, go to the Traffic_Light_Control ladder program and assign the following: Parameter Variable name TimeA TimeB TimeC TimeD TOW

Off_Peak_Hours Disabled Disabled Disabled Off_Peak_Enabled

When complete, the Traffic_Light_Control ladder program is displayed as follows:

10. From the Toolbox, drag a Reverse Contact onto the rung following the TOW instruction and assign local variable Off_Peak_Enabled to it.

62

Connected Components Workbench 1 - Getting Started with Con-

Note: This will prevent the rest of this rung from executing whenever Off_Peak_Enabled is TRUE (which is between the hours of 11PM and 5AM).

11. From the Toolbox, drag a Return to the end of the rung so that whenever the TRAFFIC_CONTROLLER_FB function block is enabled, no other rungs in this program get executed. When complete, your first rung is displayed as follows:

Rockwell Automation, Inc.

63

12. Add a rung that will flash the traffic lights during off peak hours (when Off_Peak_Enabled is TRUE). From the Toolbox, click and drag a Rung beneath rung 1, and then release..

13. Add a one-second on/one-second off timer to control the flashing of the red lights in the North/South direction and the yellow lights in the East/West direction. From the Toolbox, click and drag a Block to the new rung, and then release. The Instruction Block Selector is displayed. 14. From the Instruction Block Selector, select a TONOFF instruction block, and then click OK.

The second rung is displayed as follows:

As long as the Input (IN) to the TONOFF instruction block is true, then the Elapsed Time (ET) begins timing until the Elapsed Time equals the Preset Time (PT) and the Output (Q) becomes true. When the IN goes false, the ET resets and begins timing until the ET equals the Preset Time Off (PTOF), at which time Q becomes false.

64

Connected Components Workbench 1 - Getting Started with Con-

Note: The caution triangles icon next to PT and PTOF indicate that either a variable name or a constant value must be entered into these input blocks. Note: You can press F1 to display the context-sensitive online help that describes the instruction block inputs and outputs. 15. Since you want this timer to be a one-second on/one-second off timer, click the top of the PT input block and type T#1s (where T# means this is a Time constant and 1s indicates one second).

16. Repeat step 15 for the PTOF input block. 17. When the on-timer has timed out and the output Q becomes true, you want the NS_RED_LIGHTS (DO0) and EW_YELLOW_LIGHTS (DO4) outputs to turn on. Since both outputs will be controlled by output Q, you must add a parallel branch on the rung. To add a parallel branch, from the Toolbox, drag a Branch onto the rung (just right of the TONOFF instruction block).

Rockwell Automation, Inc.

65

18. From the Toolbox, drag a Direct Coil to the upper branch and assign variable _IO_Embedded_Digital_Output_0 to it. Then, drag a second Direct Coil to the lower branch and assign variable _IO_Embedded_Digital_Output_4 to it. When complete, the rung should be displayed as follows:

19. In order to trigger the off timer, the IN bit needs to turn off when the Q bit turns on. From the Toolbox, drag a Reverse Contact to the left of the TONOFF block. The Variable Selector appears. 20. In the Variable Selector, click the Local Variables – Traffic_Light_Control tab. The following is displayed:

66

Connected Components Workbench 1 - Getting Started with Con-

21. Click the plus (+) sign to the left of TONOFF_1 instruction block to expand its variables. Select TONOFF_1.Q and click OK.

22. To document the rung, double-click in the green block above the rung and type the following rung comment: When the TRAFFIC_CONTROLLER function block is disabled, this rung flashes the North/South red lights and the East/West yellow lights – 1 second on and 1 second off.

When complete, rung 2 should be displayed as follows:

Rockwell Automation, Inc.

67

23. To make sure the other four lights (controlled by DO1, DO2, DO3 and DO5) are turned off, repeat steps 12 through 22 to add a third rung. When complete, rung 3 should be displayed as follows:

24. In the Project Organizer, right-click the Micro830 controller and then click Build. 25. From the File menu, select Save to save your project. 26. In the Project Organizer, right-click the Micro830 controller again and then click Run-time Download.

27. In the Output window, verify that the Run-time Download completed successfully.

68

Connected Components Workbench 1 - Getting Started with Con-

Note: You can test the program by changing the time of the 2080-MEMBAK-RTC plug-in module to10:59PM and verifying that embedded outputs 0 and 4 flash on and off starting one minute later. Note: When testing is complete, synchronize the 2080-MEMBAK-RTC plug-in module with the clock on the computer. 28. From the File menu, click Exit to close Connected Components Workbench. Result: Without placing the Micro830 controller in Program mode, you confirm that the traffic lights change as expected to support non-peak hours in the example. Step 9 of the Connected Components Workbench Getting Started is complete. The following step remains: Status

Step

Task

Completed 1

Create a new Connected Components Workbench project

Completed 2

Add a controller plug-in module

Completed 3

Create a User-Defined Function Block (UDFB)

Completed 4

Create a new ladder program

Completed 5

Use Simulation mode to test the ladder program

Completed 6

Establish communications to the Micro830 controller

Completed 7

Download the project to the controller

Completed 8

Test the running program

Completed 9

Make runtime program changes

10

Connect to the existing controller

Rockwell Automation, Inc.

69

Connect to the existing controller Prerequisites: The saved Traffic Light project from the previous step that has been downloaded to the Micro830 controller. Introduction: In this step, you will verify that the Traffic_Light_Control program running on the Mico830 controller is the program that you created in this Getting Started. Steps: 1.

Open Connected Components Workbench.

2.

From the Device Toolbox, click the plus sign (+) next to Discover.

70

Connected Components Workbench 1 - Getting Started with Con-

3.

Click Browse Connections.

The Connection Browser is displayed with the 2080-LC30-16QWB selected:

Rockwell Automation, Inc.

71

4.

In the Connection Browser, click OK. The Project Organizer is updated to reflect the Traffic Control project.

5.

In the Project Organizer, right-click the Micro830 controller and select Upload.

72

Connected Components Workbench 1 - Getting Started with Con-

Note: If the following popup appears, click Yes.

6.

In the Output window, verify that the upload operation completed without any errors.

7.

In the Controller Details Header, verify that you are connected to the 2080-LC30-16QWB controller.

8.

In the Project Organizer, double-click the Traffic Control program. The program code matches the work that you downloaded to the Micro830 controller in the previous step of the Getting Started.

Result: The Traffic Light project in the online Micro830 controller matches the offline Traffic Light project that you created earlier. You have completed the Connected Components Workbench Getting Started! Status

Step

Task

Completed 1

Create a new Connected Components Workbench project

Completed 2

Add a controller plug-in module

Completed 3

Create a User-Defined Function Block (UDFB)

Completed 4

Create a new ladder program

Completed 5

Use Simulation mode to test the ladder program

Completed 6

Establish communications to the Micro830 controller

Rockwell Automation, Inc.

73

Status

Step

Task

Completed 7

Download the project to the controller

Completed 8

Test the running program

Completed 9

Make runtime program changes

Completed 10

Connect to the existing controller

74

Connected Components Workbench 1 - Getting Started with Con-

Rockwell Automation, Inc.

75

76

Connected Components Workbench 1 - Getting Started with Con-