The text of a manual ยท part 37 of 45
Enhanced and Ethernet PLC-5 Programmable Controllers User Manual: Appendix D - Instruction Set Quick Reference, pages 301 to 310
Pages 301 to 310 of 388, from Enhanced and Ethernet PLC-5 Programmable Controllers User Manual
The original document is the PDF (5.1 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 1785-L20B and Allen-Bradley 1785-L40B
Page 301
Appendix
D
Instruction Set Quick Reference
Using This Chapter If You Want to Read About Relay instructions
D-2
Timer instructions
D-3
Counter instructions
D-4
Compare instructions
D-5
Compute instructions
D-7
Logical instructions
D-14
Conversion instructions
D-15
Bit modify and move instructions
D-16
File instructions
D-17
Diagnostic instructions
D-19
Shift register instructions
D-20
Sequencer instructions
D-21
Program control instructions
D-22
Process control and message instructions
D-25
Block Transfer instructions
D-25
ASCII instructions
D-27
Timing and memory requirements for bit and word instructions
D-30
Timing and memory requirements for file program control, and ASCII instructions
D-38
IMPORTANT
1
Go to Page
For a more detailed description of each of these instructions, see the PLC-5 Programming Software Instruction Set Reference, publication 1785-6.1.
Publication 1785-UM012D-EN-P - July 2005
Page 302
D-2
Instruction Set Quick Reference
Relay Instructions Instruction
Description Examine On XIC
Examine data table bit I:012/07, which corresponds to terminal 7 of an input module in I/O rack 1, I/O group 2. If this data table bit is set (1), the instruction is true.
Examine Off XIO
Examine data table bit I:012/07, which corresponds to terminal 7 of an input module in I/O rack 1, I/O group 2. If this data table bit is reset (0), the instruction is true.
O:013 ( ) 01
Output Energize OTE
If the input conditions preceding this output instruction on the same rung go true, set (1) bit O:013/01, which corresponds to terminal 1 of an output module in I/O rack 1, I/O group 3.
O:013
Output Latch OTL
If the input conditions preceding this output instruction on the same rung go true, set (1) bit O:013/01, which corresponds to terminal 1 of an output module in I/O rack 1, I/O group 3. This data table bit remains set even if the rung condition goes false.
O:013 (U ) 01
Output Unlatch OTU
If the input conditions preceding this output instruction on the same rung go true, reset (0) bit O:013/01, which corresponds to terminal 1 of an output module in I/O rack 1, I/O group 3. This is necessary to reset a bit that has been latched on.
01 ( IIN )
Immediate Input IIN
This instruction updates a word of input-image bits before the next normal input-image update. Address this instruction by rack and group (RRG). For a local chassis, program scan is interrupted while the inputs of the addressed I/O group are scanned; for a remote chassis, program scan is interrupted only to update the input image with the latest states as found in the remote I/O buffer.
01 ( IOT )
Immediate Output IOT
This instruction updates a word of output-image bits before the next normal output-image update. Address this instruction by rack and group (RRG). For a local chassis, program scan is interrupted while the outputs of the addressed I/O group are updated; for a remote chassis, program scan is interrupted only to update the remote I/O buffer with the latest states as found in the output image.
I:012 07 I:012 07
( L) 01
Publication 1785-UM012D-EN-P - July 2005
Page 303
Instruction Set Quick Reference
D-3
Timer Instructions Instruction TON TIMER ON DELAY Timer T4:1 1.0 Time Base Preset 15 Accum 0
Description Timer On Delay TON Status Bits: EN - Enable TT - Timer Timing DN - Done
If the input conditions go true, timer T4:1 starts incrementing in 1-second intervals. When the accumulated value is greater than or equal to the preset value (15), the timer stops and sets the timer done bit. EN
TT
DN
ACC
TON
15
14
13
Value
Status
False
0
0
0
0
Reset
True
1
1
0 increase
Timing
True
1
0
1
>= preset
Done
Rung Condition
See page F-8 for a description of prescan operation for this instruction. TOF TIMER OFF DELAY Timer T4:1 .01 Time Base Preset 180 Accum 0
Timer Off Delay TOF Status Bits: EN - Enable TT - Timer Timing DN - Done
If the input conditions are false, timer T4:1 starts incrementing in 10 1-ms intervals as long as the rung remains false. When the accumulated value is greater than or equal to the preset value (180), the timer stops and resets the timer EN
TT
DN
ACC
TOF
15
14
13
Value
Status
True
1
0
1
0
Reset
False
0
1
1 increase
Timing
False
0
0
0
>= preset
Done
Rung Condition
See page F-8 for a description of prescan operation for this instruction.
Publication 1785-UM012D-EN-P - July 2005
Page 304
D-4
Instruction Set Quick Reference
Instruction
Description
RTO RETENTIVE TIMER ON Timer T4:10 1.0 Time Base Preset 10 Accum 0
Retentive Timer On RTO
Status Bits: EN - Enable TT - Timer Timing DN - Done
Timer Reset RES
T4:1 ( RES )
If the input conditions go true, timer T4:10 starts incrementing i 1-second intervals as long as the rung remains true. When the rung goes false, the timer stops. If the rung goes true again, th timer continues. When the accumulated value is greater than o equal to the preset (10), the timer stops and sets the timer don bit. Rung Condition
EN 15
TT 14
DN 13
ACC Value
RTO Status
False
0
0
0
0
Disabled
True
1
1
0 increase
Timing
False
0
0
0 maintains
Disabled
True
1
0
1
>= preset
Done
If the input conditions go true, timer T4:1 is reset. This instruction resets timers and counters, as well as control blocks. This is necessary to reset the RTO accumulated value.
Counter Instructions Instruction
Description Count Up CTU
CTU COUNT UP Counter Preset Accum
C5:1 10 0
Status Bits: CU-Count Up CD-Count Down DN-Count Up done OV-Overflow UN-Underflow
If the input conditions go true, counter C5:1 starts counting, incrementing by 1 every time the rung goes from false-to-true. When the accumulated value is greater than or equal to the preset value (10), the counter sets the counter Rung Condition
CU 15
DN 13
OV 12
ACC Value
CTU Status
False
0
0
0
0
Disabled
Toggle True
1
0
0 incr by 1
Counting
True
1
1
0
>= preset
Done
True
1
1
1
>32767
Overflow
See page F-8 for a description of prescan operation for this instruction.
Publication 1785-UM012D-EN-P - July 2005
Page 305
Instruction Set Quick Reference
Instruction
Description
CTD COUNT DOWN Counter Preset Accum
D-5
Count Down CTD
If the input conditions go true, counter C5:1 starts counting, decrementing by 1 every time the rung goes from false-to-true. When the accumulated value is less than the preset value (10), the counter resets the counter done bit.
Status Bits: CU-Count Up CD-Count Down DN-Count Down done OV-Overflow UN-Underflow
Rung Condition
CD 14
DN 13
UN 11
ACC Value
CTD Status
False
0
0
0
0
Disabled
C5:1 10 35
False
0
1
0
>= preset
Preload
Toggle True
1
1
0 dec by 1
Counting
True
1
0
0
< preset
Done
True
1
0
1
< -32768
Underflow
See page F-8 for a description of prescan operation for this instruction.
Compare Instructions Instruction
Description
LIM LIMIT TEST (CIRC) Low limit N7:10 3 Test N7:15 4 High limit N7:20 22
Mask Compare Equal MEQ
MEQ MASKED EQUAL Source Mask Compare
Limit Test LIM
D9:5 0000 D9:6 0000 D9:10 0000
If the Test value (N7:15) is >= the Low Limit (N7:10) and <= the High Limit (N7:20), this instruction is true. Low Limit
Test
High Limit
LIM
0
0
10
T
-5
5
10
T
5
11
10
F
10
0
0
T
10
5
-5
F
10
11
5
T
The controller takes the value in the Source (D9:5) and passes that value through the Mask (D9:6). Then the controller compare the result to the Compare value (D9:10). If the result and this comparison values are equal, the instruction is true. Source
Mask
Compare
MEQ
0008
0008
0009
T
0008
0001
0001
F
0087
000F
0007
T
0087
00F0
0007
F
Publication 1785-UM012D-EN-P - July 2005
Page 306
D-6
Instruction Set Quick Reference
Instruction
Description Compare CMP
CMP COMPARE Expression N7:5 = N7:10 xxx xxxxxxxxxxxxx Source A Source B
Publication 1785-UM012D-EN-P - July 2005
If the expression is true, this input instruction is true. The CMP instruction can perform these operations: equal (=), less than (<), less than or equal (<=), greater than (>), greater than or equal (>=), not equal (<>), and complex expressions (up to 80 characters). Source A
Source B
EQU
GEQ
GRT
LEQ
LES
NEQ
10
10
T
T
F
T
F
F
5
6
F
F
F
T
T
T
21
20
F
T
T
F
F
T
-30
-31
F
T
T
F
F
T
-15
-14
F
F
F
T
T
T
N7:5 3 N7:10 1
Equal to EQU
If the value in Source A (N7:5) is = to the value in Source B (N7:10), this instruction is true.
Greater than or Equal GEQ
If the value in Source A (N7:5) is > or = the value in Source B (N7:10), this instruction is true.
Greater than GRT
If the value in Source A (N7:5) is > the value in Source B (N7:10), this instruction is true.
Less than or Equal LEQ
If the value in Source A (N7:5) is < or = the value in Source B (N7:10), this instruction is true.
Less than LES
If the value in Source A (N7:5) is < the value in Source B (N7:10), this instruction is true.
Not Equal NEQ
If the value in Source A (N7:5) is not equal to the value in Source B (N7:10), this instruction is true.
Page 307
Instruction Set Quick Reference
D-7
Compute Instructions Instruction
Description Compute CPT
CPT COMPUTE Dest
N7:3 3
The CPT instruction can perform these operations: add (+), subtract (-), multiply (*), divide (|), convert from BCD (FRD), convert to BCD (TOD), square root (SQR), logical and (AND), logical or (OR), logical not (NOT), exclusive or (XOR), negate (-) clear (0), and move, X to the power of Y (**), radians (RAD), degrees (DEG), log (LOG), natural log (LN), sine (SIN), cosine (COS), tangent (TAN), inverse sine (ASN), inverse cosine (ACS) inverse tangent (ATN), and complex expressions (up to 80 characters)
Expression N7:4 - (N7:6 * N7:10)
Arc cosine ACS
ACS ARCCOSINE Source Dest
If the input conditions go true, evaluate the Expression N7:4 (N7:6 * N7:10) and store the result in the Destination (N7:3).
F8:19 0.7853982 F8:20 0.6674572
If input conditions go true, take the arc cosine of the value in F8:19 and store the result in F8:20. Status Bit
Description
C always resets
V otherwise resets
Z S
Addition ADD
ADD ADD Source A Source B Dest
N7:3 3 N7:4 1 N7:12 4 sets if overflow is generated; sets if the result is zero;
otherwise resets always resets
When the input conditions are true, add the value in Source A (N7:3) to the value in Source B (N7:4) and store the result in the Destination (N7:12). Status Bit C
Description sets if carry is generated;
otherwise resets sets if overflow is generated;
V otherwise resets
Z otherwise resets
S otherwise resets sets if the result is zero;
sets if the result is negative;
Publication 1785-UM012D-EN-P - July 2005
Page 308
D-8
Instruction Set Quick Reference
Instruction
Description Arc sine ASN
ASN ARCSINE Source Dest
F8:17 0.7853982 F8:18 0.9033391
When input conditions go true, take the arc sine of the value in F8:17 and store the result in F8:18. Status Bit
Description
C always resets
V sets if overflow is generated;
otherwise resets Z sets if the result is zero;
otherwise resets always resets
S ATN ARCTANGENT Source F8:21 0.7853982 Dest
Arc tangent ATN
F8:22 0.6657737
When input conditions go true, take the arc tangent of the value in F8:21 and store the result in F8:22. Status Bit
Description
C always resets
V sets if overflow is generated;
otherwise resets Z sets if the result is zero;
otherwise resets S sets if the result is negative;
otherwise resets Average AVE
AVE AVERAGE FILE File Dest Control Length Position
#N7:1 N7:0 R6:0 4 0
Status Bits: EN - Enable DN - Done bit ER - Error Bit
When the input conditions go from false-to-true, take the average of the file #N7:1 and store the result in N7:0. Status Bit
Description
C always resets
V sets if overflow is generated;
otherwise resets Z sets if the result is zero;
otherwise resets S
Publication 1785-UM012D-EN-P - July 2005 sets if the result is negative;
otherwise resets
Page 309
Instruction Set Quick Reference
Instruction
Description Clear CLR
CLR CLR Dest
D9:34 0000
Cosine COS
COS COSINE Source Dest
D-9
F8:13 0.7853982 F8:14 0.7071068
When the input conditions are true, clear decimal file 9, word 3 (set to zero). Status Bit
Description
C always reset
V always reset
Z always set
S always reset
When input conditions go true, take the cosine of the value in F8:13 and store the result in F8:14. Status Bit
Description
C always resets
V sets if overflow is generated;
otherwise resets Z sets if the result is zero;
otherwise resets S sets if the result is negative;
otherwise resets
Instruction
Description Division DIV
DIV DIVIDE Source A Source B Dest
N7:3 3 N7:4 1 N7:12 3
When the input conditions are true, divide the value in Source A (N7:3) by the value in Source B (N7:4) and store the result in the Destination (N7:12). Status Bit
Description
C always resets
V sets if division by zero or overflow; otherwise resets
Z sets if the result is zero; otherwise resets; undefined if overflow is set
S sets if the result is negative; otherwise resets; undefined if overflow is set
Publication 1785-UM012D-EN-P - July 2005
Page 310
D-10
Instruction Set Quick Reference
Instruction
Description Natural log LN
LN NATURAL LOG Source Dest
N7:0 5
F8:20 1.609438
When input conditions go true, take the natural log of the va in N7:0 and store the result in F8:20. Status Bit
Description
C always resets sets if overflow is generated;
V otherwise resets sets if the result is zero;
Z otherwise resets sets if the result is negative;
S
LOG LOG BASE 10 Source Dest otherwise resets
When input conditions go true, take the log base 10 of the value in N7:2 and store the result in F8:3. N7:2 5
F8:3 0.6989700
Status Bit
Description
C always resets
V otherwise resets
Z
S
Multiply MUL
MUL MULTIPLY Source A Source B Dest
Publication 1785-UM012D-EN-P - July 2005
N7:3 3 N7:4 1 N7:12 3 sets if overflow is generated; sets if the result is zero;
otherwise resets sets if the result is negative;
otherwise resets
When the input conditions are true, multiply the value in Source A (N7:3) by the value in Source B (N7:4) store the result in the Destination (N7:12). Status Bit
Description
C always resets
V sets if overflow is generated; otherwise resets
Z sets if the result is zero; otherwise resets
S sets if the result is negative; otherwise resets