The text of a manual · part 24 of 60
DL205 PLC User Manual, Volume 1 of 2, pages 231 to 240
Pages 231 to 240 of 598
The original document is the PDF (12 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 AutomationDirect D2-04TD1, AutomationDirect D2-08TD2, AutomationDirect D2-16ND3-2, AutomationDirect D2-32ND3, Konnect-It D2-04TD1, Koyo D2-04TD1, Konnect-It D2-08TD2, Koyo D2-08TD2, and 5 more models
Page 231
Chapter 5: Standard RLL Instructions
Parallel Elements
1 2 3 4 5 6 Joining Series Branches in Parallel Quite often it is necessary to join several groups of series elements in parallel. The Or Store (ORSTR) instruction allows this operation. The following example shows a simple network 7 consisting of series elements joined in parallel. 8 9 10 Joining Parallel Branches in Series 11 You can also join one or more parallel branches in series. The And Store (ANDSTR) instruction allows this operation. The following example shows a simple network with contact branches 12 in series with parallel contacts. 13 14 A Combination Networks B You can combine the various types of series and parallel branches to solve most C any application problem. The following example shows a simple combination D network. You may also have to join contacts in parallel. The OR instruction allows you to do this. The following example shows two contacts in parallel and a single output coil. The instructions would be STR X0, OR X1, followed by OUT Y0. DirectSOFT Example
Handheld Mnemonics
X0
Y0
OUT
X1
STR X0 OR X1 OUT Y0 END
END
DirectSOFT Example
X0
Handheld Mnemonics
Y0
X1
OUT
X2
X3
END
DirectSOFT Example
X0
STR X0 AND X1 STR X2 AND X3 ORSTR OUT Y0 END
Handheld Mnemonics
Y0
X1
OUT
X2
STR X0 STR X1 OR X2 ANDSTR OUT Y0 END
END
X0
X2
X5
Y0
OUT
X1
X3
X4
X6
END
DL205 User Manual, 4th Edition, Rev. D
5-7
Page 232
Chapter 5: Standard RLL Instructions
1 2 3 4 5 6 7 8 9 10 11 12 13 14 A B C D 5-8
Comparative Boolean The DL205 Micro PLCs provide Comparative Boolean instructions that allow you to quickly and easily solve compare two numbers. The Comparative Boolean provides evaluation of two 4-digit values using boolean contacts. The valid evaluations are: equal to, not equal to, equal to or greater than, and less than. In the example ,when the BCD value in V-memory location V1400 is equal to the constant value 1234, Y3 will energize. Y3 V1400 K1234 OUT
Boolean Stack
There are limits to how many elements you can include in a rung. This is because the DL205 CPUs use an 8-level boolean stack to evaluate the various logic elements. The boolean stack is a temporary storage area that solves the logic for the rung. Each time you enter a STR instruction, the instruction is placed on the top of the boolean stack. Any other STR instructions on the boolean stack are pushed down a level. The ANDSTR, and ORSTR instructions combine levels of the boolean stack when they are encountered. Since the boolean stack is only eight levels, an error will occur if the CPU encounters a rung that uses more than the eight levels of the boolean stack. The following example shows how the boolean stack is used to solve boolean logic. X0 STR
STR
STR
X1 ORSTR
AND X4
Y0 OUT
X2 AND
X5
X3
Output
ANDSTR
OR
STR X0
STR X1
STR X2
AND X3
1
1
STR X1
1
STR X2
1
STR X2
2
2
STR X0
2
STR X1
2
STR X1
3
3
3
STR X0
3
STR X0
4
4
4
STR X0
4
ORSTR
AND X4
1
X1 or (X2 AND X3)
1
X4 AND {X1 or (X2 AND X3)}
1
NOT X5 OR X4 AND {X1 OR (X2 AND X3)}
2
STR X0
2
STR X0
2
STR X0
3
3
ANDSTR 1
XO AND (NOT X5 or X4) AND {X1 or (X2 AND X3)}
2 3
DL205 User Manual, 4th Edition, Rev. D
ORNOT X5
3
Page 233
Chapter 5: Standard RLL Instructions
Immediate Boolean
1 2 3 4 NOTE: Even though the immediate input instruction reads the most current status from the input point, it only uses the results to solve that one instruction. It does not use the new status to update the image register. 5 Therefore, any regular instructions that follow will still use the image register values. Any immediate instructions that follow will access the I/O again to update the status. The immediate output instruction will 6 write the status to the I/O and update the image register. 7 8 9 CPU Scan 10 11 12 13 14 A B C D The DL205 Micro PLCs can usually complete an operation cycle in a matter of milliseconds. However, in some applications you may not be able to wait a few milliseconds until the next I/O update occurs. The DL205 PLCs offer immediate input and outputs which are special boolean instructions that allow reading directly from inputs and writing directly to outputs during the program execution portion of the CPU cycle. You may recall that this is normally done during the input or output update portion of the CPU cycle. The immediate instructions take longer to execute because the program execution is interrupted while the CPU reads or writes the I/O point. This function is not normally done until the read inputs or the write outputs portion of the CPU cycle.
X0 _ X7
X10 _ X17
X20 _ X27
X30 _ X37
Y0 _ Y7
Y10 _ Y17
Y20 _ Y27
Y30 _ Y37
Th e CPU reads the inputs from the local base and stores the status in an input image register .
Read Inputs
X128 OFF
... X2 X1 X0 ... ON OFF OFF Input Image Register
OFF
X0
OFF
X1
Read Inputs from Specialty I/O
Solve the Application Program X0 I
Y0
Immediate instruction does not use the input image register , but instead reads the status from the module I/O Point X0 Changes immediately. ON
X0
OFF
X1
Write Outputs
Write Outputs to Specialty I/O Diagnostics
DL205 User Manual, 4th Edition, Rev. D
5-9
Page 234
Chapter 5: Standard RLL Instructions
Boolean Instructions
1 Store (STR) The Store instruction begins a new rung or an additional 2 branch in a rung with a normally open contact. Status of the contact will be the same state as the associated image register point or memory location. 3 Store Not (STRN) 4 The Store Not instruction begins a new rung or an additional branch in a rung with a normally closed
5 contact. Status of the contact will be opposite the state of the associated image register point or memory location. 6 In the following 7 Operand Data Type DL230 Range DL240 Range DL250–1 Range DL260 Range A aaa aaa aaa aaa 8 9 10 11 12 Store example, when input X1 is on output Y2 will energize. 13 14 A B In the following Store Not example, when input X1 is off output Y2 will energize. C D 230
Aaaa
240
250-1 260
230
Aaaa
240
250-1 260
Inputs Outputs Control Relays Stage Timer Counter Special Relay Global Global
DS HPP
X Y C S T CT SP GX GY
0 – 177 0 – 177 0 – 377 0 – 377 0 – 77 0 – 77 0 – 117, 540 – 577 – –
0 – 477 0 – 477 0 – 377 0 – 777 0 – 177 0 – 177 0 – 137 540 – 617 – –
0 – 1777 0 – 1777 0 – 3777 0 – 1777 0 – 377 0 – 377 0 – 777 0 –3777 0 – 3777
Used Used
Handheld Programmer Keystrokes
DirectSOFT X1
Y2
OUT
X1
$
B
STR
GX OUT
C
1 2
ENT ENT
Handheld Programmer Keystrokes
DirectSOFT
Y2
OUT
5-10
0 – 777 0 – 777 0 – 1777 0 – 1777 0 – 377 0 – 177 0 – 777 – –
DL205 User Manual, 4th Edition, Rev. D
SP STRN
B
GX OUT
C
1 2
ENT ENT
Page 235
Chapter 5: Standard RLL Instructions
Store Bit-of-Word (STRB) 230 240 250-1 260 230 240 250-1 260
1 2 Store Not Bit-of-Word (STRNB) 3 The Store Not instruction begins a new rung or an additional branch in a rung with a normally closed 4 contact. Status of the contact will be opposite the state of the bit referenced in the associated memory location. 5 Operand Data Type DL250-1 Range DL260 Range A aaa bb aaa bb 6 7 In the following Store Bit-of-Word example, when bit 12 of V-memory location V1400 is on, 8 output Y2 will energize. 9 10 11 12 13 In the following Store Not Bit-of-Word example, when bit 12 of V-memory location V1400 14 is off, output Y2 will energize. A B C D The Store Bit-of-Word instruction begins a new rung or an additional branch in a rung with a normally open contact. Status of the contact will be the same state as the bit referenced in the associated memory location.
Aaaa.bb memory map BCD, 0 to 15 See memory map BCD, 0 to 15 B See page 3-55 page 3-56
V-memory memory map BCD, 0 to 15 See memory map BCD, 0 to 15 PB See page 3-55 page 3-56
Pointer
DS HPP
Used Used
Aaaa.bb
DirectSOFT
B1400.12
Y2
OUT
Handheld Programmer Keystrokes STR
SHFT
B
K
1
2
2
ENT
OUT
V
1
4
0
0
4
0
0
ENT
DirectSOFT
B1400.12
Y2
OUT
Handheld Programmer Keystrokes STRN
OUT
SHFT
B
V
K
1
2
2
ENT
1
ENT
DL205 User Manual, 4th Edition, Rev. D
5-11
Page 236
Chapter 5: Standard RLL Instructions
1
2
3 4
5 6 7 8 9 10 11 12 13 14 A B C D
Or (OR) 230 240 250-1 260
The Or instruction logically ors a normally open contact in parallel with another contact in a rung. The status of the contact will be the same state as the associated image register point or memory location.
Aaaa
Or Not (ORN) 230 240 250-1 260
The Or Not instruction logically ors a normally closed contact in parallel with another contact in a rung. The status of the contact will be opposite the state of the associated image register point or memory location. Operand Data Type aaa aaa aaa aaa
0-177 0-177 0–377 0–377 0–77 0–77 0-117, 540-577 -
0-477 0-477 0–377 0–777 0–177 0–177 0-137, 540-617 -
0-777 0-777 0–1777 0–1777 0–377 0–177 0-137, 540-717 -
0-1777 0-1777 0–3777 0–1777 0–377 0–377 0-137, 540-717 0-3777 0-3777
In the following Or example, when input X1 or X2 is on, output Y5 will energize.
DS Implied HPP Used
5-12
DL230 Range DL240 Range DL250-1 Range DL260 Range A X Y C S T CT SP GX GY
Inputs Outputs Control Relays Stage Timer Counter Special Relay Global Global
Aaaa
Handheld Programmer Keystrokes
DirectSOFT X1
Y5 OUT
X2
$
STR
Q
OR
GX OUT
B C F
1 2 5
ENT ENT ENT
In the following Or Not example, when input X1 is on or X2 is off, output Y5 will energize. Handheld Programmer Keystrokes
DirectSOFT X1
Y5 OUT
X2
DL205 User Manual, 4th Edition, Rev. D
$
STR
B
R ORN
C
GX OUT
F
1 2 5
ENT ENT ENT
Page 237
Chapter 5: Standard RLL Instructions
Or Bit-of-Word (ORB)
240 250-1 260 230
230 240 250-1 260
1 2 3 Or Not Bit-of-Word (ORNB) The Or Not Bit-of-Word instruction logically ors a 4 normally closed Bit-of-Word contact in parallel with another contact in a rung. Status of the contact will be opposite the state of the bit referenced in the associated 5 memory location. Operand Data Type DL250-1 Range DL260 Range 6 aaa bb bb 7 8 In the following Or Bit-of-Word example, when input X1 or bit 7 of V1400 is on, output Y7 9 will energize. 10 11 12 13 In the following Or Not Bit-of-Word example, when input X1 is on or bit 7 of V1400 is off, 14 output Y7 will energize. A B C D The Or Bit-of-Word instruction logically ors a normally open Bit-of-Word contact in parallel with another contact in a rung. Status of the contact will be the same state as the bit referenced in the associated memory location.
Aaaa.bb
Aaaa.bb
A aaa See memory map See memory map BCD, 0 to 15 B BCD, 0 to 15 page 3-55 page 3-56 memory map BCD, 0 to 15 See memory map BCD, 0 to 15 PB See page 3-55 page 3-56
V-memory Pointer
DirectSOFT
DS HPP
X1
Implied
Y7
OUT
Used
B1400.7
Handheld Programmer Keystrokes STR OR
1
ENT
SHFT
B
K
7
ENT
7
ENT
OUT
V
1
4
0
V
1
4
0
0
DirectSOFT
X1
Y7
OUT
B1400.7
Handheld Programmer Keystrokes STR
ORN
OUT
1
ENT
SHFT
B
K
7
ENT
7
ENT
DL205 User Manual, 4th Edition, Rev. D
0
5-13
Page 238
Chapter 5: Standard RLL Instructions
1
2
3 4
5 6 7 8 9 10 11 12 13 14 A B C D
And (AND) 230 240 250-1 260
Aaaa
The AND instruction logically ands a normally open contact in series with another contact in a rung. The status of the contact will be the same state as the associated image register point or memory location.
And Not (ANDN) 230 240 250-1 260
Operand Data Type
DL230 Range DL240 Range A X Y C S T CT SP GX GY
Inputs Outputs Control Relays Stage Timer Counter Special Relay Global Global
DL250-1
DL260 Range aaa aaa aaa aaa
0–177 0–177 0–377 0–377 0–77 0–77 0-117, 540-577 -
0–477 0–477 0–377 0–777 0–177 0–177 0-137, 540-617 -
0–777 0–777 0–1777 0–1777 0–377 0–177 0-137, 540-717 -
0–1777 0–1777 0–3777 0–1777 0–377 0–377 0-137, 540-717 0-3777 0-3777
In the following And example, when input X1 and X2 are on output Y5 will energize.
DS Implied HPP Used
5-14
Aaaa
The And Not instruction logically “ANDs” a normally closed contact in series with another contact in a rung. The status of the contact will be opposite the state of the associated image register point or memory location.
Handheld Programmer Keystrokes
DirectSOFT X1
X2
Y5 OUT
$
STR
B
V AND
C
GX OUT
F
1 2 5
ENT ENT ENT
In the following And Not example, when input X1 is on and X2 is off output Y5 will energize. Handheld Programmer Keystrokes
DirectSOFT X1
X2
Y5 OUT
DL205 User Manual, 4th Edition, Rev. D
$
STR
B
W ANDN
C
GX OUT
F
1 2 5
ENT ENT ENT
Page 239
Chapter 5: Standard RLL Instructions
AND Bit-of-Word (ANDB)
1 2 3 4 Operand Data Type DL250-1 Range DL260 Range aaa bb aaa bb 5 6 In the following And Bit-of-Word example, when input X1 and bit 4 of V1400 is on output 7 Y5 will energize. 8 9 10 11 12 In the following And Not Bit-of-Word example, when input X1 is on and bit 4 of V1400 is 13 off, output Y5 will energize. 14 A B C D
The And Bit-of-Word instruction logically ands a normally open contact in seriesAaaa.bb with another contact in a rung. The status of the contact will be the same state as the bit referenced in the 240
250-1 associated memory location. 260 And Not Bit-of-Word (ANDNB) 230 The And Not Bit-of-Word instruction logically ands a normally closed contact in series with Aaaa.bb 240 another contact in a rung. The status of the contact will be opposite the state of the bit 250-1 referenced in the associated memory location. 260 230
A
V-memory Pointer memory map B See page 3-55 memory map PB See page 3-55
BCD, 0 to 15 BCD
See memory map page 3-56 See memory map page 3-56
BCD, 0 to 15 BCD
DirectSOFT
DS Implied HPP Used
X1
B1400.4
Y5
OUT
Handheld Programmer Keystrokes STR
1
AND
ENT
SHFT
B
K
4
ENT
5
ENT
OUT
V
1
4
0
0
4
0
0
DirectSOFT X1
Y5
B1400.4
OUT
Handheld Programmer Keystrokes STR
ANDN
OUT
1
ENT
SHFT
B
K
4
ENT
V
5
ENT
1
DL205 User Manual, 4th Edition, Rev. D
5-15
Page 240
Chapter 5: Standard RLL Instructions
And Store (ANDSTR)
OUT The And Store instruction logically ands two branches 1 of a rung in series. Both branches must begin with 1 2 the Store instruction. 2
In the following And Store example, the branch consisting of contacts X2, X3, and X4 have 3 been anded with the branch consisting of contact X1. 4 5 6 7 8 9 (ORSTR) 1 10 Or Store OUT The Or Store instruction logically ors two branches of a rung in parallel. Both branches must begin with
2 the Store instruction. 11
12 In the following Or Store example, the branch consisting of X1 and X2 have been OR’d with the branch consisting of X3 and X4. 13 14 A B C D 230 240
250-1 260
DS Implied HPP Used
Handheld Programmer Keystrokes
DirectSOFT X1
X2
X3
Y5
OUT
X4
$ $
B
STR
C
STR
V AND
D
Q
E
OR
L ANDST
1
2 3 4
ENT ENT ENT ENT
ENT
GX OUT
F
5
ENT
230 240
250-1 260
DS Implied HPP Used
Handheld Programmer Keystrokes
DirectSOFT X1
X2
Y5
OUT
X3
X4
$
B
STR
V AND
C
$
D
STR
V AND
M ORST GX OUT
5-16
DL205 User Manual, 4th Edition, Rev. D
E
1
2
3
4
ENT ENT ENT ENT
ENT
F
5
ENT