Allen Bradley PLC Tutorial PDF

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

20

Applying Ladder Logic

Applying Ladder Logic


General Concepts
Memory Mapping On Page 1 of this manual, we introduced you to the basic concept of memory
mapping. The OP-1124 uses memory mapping in order to link itself to a PLC.
Memory mapping is a technique that maps the memory of the OP-1124 into the
memory of the PLC. During initial configuration, you indicate where in the PLC
memory you want to start the mapping process (See Step 7B on Page 16). By
knowing where the data of the specific panel is mapped, this data can be moved,
changed or monitored using ladder logic.

 

During configuration, you determine the starting address


for the memory mapping process.

      


      

  
    

 

Memory Location Function The lamps are


PLCDirect m (such as V40600) Lamps 1-16 ON/OFF
numbered left
m+1 (such as V40601) Lamps 17-24 ON/OFF
to right starting
m+2 (such as V40602) Lamps 1-16 flash in the upper left
m+3 (such as V40603) Lamps 17-24 flash corner.

Allen-Bradley
Memory Location Function

m (such as N7: 0/0– 0/15) Lamps 1-16 ON/OFF


m+1 (such as N7: 1/0 1/15) Lamps 17-24 ON/OFF
m+2 (such as N7: 2/0 2/15) Lamps 1-16 flash
m+3 (such as N7: 3/0 3/15) Lamps 17-24 flash
21
21
Applying Ladder Logic

Addressing Before we jump into ladder logic programming, let’s take a moment to review and
Conventions compare the addressing conventions used by PLCDirect and Allen-Bradley.

PLCDirect Memory–A typical address within a PLCDirect programmable controller is


Vxxxx (such as V40600 for the DL205,DL350 or DL405 families) or Rxxx (such as R16 for the
DL330/340 family). The V-memory in the DL205 and DL405 is divided into 16-bit boundaries,
and the R-memory in the DL330/340 is divided into 8-bit boundaries. Refer to your individual
User Manuals for complete memory information. The two diagrams below show you how the
lamps of the OP-1124 could be mapped during configuration. In this example, we have
arbitrarily chosen V40600 and R16 as starting boundaries to map the lamps ON/OFF
function, but it could actually be any available user or internal relay memory areas as long as
they are consecutive:
16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 lamp Number
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 bit
V40600

L205,DL350 or DL405
Not Used 24 23 22 21 20 19 18 17 lamp Number
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 bit
V40601

16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 lamp Number
7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 bit
R17 R16

DL330/340
24 23 22 21 20 19 18 17 lamp Number
7 6 5 4 3 2 1 0 bit
R20

Allen-Bradley Memory–A typical address for Allen-Bradley might be N7:0/0 or N27:0/0. The
OP-1124 will allow you to define your starting address for mapping purposes using either
Allen-Bradley’s integer (N7) file type or user-defined integer file types (N9–N255). If you plan
to use an integer file between N9 and N255, you must define these in the Allen-Bradley
memory map before configuring the panel. Below we have shown you how 16-bit integer files
could be used to control the ON/OFF function of the individual lamps.
16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 lamp Number
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 bit
N7: 0/0–0/15
Integer File Type Not Used 24 23 22 21 20 19 18 17 lamp Number
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 bit
N7: 1/0–1/15

16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 lamp Number
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 bit
User-Defined N27: 0/0–0/15
Integer File Type Not Used 24 23 22 21 20 19 18 17 lamp Number
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 bit
N27: 1/0–1/15
22
Applying Ladder Logic

Controlling Lamps with a PLCDirect PLC


PLCDirect When you configure the OP1124, you must choose a base address in the CPU. You
Internal Relays can choose any available user memory or control relay memory address.
Controlling a Programming is much easier for the OP-1124 if you choose “control relay memory”.
Single Lamp We will show you both the “user memory” and “internal control relay” methods, and
then let you choose which method suits your application. Refer to the PLC User
Manual for a listing of the total number of internal control relays and their memory
locations. The control relays of the DL205 and DL405 families start at V40600 and
the control relays of the DL330/340 family start at R16. In the examples below, we
have chosen V40600 as the starting address for either a DL205,DL350 or DL405.
We have chosen R16 as our starting address for the DL330/340. Notice that the
internal control relays are numbered in octal and not decimal.

DL205,DL350 or DL405 Families


Example showing how to        
turn ON Lamp No. 4 with a Example Memory Locations Function
PLCDirect PLC.       

V40600 (C0 to C17) Lamps 1-16 ON/OFF


       
V40601 (C20 to C37) Lamps 17-24 ON/OFF
V40602 (C40 to C57) Lamps 1-16 flash
V40603 (C60 to C77) Lamps 17-24 flash Lamp 4 turns ON
X12 C3
OUT
DL205,DL 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 lamp number
350 or
DL405 17 16 15 14 13 12 11 10 7 6 5 4 3 2 1 0 control relay number
0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 V40600
Not Used 24 23 22 21 20 19 18 17 lamp Number
37 36 35 34 33 32 31 30 27 26 25 24 23 22 21 20 control relay number
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 V40601

DL330/340 Family
Example Memory Locations Function

R16 (C160 to C167) Lamps 1-8 ON/OFF


R17 (C170 to C177) Lamps 9–16 ON/OFF
R20 (C200 to C207) Lamps 17–24 ON/OFF
R21 (C210 to C217) Not Used
R22 (C220 to C227) Lamps 1–8 flash
R23 (C230 to C237) Lamps 9–16 flash
R24 (C240 to C247) Lamps 17–24 flash
IO12 C163
OUT 8 7 6 5 4 3 2 1 lamp number
DL330/340 7 6 5 4 3 2 1 0 control relay number
0 0 0 0 1 0 0 0 R16
Note: To determine the control relay number, use the register
number as the first two digits and the bit number as the last
digit. For example, Bit 3 of R16 is referenced as C163.
23
23
Applying Ladder Logic

PLCDirect You control multiple lamps just as you do individual lamps. Each lamp is controlled
Internal Relays by an individual internal control relay. The example below shows how to control
Controlling Multiple Lamps 3, 4 and 23.
Lamps

DL205,DL350 or DL405 Families        

Function       
Example showing how to turn Example Memory Locations
ON Lamp Nos. 3, 4 and 23 with V40600 (C0 to C17) Lamps 1-16 ON/OFF        
PLCDirect PLC
V40601 (C20 to C37) Lamps 17-24 ON/OFF
DL205,DL V40602 (C40 to C57) Lamps 1-16 flash
350 or
X12 DL405 V40603 (C60 to C77) Lamps 17-24 flash
Light Lamp 3 C2
OUT
16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 lamp Number
X13 Light Lamp 4 C3 17 16 15 14 13 12 11 10 7 6 5 4 3 2 1 0 internal relay number
OUT 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0 V40600

X14 Light Lamp 23 C26


OUT
Not Used 24 23 22 21 20 19 18 17 lamp Number
37 36 35 34 33 32 31 30 27 26 25 24 23 22 21 20 internal relay number
0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 V40601

DL330/340 Family

       
Example Memory Locations Function
      
R16 (C160 to C167) Lamps 1-8 ON/OFF
R17 (C170 to C177) Lamps 9–16 ON/OFF        

R20 (C200 to C207) Lamps 17–24 ON/OFF


R21 (C210 to C217) Not Used
R22 (C220 to C227) Lamps 1–8 flash
R23 (C230 to C237) Lamps 9–16 flash
R24 (C240 to C247) Lamps 17–24 flash

DL330/340

IO12 C162
Light Lamp 3
OUT 8 7 6 5 4 3 2 1 lamp Number
IO13 Light Lamp 4 C163 7 6 5 4 3 2 1 0 internal relay number
OUT 0 0 0 0 1 01 0 0 R16

IO14 Light Lamp 23 C206


OUT 24 23 22 21 20 19 18 17 lamp Number
7 6 5 4 3 2 1 0 internal relay number
0 1 0 0 0 0 0 0 R20

Note: To determine the control relay number, use the register


number as the first two digits and the bit number as the last
digit. For example, Bit 3 of R16 is referenced as C163.
24
Applying Ladder Logic

PLCDirect In the examples below, we are causing Lamp 4 to flash. Notice we go through two
Internal Relays Used steps to accomplish this. We first turn ON the lamp with C3 or C163 (depending on
to Add Flashing PLC used), and then we add the flashing with C43 or C213. Which control relay you
use in each case, depends on which lamp you are trying to illuminate and the
particular PLC you are using.

Example showing how to turn ON DL205,DL350 or DL405 Families        


Lamp No. 4 and also make it
flash using a PLCDirect PLC.       
Example Memory Locations Function
       
V40600 (C0 to C17) Lamps 1-16 ON/OFF
V40601 (C20 to C37) Lamps 17-24 ON/OFF
DL205,DL
350 or V40602 (C40 to C57) Lamps 1-16 flash Lamp 4 turns ON and flashes
X12 Light
DL405Lamp 4 C3 V40603 (C60 to C77) Lamps 17-24 flash
OUT
16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 lamp number
17 16 15 14 13 12 11 10 7 6 5 4 3 2 1 0 internal relay number
0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 V40600
X13 Add flashing C43
OUT

16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 lamp number
57 56 55 54 53 52 51 50 47 46 45 44 43 42 41 40 internal relay number
0 0 0 0 0 0 0 0 0 0 0 0 10 0 0 0 V40602

DL330/340 Family

Example Memory Locations Function

R16 (C160 to C167) Lamps 1-8 ON/OFF


R17 (C170 to C177) Lamps 9–16 ON/OFF        

R20 (C200 to C207) Lamps 17–24 ON/OFF


      

R21 (C210 to C217) Not Used


       
R22 (C220 to C227) Lamps 1–8 flash
R23 (C230 to C237) Lamps 9–16 flash
DL330/340 Lamp 4 turns ON and flashes
R24 (C240 to C247) Lamps 17–24 flash
IO12 Light Lamp 4 C163
OUT 8 7 6 5 4 3 2 1 lamp Number
7 6 5 4 3 2 1 0 internal relay number
0 0 0 0 1 0 0 0 R16 16x
IO13 Add flashing C213
OUT

8 7 6 5 4 3 2 1 lamp Number
7 6 5 4 3 2 1 0 internal relay number
0 0 0 0 1 0 0 0 R21 21x

Note: To determine the control relay number, use the register


number as the first two digits and the bit number as the last
digit. For example, Bit 3 of R16 is referenced as C163.
25
25
Applying Ladder Logic

PLCDirect If you do not want to use internal control relays, the next six pages show examples of
Controlling a Lamp controlling the lamps with user memory locations. In all the examples that follow, we
with User Memory have chosen V2000 to be our base address. The 16-bits belonging to V2000 control
(DL205/DL350/DL405 the ON/OFF state of the first two rows of lamps. The next three consecutive memory
Only) words control the bottom row, and the flashing feature. Notice that the hexadecimal
number formed is the sum of all the weights in the 16–bit register that are set to
logical 1. For example, the value 0008 hexadecimal stored at V2000 will turn ON bit 3
controlling Lamp No. 4. The ladder logic shown below demonstrates how this takes
place.
DL205,DL350 or DL405 Families
Example showing how to        
turn ON Lamp No. 4 with a Example Memory Locations Function
PLCDirect PLC.       

V2000 Lamps 1-16 ON/OFF


       
Load hex 0008 in the V2001 Lamps 17-24 ON/OFF
accumulator
X12 V2002 Lamps 1-16 flash
LD V2003 Lamps 17-24 flash Lamp 4 turns ON
K8
DL205,DL
350 or 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 lamp number
DL405 OUT
V2000 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 bit
0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 V2000
Output hex 0008
8 4 2 1 8 4 2 1 8 4 2 1 8 4 2 1 weight
to V2000
V2000=0008
0 0 0 8 hexadecimal value
26
Applying Ladder Logic

PLCDirect The DL450 has the additional advantage of allowing “bit-of-word” operations. This
Controlling a Lamp allows you to turn on individual bits without the the 2-step process of loading
with Bit-of-Word hexadecimal values into an accumulator and then outputting it to memory. With the
(DL250/350/450 Only) DL450, you merely use the starting number of the 16-bit memory boundary (i.e.
V2000) and then use a decimal point followed by the particular number of the bit you
want to turn ON. In this example, we want to turn ON bit number 3 because it controls
Lamp No. 4. Remember that bits number right to left starting with 0. You can trigger
this output using the usual data types or nicknames for open and closed contacts.
Here we have used X12 for example.

DL250/350/450 Only

Example showing how to        


turn ON Lamp No. 4 with a Example Memory Locations Function
PLCDirect DL450 PLC.       

V2000 Lamps 1-16 ON/OFF


       
V2001 Lamps 17-24 ON/OFF
X12 V2000.3 V2002 Lamps 1-16 flash
OUT V2003 Lamps 17-24 flash Lamp 4 turns ON

16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 lamp number
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 bit
0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 V2000
27
27
Applying Ladder Logic

PLCDirect The same process is used for turning ON several lamps as for turning on one lamp.
Controlling Multiple Notice that here we are using both words of memory reserved for ON/OFF control,
Lamps with User because we are turning ON lamps in both the top row and the bottom row.
Memory
(DL205/DL350/DL405
Only)
DL205,DL350 or DL405 Families        
Example showing how to
turn ON Lamp Nos. 3, 4 and       
Example Memory Locations Function
23 with PLCDirect PLC        
V2000 Lamps 1-16 ON/OFF
X12 V2001 Lamps 17-24 ON/OFF
LD V2002 Lamps 1-16 flash
KC
V2003 Lamps 17-24 flash

OUT 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 lamp Number


V2000 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 bit
0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0 V2000
LD 8 4 2 1 8 4 2 1 8 4 2 1 8 4 2 1 weight
K40 V2000=000C
0 0 0 C
OUT
V2001
Not Used 24 23 22 21 20 19 18 17 lamp Number
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 bit
0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 V2001
8 4 2 1 8 4 2 1 8 4 2 1 8 4 2 1
V2001=0040
0 0 4 0
28
Applying Ladder Logic

PLCDirect Turning ON more than one lamp when using the DL450 greatly simplifies matters.
Controlling Multiple Because it allows you to use “bit-of-word” opeations, you do not have to calculate a
Lamps with hexadecimal value that will turn on the correct bits. With the DL450, you merely use
Bit-of-Word the starting number of the 16-bit memory boundary (i.e. V2000) and then use a
(DL250/350/450 Only) decimal point followed by the particular number of the bit you want to turn ON. In this
example, we want to turn ON bit numbers 2, and 3 of V2000; and bit number 4 of
V2001 because they control Lamp Nos. 3, 4 and 23. Remember that bits number
right to left starting with 0. You can trigger this output using the usual data types or
nicknames for open and closed contacts. Here we have used X12 for example.
DL250/350/450 Only        
Example showing how to turn
ON Lamp Nos. 3, 4 and 23       
Example Memory Locations Function
with PLCDirect DL450 PLC        
V2000 Lamps 1-16 ON/OFF
X12 V2000.2 V2001 Lamps 17-24 ON/OFF
OUT V2002 Lamps 1-16 flash
V2003 Lamps 17-24 flash
V2000.3
16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 lamp Number
OUT
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 bit
0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0 V2000

V2001.6
OUT
Not Used 24 23 22 21 20 19 18 17 lamp Number
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 bit
0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 V2001
29
29
Applying Ladder Logic

PLCDirect Remember from our table on the previous page that bits in V2002 and V2003 control
Adding the Flashing the flashing feature. Notice that you must first turn ON a lamp before you can also
with User Memory make it flash. In other words, in this example, it would not be enough to just turn ON
(DL205/DL350/DL405 bit 3 in V2002 in order to have the 4th lamp flash. You have to turn ON the bit in V2000
Only) also.

Example showing how to turn ON DL205,DL350 or DL405 Families        


Lamp No. 4 and also make it flash
using a PLCDirect PLC. Function
      
Example Memory Locations
       
V2000 Lamps 1-16 ON/OFF
V2001 Lamps 17-24 ON/OFF
X12
LD V2002 Lamps 1-16 flash Lamp 4 turns ON and flashes
K8 V2003 Lamps 17-24 flash

OUT 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 lamp Number


V2000 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 bit
0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 V2000
OUT 8 4 2 1 8 4 2 1 8 4 2 1 8 4 2 1 weight
V2002
0 0 0 8
V2000=0008
16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 lamp Number
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 bit
0 0 0 0 0 0 0 0 0 0 0 0 10 0 0 0 V2002
8 4 2 1 8 4 2 1 8 4 2 1 8 4 2 1 weight

0 0 0 8
V2002=0008
30
Applying Ladder Logic

PLCDirect To add flashing when using the DL450, you can use the “bit-of-word” operation. This
Adding Flashing with precludes you from having to load a hexadecimal number in the accumulator
Bit-of-Word followed by an output to memory. Instead, you merely use the decimal point
(DL250/350/450 Only) convention coupled with the V-memory location to designate the bit you want turned
ON. In this example, we want to turn ON bit number 3 of V2000 and bit number 3 of
V2002. One memory location controls turning ON the lamp, and the other controls
adding the flashing feature.

Example showing how to turn ON DL250/350/450 Only 


      
Lamp No. 4 and also make it flash
using a PLCDirect DL450 PLC. Function
      
Example Memory Locations
       
V2000 Lamps 1-16 ON/OFF
V2001 Lamps 17-24 ON/OFF
V2002 Lamps 1-16 flash Lamp 4 turns ON and flashes
Lamp ON V2003 Lamps 17-24 flash

X12 V2000.3 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 lamp Number


OUT 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 bit
0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 V2000
Add Flashing

V2002.3
OUT
16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 lamp Number
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 bit
0 0 0 0 0 0 0 0 0 0 0 0 10 0 0 0 V2002
31
31
Applying Ladder Logic

Controlling Lamps with an Allen-Bradley PLC


Allen-Bradley The Allen-Bradley interface works much the same as with PLCDirect. Although the
Example addressing conventions are quite different, both systems still use consecutive
memory words controlling the ON/OFF and flashing of the lamps. In this
Allen-Bradley example, we are using an integer file type (N7) with the starting
address at 0/0.

Example showing how to        


turn ON Lamp No. 4 with an Memory Location Function
Allen-Bradley PLC.       
N7: 0/0–0/15 Lamps 1-16 ON/OFF
       
N7: 1/0–1/15 Lamps 17-24 ON/OFF
Turn ON Lamp 4 N7: 2/0–2/15 Lamps 1-16 flash
N7: 3/0–3/15 Lamps 17-24 flash Lamp 4 turns ON
I:2 N7:0

10 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 lamp Number
3
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 bit
0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 N7: 0/0–0/15

Turning ON Multiple Lamps (Allen-Bradley PLC)


Allen-Bradley You turn ON multiple lamps in the same manner as turning ON individual lamps. In
Example this example, we are turning ON bits 2 and 3 of N7:0 and turning ON bit 6 in N7:1.
Example showing how to turn        
ON Lamp Nos. 3, 4 and 23 with Memory Location Function
Allen-Bradley PLC N7: 0/0–0/15 Lamps 1-16 ON/OFF       

Turn ON Lamp 3 N7: 1/0–1/15 Lamps 17-24 ON/OFF        


I:2 N7:0 N7: 2/0–2/15 Lamps 1-16 flash
N7: 3/0–3/15 Lamps 17-24 flash
10
2
Turn ON Lamp 4
I:2 N7:0
11 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 lamp Number
3 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 bit
0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0 N7: 0/0-0/15
Turn ON Lamp 23
I:2 N7:1
12
6 Not Used 24 23 22 21 20 19 18 17 lamp Number
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 bit
0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 N7: 1/0-1/15
32
Applying Ladder Logic

Adding the Flash Option (Allen-Bradley PLC)


Allen-Bradley Bits in N7:2 and N7:3 control the flashing feature. Notice that you must turn ON the
Example lamp before the flash can be added.

Example showing how to turn ON        


Lamp No. 4 and also make it flash
using an Allen-Bradley PLC. Memory Location Function       

N7: 0/0–0/15 Lamps 1-16 ON/OFF        


Turn ON Lamp 4
I:2 N7:0 N7: 1/0–1/15 Lamps 17-24 ON/OFF
N7: 2/0–2/15 Lamps 1-16 flash
Lamp 4 turns ON and flashes
10 N7: 3/0–3/15 Lamps 17-24 flash
3

16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 lamp Number
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 bit
Add flashing 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 N7: 0/0-0/15
I:2 N7:2
12
3

16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 lamp Number
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 bit
0 0 0 0 0 0 0 0 0 0 0 0 10 0 0 0 N7: 2/0-2/15
33
33
Applying Ladder Logic

Test Routine for This is a simple test routine for checking the lamp operation for your OP-1124 panel.
Checking Lamp Notice for PLCDirect we have chosen to use the starting address V40600 which is
Operation the starting address for internal control relays (C0–C17). By using the internal
control relays, you can avoid having to load hexadecimal values into an accumulator
and outputting to V-memory. When the shift register is turned ON, each lamp should
turn ON sequentially starting with Lamp 1 and proceeding to Lamp 24. When the
Shift Register finally turns ON C27 (Lamp 24), it resets to zero.
For the Allen-Bradley, we are using a starting address of N7:0/0. We have created a Bit Shift
Left Register with 25 bits. We are sequentially turning ON bits from left to right in the shift
register. This turns on Lamps 1 through 24 one at a time. When the 25th bit is reached, the
shift register is reset by loading 0’s in each of the bit positions.

       

      

       

PLCDirect Ladder Logic Allen-Bradley Ladder Logic

Control Row Address Relay Bits Control Row Address


ON/OFF 1 and 2 V40600 C0–C17 ON/OFF 1 and 2 N7:0/0–0/15
3 V40601 C20–C27 3 N7:1/0–1/7

I:1 C5:0 B3
X0 Turn ON C100 internal relay C100
SET 0 DN 0

Use C100 to start the Shift Register B3


C100

SR C0
0
C27 BSL
SP4 Clock Shift Register B3 S:4
Bit Shift Left EN
File #N7:0
0 5 Control R6:0
C100 Shift Register Reset Bit Address B3/0 DN
Length 25

MOV
C27 Start 1 Second Timer C5:0
TMR T0
MOVE
Source 0
K10
DN Dest N7:0
0
TO Reset C100 when Timer times out C100
MOV
RST
MOVE
Source 0
Dest N7:1
0

C5:0
RES
CTU
R6:0
Count UP
Counter C5:0 CU
EN Preset 25
END Accum 0 DN

END

You might also like