The text of a manual · part 9 of 12
ControlLogix DeviceNet Interface Module 1756-DNB User Manual: 6 - The Example Application Program
Pages 67 to 80 of 96, from ControlLogix DeviceNet Interface Module 1756-DNB User Manual
The original document is the PDF (1.7 MB). This is its text as extracted, unedited; tables and drawings read best in the PDF, and each page heading opens it at that page.
For the Allen-Bradley 1756-DNB
Page 67
Chapter
6
The Example Application Program
What This Chapter Contains This chapter describes the procedure to create, download, and run an example ladder logic program to test the DeviceNet network. When the program is running, pressing the START button on the RediSTATION will cause the red indicator light to come on and stay on until the STOP button is pressed. Passing an object in front of the photoeye will increment a counter.
Remember that you cannot directly communicate with the controller over a DeviceNet network. You must download and run the program by connecting to the controller’s RS232 port or via another network. This chapter provides examples of downloading and running the program over ControlNet, Ethernet, and Data Highway Plus networks. For these examples we set up a 7-slot ControlLogix chassis with the following modules: Slot 0
1756-L1, Logix5550 controller
Slot 1
1756-DNB, DeviceNet interface module
Slot 2
1756-DHRIO, Data Highway Plus interface module
Slot 3
1756-CNB, ControlNet interface module
Slot 4
1756-ENET, Ethernet interface module
The following table describes what this chapter contains and where to find specific information. Refer to the section(s) that apply to your installation.
More
1
For information about
See page
Installing the Software
6-2
Creating a New Controller
6-2
Creating the Controller Tags
6-3
I/O Configuration
6-5
Creating the Ladder Logic
6-7
Downloading and Running the Program from a ControlNet Network
6-9
Downloading and Running the Program from an Ethernet Network
6-11
Downloading and Running the Program from a DH+ Network
6-13
For more information, see Getting Results With RSLogix 5000, Rockwell Software publication 9399-RL53GR.
Publication 1756-6.5.19 - May 2000
Page 68
6-2
The Example Application Program
Installing the Software
To install the RSLogix 5000 software: 1. Insert the CD in the CD-ROM drive. Note: The CD-ROM supports Windows Autorun. Once inserted into the CD-ROM drive, if you have Autorun configured, the installation will automatically start at the first setup screen. If Autorun is not configured for your CD-ROM drive, go to step 2. 2. From the Start menu, choose Run. You will see the Run pop-up window. 3. Type d:/setup (if it doesn’t appear automatically), where d: is your CD-ROM driver letter. 4. Click on OK. You will see the progress bar, followed by the welcome screen.
Creating the Example Application
The following sections describe how to create the example application using the RSLogix 5000 software.
Creating a New Controller The first step is to create a new controller. Use the following procedure. 1. Start RSLogix 5000. You will see the window shown below.
Publication 1756-6.5.19 - May 2000
Page 69
The Example Application Program
6-3
2. Select File from the main menu bar, and then select New from the dropdown menu. The New Controller window will appear. Enter a controller Name of your choice For the example program, controller is in Slot Number 0
Select from the pull-down list. 0 Optional Description
Select the directory on your workstation computer (default shown)
3. Enter a Name for your controller. Then select the correct Chassis Type and Slot Number of your Logix5550 controller, and the folder where you want to save the file (Create In). 4. Click on the OK button to accept the parameters.
Creating the Controller Tags Use the following procedure to create the controller tags for your application program. 1. Double-click on Controller Tags in the project window.
Publication 1756-6.5.19 - May 2000
Page 70
6-4
The Example Application Program
The Controller Tags window will appear:
2. Select the Edit Tags tab at the bottom of the Controller Tags window. 3. Create the following tag: Tag Name counter_1
Type COUNTER
Enter the name in the Tag Name field, then click on the button in the Type field. The Select Data Type window will open.
4. Select COUNTER from the list of Data Types and click on OK. 5. Close the Controller Tags window.
Publication 1756-6.5.19 - May 2000
Page 71
The Example Application Program
6-5
I/O Configuration Use the following procedure to configure the 1756-DNB module as an I/O device for the application: 1. Select the I/O Configuration folder in the project window.
2. Click the right mouse button. The following pop-up window will appear:
3. Click on New Module. The Select Module Type window will appear:
Publication 1756-6.5.19 - May 2000
Page 72
6-6
The Example Application Program
4. Select the 1756 DeviceNet Scanner from the list and click on OK. The Module Properties window will appear.
For the example program the 1756-DNB is in Slot 1. Enter a Name of your choice. Description is optional
Select Compatible Module
5. Fill in the Module Properties window as shown above. TIP
The Input Size, Output Size, and Status Size fields define the I/O image transferred across the connection to the Automation controller. If data is being returned across a ControlNet connection you may want to use as small an I/O image as possible to avoid consuming the entire packet size on ControlNet. See Appendix A for information on setting the Status Size.
6. Click on the Finish button. The 1756-DNB module will appear under the I/O Configuration folder.
Publication 1756-6.5.19 - May 2000
Page 73
The Example Application Program
6-7
Creating the Ladder Logic Create the following ladder logic for the example application: 1. Double-click on the Main Routine folder in the project window to bring up the ladder logic diagram. 2. Put an output on the first rung. Assign it the tag “Local:1:O.CommandRegister.Run”. Note that when you added the 1756-DNB to the IO Configuration, the Controller Tag database was updated with the mapping of the 1756-DNB module (see pages 4-16 and 4-17.)
This output is the RUN bit for the 1756-DNB module in the local chassis, slot 1.
Publication 1756-6.5.19 - May 2000
Page 74
6-8
The Example Application Program
3. Add the rungs to communicate to the RediSTATION and cause the photoeye to increment a counter. Your completed program should look like this:
4. Save this program using an appropriate name (e.g., “DeviceNet_Controller.ACD.”)
Publication 1756-6.5.19 - May 2000
Page 75
The Example Application Program
Downloading and Running the Example Application Program
6-9
You cannot go online to the controller directly over the DeviceNet network. The following sections provide examples of downloading and running the program using the following networks: • ControlNet (page 6-9) • Ethernet (page 6-11) • Data Highway Plus (page 6-13)
IMPORTANT
Verify that you have the correct controller firmware version. Refer to the Release Notes for RSLogix 5000 for this information.
Downloading and Running the Program from a ControlNet Network Follow the procedure below to download and run the example program from a ControlNet network. 1. Click on the RSLogix 5000 Communications menu and select Who Active. 2. The Who Active window will appear (Your window may look different depending upon the drivers and other devices you have installed):
3. Select the “+” next to your ControlNet driver (AB_KTC-1 above) to expand the tree.
Publication 1756-6.5.19 - May 2000
Page 76
6-10
The Example Application Program
4. Navigate down the tree through the backplane until you reach the Logix5550 Controller (1756-L1). Your window should appear similar to the following one:
5. Highlight the controller as shown above and click on the Download button. You will be prompted to Download to the controller. 6. Click on Download. The status bar should increment, and the RS-232 LED indicator on the controller should blink green to indicate communication between the PC and the controller. 7. After the download is complete, change the Logix5550 controller mode to Run. The display on the 1756-DNB module should toggle between “Run” and “A#00”. 8. Press and release the START button on the RediSTATION. The red light should turn on. On your screen, you will see rung 1 in your ladder program being energized as you press the button. 9. Pass your hand back and forth over the photoeye several times. On your screen you should see the counter increment. 10.Press and release the STOP button on the RediSTATION. The red light should turn off. On your screen, you will see rung 2 in your ladder program being energized as you press the button. This completes the ControlNet example.
Publication 1756-6.5.19 - May 2000
Page 77
The Example Application Program
6-11
Downloading and Running the Program from an Ethernet Network Follow the procedure below to download and run the example program from an Ethernet network. 1. Click on the RSLogix 5000 Communications menu and select Who Active. 2. The Who Active window will appear (Your window may look different depending upon the drivers and other devices you have installed):
3. Select the “+” next to your Ethernet driver (TCP-1 above) to expand the tree. 4. Navigate down the tree through the backplane until you reach the Logix5550 Controller. Your window should appear similar to the following one:
Publication 1756-6.5.19 - May 2000
Page 78
6-12
The Example Application Program
5. Highlight the controller as shown above and click on the Download button. The status bar should increment, and the RS-232 LED indicator on the controller should blink green to indicate communication between the PC and the controller. 6. After the download is complete, change the Logix5550 controller mode to Run. The display on the 1756-DNB module should toggle between “Run” and “A#00”. 7. Press and release the START button on the RediSTATION. The red light should turn on. On your screen, you will see rung 1 in your ladder program being energized as you press the button. 8. Pass your hand back and forth over the photoeye several times. On your screen you should see the counter increment. 9. Press and release the STOP button on the RediSTATION. The red light should turn off. On your screen, you will see rung 2 in your ladder program being energized as you press the button. This completes the Ethernet example.
Publication 1756-6.5.19 - May 2000
Page 79
The Example Application Program
6-13
Downloading and Running the Program from a DH+ Network Follow the procedure below to download and run the example program from a DH+ network. 1. Click on the RSLogix 5000 Communications menu and select Who Active. The Who Active window will appear (Your window may look different depending upon the drivers and other devices you have installed):
2. Select the “+” next to your Data Highway Plus driver (AB_KT-1 above) to expand the tree. 3. Navigate down the tree through the backplane until you reach the Logix5550 Controller. Your window should appear similar to the following one:
Publication 1756-6.5.19 - May 2000
Page 80
6-14
The Example Application Program
4. Highlight the controller as shown above and click on the Download button. The status bar should increment, and the RS-232 LED indicator on the controller should blink green to indicate communication between the PC and the controller. 5. After the download is complete, change the Logix5550 controller mode to Run. The display on the 1756-DNB module should toggle between “Run” and “A#00”. 6. Press and release the START button on the RediSTATION. The red light should turn on. On your screen, you will see rung 1 in your ladder program being energized as you press the button. 7. Pass your hand back and forth over the photoeye several times. On your screen you should see the counter increment. 8. Press and release the STOP button on the RediSTATION. The red light should turn off. On your screen, you will see rung 2 in your ladder program being energized as you press the button. This completes the Data Highway Plus example.
What’s Next?
Publication 1756-6.5.19 - May 2000
This concludes the application examples. The following chapter describes how the diagnostic indicators on the 1756-DNB module can be used for troubleshooting.