The text of a manual · part 12 of 19
PLC-5 DeviceNet Scanner Module 1771-SDN User Manual: 6 - Creating and Running the Example Application Program
Pages 95 to 108 of 149, from PLC-5 DeviceNet Scanner Module 1771-SDN User Manual
The original document is the PDF (3.4 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 1771-SDN
Page 95
Chapter
6
Creating and Running 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 put into Run mode, pressing the START button on the network’s 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. This chapter provides examples of downloading and running the program over ControlNet, Ethernet, and Data Highway Plus networks. You cannot directly communicate with the PLC-5 processor over the DeviceNet network. The 1771 I/O chassis used for these examples was set up with the following hardware: Module
Rack
Group
Slot
IP Address
PLC-5/1785-ENET
0
0
0
192.168.1.1
1771-SDN
0
1
0 n/a
The following table describes what this chapter contains and where to find specific information.
More
1
For information about
See page
Installing the Software
6-2
Creating the Example Application Program
6-2
Downloading and Running the Program
6-6
What’s Next
6-14
For more information, see Getting Results With RSLogix 5, Rockwell Software publication 9399-RL53GR.
Publication 1771-UM118C-EN-P - June 2003
Page 96
6-2
Creating and Running the Example Application Program
Installing the Software
Install the RSLogix 5 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 see the progress bar, followed by the welcome screen.
Creating the Example Application Program
Perform the following steps to create the example application program. 1. Start RSLogix 5.
2. From the File menu select New.
Publication 1771-UM118C-EN-P - June 2003
Page 97
Creating and Running the Example Application Program
6-3
The Select Processor Type window will open.
3. Enter the following information and click on OK. In this field Processor Name
Select or Enter DNET_PLC
Platform
ControlNet
Processor Series
(Select your processor type) (Select your processor’s series)
Revision Driver
(Enter revision letter)
Processor Node
(Enter the Processor Node)(1)
(1)
(Select a Driver)(1)
You can use the Who Active button to select your communications driver. This is described in the “Downloading” sections of this chapter.
TIP
Ignore any prompts or warnings you receive about specifying ControlNet project files. That is not necessary for this example.
Publication 1771-UM118C-EN-P - June 2003
Page 98
6-4
Creating and Running the Example Application Program
4. Enter the following ladder program.
Input data file mapped by RSNetWorx for DeviceNet Length of 62 specifies the first data block. See the Automapping example in chapter 4. RediSTATION Start bit
RediSTATION Indicator Light bit
RediSTATION Stop bit
Output data file mapped by RSNetWorx for DeviceNet Length of 62 specifies the first data block. See the Automapping example in chapter 4. Photoeye input bit
5. Save the program using an appropriate name, e.g., “DNET_PLC”.
Publication 1771-UM118C-EN-P - June 2003
Page 99
Creating and Running the Example Application Program
IMPORTANT
6-5
The first word of the BTW downloaded from the PLC-5 to block 62 is reserved as the scanner module command register. You must set bit 0 of the command register to “1” to place the scanner’s DeviceNet Channel 1 in run mode. You can do this by double-clicking on file N10 in the project window and manually setting N10:0, bit 0 to “1” as shown below. Note: Set bit 2 to place Channel 2 in run mode.
More
See the 1771-SDN DeviceNet Scanner Module Installation Instructions (publication 1771-IN014) for more information on using the scanner module command register.
Publication 1771-UM118C-EN-P - June 2003
Page 100
6-6
Creating and Running the Example Application Program
Downloading and Running the Program
The remaining sections of this chapter provide examples of downloading and running the program via the following networks: • ControlNet (page 6-6) • Ethernet (page 6-9) • Data Highway Plus (page 6-12)
Downloading and Running the Program via a ControlNet Network Follow the procedure below to download and run the example program via a ControlNet network. 1. Click on the RSLogix 5 Comms menu and select System Communications.
2. Click on the Who Active button.
Publication 1771-UM118C-EN-P - June 2003
Page 101
Creating and Running the Example Application Program
6-7
RSLinx will open. You will see a window similar to the one below, displaying your system’s driver configuration.
3. Expand the tree under your ControlNet driver and highlight the PLC-5 processor as shown above. Click on OK. 4. Click on the Download button. You will be asked if you want to proceed with the Download. You will see a message similar to the one below.
5. Click on Yes to download the program. You may be prompted to keep the existing online ControlNet configuration.
6. Click on Yes. The program will be downloaded to the processor.
Publication 1771-UM118C-EN-P - June 2003
Page 102
6-8
Creating and Running the Example Application Program
Testing the Example Program 1. After the download is complete, go online and put the PLC-5 processor in Run mode. 2. Press and release the START button on the RediSTATION. The red light should turn on. On your screen, you should see rung 1 in your ladder program being energized as you press the button. 3. Pass your hand back and forth over the photoeye several times. On your screen you should see the counter incrementing. 4. Press and release the STOP button on the RediSTATION. The red light should turn off. On your screen, you should see rung 2 in your ladder program being energized as you press the button. This completes the ControlNet example.
Publication 1771-UM118C-EN-P - June 2003
Page 103
Creating and Running the Example Application Program
6-9
Downloading and Running the Program via an Ethernet Network
IMPORTANT
The Ethernet configuration must be downloaded to the PLC-5 processor before performing this example. See Appendix A.
Follow the procedure below to download and run the example program via an Ethernet network. 1. Click on the RSLogix 5 Comms menu and select System Communications.
2. Click on the Who Active button.
Publication 1771-UM118C-EN-P - June 2003
Page 104
6-10
Creating and Running the Example Application Program
RSLinx will open. You will see a window similar to the one below, displaying your system’s driver configuration.
192.168.1.1 found
DNET_PLC 192.168.1.1
192.168.1.1
3. Expand the tree under your Ethernet driver and highlight the PLC-5 processor as shown above. Click on OK. 4. Click on the Download button. You will be asked if you want to proceed with the Download. You will see a message similar to the one below.
5. Click on Yes to download the program. You may be prompted to keep the existing online ControlNet configuration.
6. Click on Yes. The program will be downloaded to the processor.
Publication 1771-UM118C-EN-P - June 2003
Page 105
Creating and Running the Example Application Program
6-11
Testing the Example Program 1. After the download is complete, go online and put the PLC-5 processor in Run mode. 2. Press and release the START button on the RediSTATION. The red light should turn on. On your screen, you should see rung 1 in your ladder program being energized as you press the button. 3. Pass your hand back and forth over the photoeye several times. On your screen you should see the counter incrementing. 4. Press and release the STOP button on the RediSTATION. The red light should turn off. On your screen, you should see rung 2 in your ladder program being energized as you press the button. This completes the Ethernet example.
Publication 1771-UM118C-EN-P - June 2003
Page 106
6-12
Creating and Running the Example Application Program
Downloading and Running the Program via a DH+ Network Follow the procedure below to download and run the example program via a DH+ network. 1. Click on the RSLogix 5 Comms menu and select System Communications.
2. Click on the Who Active button. RSLinx will open. You will see a window similar to the one below, displaying your system’s driver configuration.
3. Expand the tree under your DH+ driver and highlight the PLC-5 processor as shown above. Click on OK.
Publication 1771-UM118C-EN-P - June 2003
Page 107
Creating and Running the Example Application Program
6-13
4. Click on the Download button. You will be asked if you want to proceed with the Download. You will see a message similar to the one below.
5. Click on Yes to download the program. You may be prompted to keep the existing online ControlNet configuration.
6. Click on Yes. The program will be downloaded to the processor.
Publication 1771-UM118C-EN-P - June 2003
Page 108
6-14
Creating and Running the Example Application Program
Testing the Example Program 1. After the download is complete, go online and put the PLC-5 processor in Run mode. 2. Press and release the START button on the RediSTATION. The red light should turn on. On your screen, you should see rung 1 in your ladder program being energized as you press the button. 3. Pass your hand back and forth over the photoeye several times. On your screen you should see the counter incrementing. 4. Press and release the STOP button on the RediSTATION. The red light should turn off. On your screen, you should 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 1771-UM118C-EN-P - June 2003
This concludes the example applications. The following chapter describes how the diagnostic indicators on the 1771-SDN module can be used for troubleshooting.