The text of a manual · part 31 of 60
DL205 PLC User Manual, Volume 1 of 2, pages 301 to 310
Pages 301 to 310 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 301
Chapter 5: Standard RLL Instructions
Or Formatted (ORF)
1 2 3 Operand Data Type DL250-1 Range DL260 Range A aaa bbb aaa bbb 4 5 6 7 8 Discrete Bit Flags Description 9 NOTE: Status flags are valid only until another instruction uses the same flag. 10 In the following example, when X1 is on the Load Formatted instruction loads C10–C13 (4 binary bits) into the accumulator. The Or Formatted instruction logically ORs the 11 accumulator contents with Y20–Y23 bit pattern. The Out Formatted instruction outputs the accumulator’s lower four bits to C20–C23. 12 13 14 A B C D The Or Formatted instruction logically ORs the binary value in the accumulator and a specified range of discrete bits (1 to 32). The instruction requires a starting location (Aaaa) and the number of bits (Kbbb) to be ORed. Discrete status flags indicate if the result is zero or negative (the most significant bit =1).
230 240 250-1 260 DS Used HPP Used
Inputs Outputs Control Relays Stage bits Timer bits Counter bits Special Relays Global I/O Constant
X Y C S T CT SP GX/GY K
SP63 SP70
0–777 0–777 0–1777 0–1777 0–377 0–177 0-777 -
ORF
A aaa
K bbb
– – – – – – – – 1–32
0–1777 0–1777 0–3777 0–1777 0–377 0–377 0–777 0-3777 -
– – – – – – – – 1–32
Will be on if the result in the accumulator is zero Will be on if the result in the accumulator is negative
DirectSOFT X1
LDF
C10
Location
Constant
C13 C12 C11 C10
C10
K4
OFF ON ON OFF
K4
The unused accumulator bits are set to zero
Load the status of 4 consecutive bits (C10-C13) into the accumulator ORF
Acc.
Y20
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9
8
7 6 5
4 3
2
1
0
0
0
0 0
0
0
0
1 1
0
1
0
0
0
0
0
0 1
1
1
0
0
0
0 0
0
0
0
0 0
0
0
0
0 0
0
0
0
0
0
0
0 0
0
0
0
0 0
0
0
0 0
0 0
0
0
0
0
0 0
K4
OR the binary bit pattern (Y20 - Y23) with the value in the accumulator OUTF
Y23 Y22 Y21 Y20
ON OFF OFF OFF
OR (Y20- Y23)
Acc.
C20
0
0
0
0 0
0
0
0
K4
Copy the specified number of bits from the accumulator to C20-C23
Handheld Programmer Keystrokes $
STR
SHFT Q
OR
GX OUT
B
L ANDST
D
SHFT
F
SHFT
F
1
3
5 5
Location
Constant
C23 C22 C21 C20
C20
K4
ON ON ON OFF
ENT
F
NEXT
NEXT
NEXT
C
A
PREV
PREV
5
2
C
NEXT
0 2
NEXT
E A
0
4
B
1
A
0
E
4
ENT
ENT E
4
ENT
DL205 User Manual, 4th Edition, Rev. D
5-77
Page 302
Chapter 5: Standard RLL Instructions
1
2
3 4 5 6 7 8 9 10 11 12 13 14 A B C D
Or with Stack (ORS) 230 240 250-1 260
DS Used HPP Used
The Or with Stack instruction is a 32-bit instruction that logically ORs the value in the accumulator with the first level of the accumulator stack. The result resides in the accumulator. The value in the first level of the accumulator stack is removed from the stack and all values are moved up one level. Discrete status flags indicate if the result of the Or with Stack is zero or a negative number (the most significant bit is on). Discrete Bit Flags
OR S
Description
SP63 SP70
Will be on if the result in the accumulator is zero Will be on if the result in the accumulator is negative
In the following example, when X1 is on, the binary value in the accumulator will be ORed with the binary value in the first level of the stack. The result resides in the accumulator.
DirectSOFT X1
V1401
LDD
5
V1400
4
7
E
2
V1400 8 7
A
Load the value in V1400 and V1401 in the accumulator
Acc.
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9
8 7
6 5
4 3
0
0 0
1
1
1
1
0 1
0
1
0
0 0
1
1
1
1 1
1
0
0
0
1 0
1
0
0
2
1
0
1 0
1
0
0
ORS OR the value in the accumulator with the value in the first level of the accumulator stack
Acc.
0
1
0 1
0
1
0
0 0
1
1
1
1 1
1
0
0
0
1 0
1
0
0
0 0
1
1
1
1 0
1
36476A38 OR (top of stack)
0
0
1
0 1
1
0
1 0
0
0
1 1
0
1
1
1 0
1
0
0 1
1
1
0 0
0
1 0
1 0 0 1
0
1 0
0 0
1 0
1 0
1 0 0 1
1 0
0
1
1 0
1
1
0 0
1
1
1 0
6
F
A
A
Acc.
1
1
0
1 0
1
1 0
0
0
0
OUTD V1500 Copy the value in the accumulator to V1500 and V1501
7
Handheld Programmer Keystrokes
5-78
$
B
STR
1
SHFT
L ANDST
D
Q
SHFT
S RST
SHFT
D
OR
GX OUT
3
3
ENT D
B
3
1
E
4
A
0
A
0
ENT
ENT B
1
7
V1501
F
5
A
0
A
0
ENT
DL205 User Manual, 4th Edition, Rev. D
6
7
V1500
1
0
1
0
Page 303
Chapter 5: Standard RLL Instructions
Exclusive Or (XOR)
230 240 250-1 260 DS Used HPP Used
1 2 3 Operand Data Type DL230 Range DL240 Range DL250-1 Range DL260 Range A aaa aaa aaa aaa 4 5 Discrete Bit Flags Description 6 7 NOTE: The status flags are only valid until another instruction that uses the same flags is executed. In the following example, when X1 is on, the value in V2000 will be loaded into the accumulator 8 using the Load instruction. The value in the accumulator is exclusive OR’d with V2006 using the Exclusive Or instruction. The value in the lower 16 bits of the accumulator are output to 9 V2010 using the Out instruction. 10 11 12 13 14 A B C D The Exclusive Or instruction is a 16-bit instruction that performs an exclusive OR of the value in the lower 16 bits of the accumulator and a specified V-memory location (Aaaa). The result resides in the accumulator. The discrete status flag indicates if the result of the XOR is zero.
V-memory
V
All See memory map
Pointer
P
-
SP63 SP70
DirectSOFT X1
All See memory map All V-memory. See memory map
XOR
A aaa
All See memory map All V-memory. See memory map
All See memory map All V-memory. See memory map
Will be on if the result in the accumulator is zero Will be on if the result in the accumulator is negative
V2000
LD
2
V2000
8
7
A
The upper 16 bits of the accumulator will be set to 0
Load the value in V2000 into the lower 16 bits of the accumulator
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Acc. 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 1 0 0 1
0 0 0 1 1 1
1 0 1 0
XOR
V2006
XOR the value in the accumulator with the value in V2006
Acc.
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 1 0 0 1 0 0 0 1 1 1
1 0 1 0
6A38 XOR (V2006)
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 1 1
1 0 0 0
0 0 0 0 0 0 0 0 0 0 0 Acc. 0 0 0 0 0 1
0 1 0 1 0 0 0 1 1
0 1 0 0 1 1 1 0 0 1 0 0 0 0 1 0
OUT
V2010
4
Copy the lower 16 bits of the accumulator to V2010
E
4
2
V2010
Handheld Programmer Keystrokes $
B
STR
1
SHFT
L D 3 ANDST
SHFT
X SET
GX OUT
ENT
SHFT
SHFT
Q
SHFT
V AND
OR
C
2
V AND
C
SHFT
V AND
C
A
B
A
0
2
1
A
0 2 0
A A
0 0
A A
0 0
ENT
G
6
ENT
ENT
DL205 User Manual, 4th Edition, Rev. D
5-79
Page 304
Chapter 5: Standard RLL Instructions
1 2 3 4 5 6 7 8 9 10 11 12 13 14 A B C D
Exclusive Or Double (XORD) Exclusive Or Double is a 32-bit instruction 230 The that performs an exclusive OR of the value in the 240 accumulator and the value (Kaaa), which is an 250-1 8-digit (max) constant. The result resides in the 260 accumulator. Discrete status flags indicate if the DS Used HPP Used
XORD K aaa result of the Exclusive Or Double is zero or a negative number (the most significant bit is on). Operand Data Type Constant
DL230 Range K
DL240 Range DL250-1 Range DL260 Range aaa aaa aaa aaa
0-FFFFFFFF
0-FFFFFFFF
0-FFFFFFFF
0-FFFFFFFF
NOTE: The status flags are only valid until another instruction that uses the same flags is executed.
Discrete Bit Flags
Description
SP63 SP70
Will be on if the result in the accumulator is zero Will be on if the result in the accumulator is negative
In the following example, when X1 is on, the value in V2000 and V2001 will be loaded into the accumulator using the Load Double instruction. The value in the accumulator is exclusively OR’d with 36476A38 using the Exclusive Or Double instruction. The value in the accumulator is output to V2010 and V2011 using the Out Double instruction. DirectSOFT
V2001
X1
5
LDD V2000 Load the value in V2000 and V2001 into the accumulator
7
V2000 E
2
8
7
A
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9
8
7
6 5
Acc.
0
1
0
1
0
1
0
0
0
1
1
1
1
1
1
0
0
0
1
0
1
0
0
0
0
1
Acc.
0
1
0
1
0
1
0
0
0
1
1
1
1
1
1
0
0
0
1
0
1
0
0
0
0
1 1
XORD 36476A38
0
0
1
1
0
1
1
0
0
1
0
0
0
1 1
1
0
1 1
0
1
0
1
0
0
Acc.
0
1 0
1 0
0
0
0 1
1 0
0
0
0
1 0
1 0
1 0
0
1 0
0
1
0
0
0
1
0
0
2
3
9
4
2
4
2
XORD K36476A38 XORD the value in the accumulator with the constant value 36476A38
4 ?
OUTD
0
0
2
1
0
1
0
1
0
1
1
0
1
0
0
1 1
1
0
0
0
1
0
0
0
1
0
V2010 Copy the value in the accumulator to V2010 and V2011
6
V2011
Handheld Programmer Keystrokes $
B
STR
SHFT
L ANDST
D
SHFT
X SET
Q
D
G
E
3
GX OUT
5-80
6
SHFT
D
1 3 OR 4 3
ENT D
C
3
SHFT
D
H
G
7
C
2
2
0
A
0
A
SHFT SHFT
A
SHFT
D
A
B
A
ENT
0
0 1
0
ENT
0
K JMP
3 6
A
3
I
8
DL205 User Manual, 4th Edition, Rev. D
ENT
V2010
4 3
1 1
0
Page 305
Chapter 5: Standard RLL Instructions
Exclusive OR Formatted (XORF)
1 2 the result of the Exclusive Or Formatted is zero or negative (the most 3 significant bit is on). Operand Data Type DL250-1 Range DL260 Range 4 A aaa bbb aaa bbb 5 6 7 8 Discrete Bit Flags Description 9 10 NOTE: Status flags are valid only until another instruction uses the same flag. 11 In the following example, when X1 is on, the binary pattern of C10–C13 (4 bits) will be loaded into the accumulator using the Load Formatted instruction. The value in the accumulator will be logically Exclusive OR’d with the bit pattern from Y20–Y23 using the Exclusive Or 12 Formatted instruction. The value in the lower 4 bits of the accumulator are output to C20– C23 using the Out Formatted instruction. 13 14 A B C D The Exclusive Or Formatted instruction performs an exclusive OR of
230 the binary value in the accumulator and a specified range of discrete 240 memory bits (1 to 32). 250-1 The instruction requires a starting location (Aaaa) and the number 260 of bits (Kbbb) to be exclusive OR’d. Discrete status flags indicate if
Inputs Outputs Control Relays Stage bits Timer bits Counter bits Special Relays Global I/O Constant
X Y C S T CT SP GX/GY K
SP63 SP70
0–777 0–777 0–1777 0–1777 0–377 0–177 0-777 -
– – – – – – – – 1–32
K bbb
0–1777 0–1777 0–3777 0–1777 0–377 0–377 0–777 0-3777 -
– – – – – – – – 1–32
Will be on if the result in the accumulator is zero Will be on if the result in the accumulator is negative
DirectSOFT32 X1
LDF
C10
Location
Constant
C13 C12 C11 C10
C10
K4
OFF ON
K4
Load the status of 4 consecutive bits (C10-C13) into the accumulator X0RF
Y20
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9
8
7 6 5
4 3
2
1
0
0
0
0 0
0
0
1 1
0
0
0
0 0
0
0
0
0
0 0
0 0
0
0
0
0
0
0 0
0 0
0
0
0
0
0
0
Acc.
0
0
0 0
0
0
0
0 0
0
0
0
0 0
0
0
0
0 0
1
1
0
1
0
1
0
0 0
0
0
0
0 0
0
0
0
0 1
1
0
0
Accumulator
Exclusive OR the binary bit pattern (Y20-Y23) with the value in the accumulator OUTF
ON OFF
The unused accumulator bits are set to zero
K4
Acc.
0
0 0
0
0
0
0
Y23 Y22 Y21 Y20
XORF (Y20-Y23) ON OFF ON OFF
C20
K4
Copy the specified number of bits from the accumulator to C20-C23
Handheld Programmer Keystrokes $
B
STR
A aaa
SHFT
L ANDST
D
SHFT
X SET
Q
GX OUT
SHFT
F
1
3
OR 5
Location
Constant
C20
K4
ENT
F
NEXT
5
SHFT
F
5
PREV
PREV
NEXT
NEXT
NEXT
NEXT
C
A
C
A
2
2 0
B
1
A E
0 E
4
E
0
4
4
C23 C22 C21 C20 ON ON OFF OFF
Standard RLL
DS Used HPP Used
XORF
ENT
ENT
ENT
DL205 User Manual, 4th Edition, Rev. D
5-81
Page 306
Chapter 5: Standard RLL Instructions
1
2
3 4 5 6 7 8 9 10 11 12 13 14 A B C D
Exclusive Or with Stack (XORS) The Exclusive Or with Stack instruction is a 32-bit instruction that performs an Exclusive Or of the value in the accumulator with the first level of the accumulator stack. The result resides in the accumulator. The value in the first level of the accumulator stack is removed from the stack and all values are moved up one level. Discrete status flags indicate if the result of the Exclusive Or with Stack is zero or a negative number (the most significant bit is on).
230 240 250-1 260
DS Used HPP Used
Discrete Bit Flags
XO R S
Description
SP63 SP70
Will be on if the result in the accumulator is zero Will be on if the result in the accumulator is negative
NOTE: flags are valid only until another instruction uses the same flag.
In the following example, when X1 is on, the binary value in the accumulator will be Exclusive OR’d with the binary value in the first level of the accumulator stack. The result will reside in the accumulator.
DirectSOFT V1401
LDD
X1
5
V1400
4
V1400 E
2
8
7
A
Load the value in V1400 and V1401 into the accumulator 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9
8 7
6 5
4 3
2
1
0
Acc.
0
1
0 1
0
1
0
0 0
1
1
1
1 1
1
0
0
0
1 0
1
0
0
0 0
1
1
1
1 0
1
0
Acc.
XORS Exclusive OR the value in the accumulator with the value in the first level of the accumulator stack OUTD
0
1
0 1
0
1
0
0 0
1
1
1
1 1
1
0
0
0
1 0
1
0
0
0 0
1
1
1
1 0
1
0
36476A38 XOR (1st level of Stack) 0
0
1 1
0
1
1
0 0
1
0
0
0 1
1
1
0
1
1 0
1
0
1
0 0
0
1
1
1 0
0
0
0
1 0
1 0 0
0
0 1
1 0
0 0
0
1 0
1 0
1 0 0
0
1 0
0
1
0 0
0
0
1
0 0
1
0
0
0 0
1
0
2
9
2
2
Acc.
V1500 6
Copy the value in the accumulator to V1500 and V1501
B
STR
SHFT
L ANDST
D
SHFT
X SET
Q
GX OUT
SHFT
D
5-82
1 3 OR 3
ENT D
B
3
SHFT
1
S RST
ENT
B
F
1
5
3
V1501
Handheld Programmer Keystrokes $
7
E
A
4
0
A
A
0
0
A
0
ENT
ENT
DL205 User Manual, 4th Edition, Rev. D
4
4
V1500
Page 307
Chapter 5: Standard RLL Instructions
Compare (CMP)
1 A aaa 2 3 Operand Data Type DL230 Range DL240 Range DL250-1 Range DL260 Range A aaa aaa aaa aaa 4 5 Discrete Bit Flags Description 6 7 NOTE: The status flags are only valid until another instruction that uses the same flags is executed. 8 In the following example, when X1 is on, the constant 4526 will be loaded into the lower 16 bits of the accumulator using the Load instruction. The value in the accumulator is compared 9 with the value in V2000 using the Compare instruction. The corresponding discrete status flag will be turned on indicating the result of the comparison. In this example, if the value in the accumulator is less than the value specified in the Compare instruction, SP60 will turn on, 10 energizing contact C30. 11 12 13 14 A B C D The compare instruction is a 16-bit instruction that
230 compares the value in the lower 16 bits of the accumulator 240 with the value in a specified V-memory location (Aaaa). 250-1 The corresponding status flag will be turned on indicating 260 the result of the comparison. DS Used HPP Used
V-memory
All V See memory map
Pointer
P
SP60 SP61 SP62
-
CMP
All See memory map All V-memory. See memory map
All See memory map All V-memory. See memory map
All See memory map All V-memory. See memory map
On when the value in the accumulator is less than the instruction value. On when the value in the accumulator is equal to the instruction value. On when the value in the accumulator is greater than the instruction value.
DirectSOFT X1
CONSTANT
LD
4
K4526
Load the constant value 4526 into the lower 16 bits of the accumulator
5
? 2
6
The unused accumulator bits are set to zero Acc. 0
0
0
0
44 55 2? 2 66
Compared with
CMP
V2000
8
Compare the value in the accumulator with the value in V2000
SP60
9
4
5
V2000
C30
OUT
Handheld Programmer Keystrokes $
B
STR
SHFT
L ANDST
SHFT
C
$
STR
GX OUT
2
D
1
ENT
SHFT
3
SHFT
M ORST
P
SHFT
SP STRN
G
SHFT
C
D
2
K JMP
C
CV 6 3
E
A A
0 0
4
2
F
A
5 0
C A
2 0
G A
6 0
ENT ENT
ENT ENT
DL205 User Manual, 4th Edition, Rev. D
5-83
Page 308
Chapter 5: Standard RLL Instructions
1 2 3 4 5 6 7 8 9 10 11 12 13 14 A B C D
Compare Double (CMPD) Compare Double instruction is a 32–bit instruction that 230 The compares the value in the accumulator with the value (Aaaa), 240 which is either two consecutive V-memory locations or an 8–digit 250-1 (max) constant. The corresponding status flag will be turned on 260 indicating the result of the comparison. DS Used HPP Used
Operand Data Type
DL240 Range DL250-1 Range DL260 Range
A aaa aaa
V-memory
V
All See memory map
Pointer
P
-
Constant
K
0-FFFFFFFF
All See memory map All V-memory. See memory map 0-FFFFFFFF
Discrete Bit Flags aaa
All See memory map All V-memory. See memory map 0-FFFFFFFF aaa
All See memory map All V-memory. See memory map 0-FFFFFFFF
Description
SP60 SP61 SP62
On when the value in the accumulator is less than the instruction value On when the value in the accumulator is equal to the instruction value On when the value in the accumulator is greater than the instruction value
NOTE: The status flags are only valid until another instruction that uses the same flags is executed.
In the following example, when X1 is on, the value in V2000 and V2001 will be loaded into the accumulator using the Load Double instruction. The value in the accumulator is compared with the value in V2010 and V2011 using the CMPD instruction. The corresponding discrete status flag will be turned on indicating the result of the comparison. In this example, if the value in the accumulator is less than the value specified in the Compare instruction, SP60 will turn on, energizing contact C30. DirectSOFT X1
V2001
LDD
V2000
4
5
2
6
7
2
9
9
Acc. 4
5
? 2
6
77 72
9
9
2
6
V2000 Load the value in V2000 and V2001 into the accumulator
Compared with
CMPD V2010 6
Compare the value in the accumulator with the value in V2010 and V2011 SP60
7
3
9
5
V2011
0
V2010
C30
OUT Handheld Programmer Keystrokes $
B
STR
1
ENT
SHFT
L ANDST
D
SHFT
C
SHFT
M ORST
P
SHFT
SP STRN
G
SHFT
C
D
$
STR
GX OUT
5-84
DL230 Range
CMPD A aaa
2
3
D
C
3
2
CV 6 3
D A A
2
A
0
C
3 0 0
A
0 2
ENT ENT
DL205 User Manual, 4th Edition, Rev. D
A A
0 0
ENT B
1
A
0
ENT
Page 309
Chapter 5: Standard RLL Instructions
Compare Formatted (CMPF)
1 2 result of the comparison. 3 Operand Data Type DL250-1 Range DL260 Range A aaa bbb aaa bbb 4 5 6 7 8 Discrete Bit Flags Description 9 10 NOTE: Status flags are valid only until another instruction uses the same flag. In the following example, when X1 is on the Load Formatted instruction loads the binary 11 value (6) from C10–C13 into the accumulator. The CMPF instruction compares the value in the accumulator to the value in Y20–Y23 (E hex). The corresponding discrete status flag 12 will be turned on indicating the result of the comparison. In this example, if the value in the accumulator is less than the value specified in the Compare instruction, SP60 will turn on, 13 energizing C30. 14 A B C D
Compare Formatted compares the value in the 230 The accumulator with a specified number of discrete locations 240 (1–32). The instruction requires a starting location (Aaaa) 250-1 and the number of bits (Kbbb) to be compared. The 260 corresponding status flag will be turned on indicating the
CMPF
A aaa
K bbb
DS Used HPP Used
Inputs Outputs Control Relays Stage bits Timer bits Counter bits Special Relays Global I/O Constant
SP60 SP61 SP62
X Y C S T CT SP GX/GY K
0–777 0–777 0–1777 0–1777 0–377 0–177 0-777 -
– – – – – – – – 1–32
0–1777 0–1777 0–3777 0–1777 0–377 0–377 0–777 0-3777 -
– – – – – – – – 1–32
On when the value in the accumulator is less than the first level value in the Accumulator Stack. On when the value in the accumulator is equal to the first level value in the Accumulator Stack On when the value in the accumulator is greater than the first level value in the Accumulator Stack.
DirectSOFT X1
LDF
C10
K4
CMPF
Y20
K4
SP60
C30
OUT
Load the value of the specified discrete locations (C10- C13) into the accumulator Compare the value in the accumulator with the value of the specified discrete location (Y20- Y23)
Location
Constant
C10
K4
C13 C12 C11 C10
OFF ON ON OFF
The unused accumulator bits are set to zero Acc.
Y23 Y22 Y21 Y20
0
0
0
0
0
0
0
6
Compared with
ON ON ON OFF
E
DL205 User Manual, 4th Edition, Rev. D
5-85
Page 310
Chapter 5: Standard RLL Instructions
1
2
3 4 5 6 7 8 9 10 11 12 13 14 A B C D
Compare with Stack (CMPS) 230 240 250-1 260
DS Used HPP Used
The Compare with Stack instruction is a 32-bit instruction that compares the value in the accumulator with the value in the first level of the accumulator stack. The corresponding status flag will be turned on indicating the result of the comparison. This does not affect the value in the accumulator. Discrete Bit Flags
Description
On when the value in the Accumulator is less than the first level value in the Accumulator Stack On when the value in the Accumulator is equal to the first level value in the Accumulator Stack On when the value in the Accumulator is greater than the first level value in the Accumulator Stack
SP60 SP61 SP62
NOTE: Status flags are valid only until another instruction uses the same flag.
In the following example when X1 is on, the value in V1400 and V1401 is loaded into the accumulator using the Load Double instruction. The value in V1410 and V1411 is loaded into the accumulator using the Load Double instruction. The value that was loaded into the accumulator from V1400 and V1401 is placed on top of the stack when the second Load instruction is executed. The value in the accumulator is compared with the value in the first level of the accumulator stack using the CMPS instruction. The corresponding discrete status flag will be turned on indicating the result of the comparison. In this example, if the value in the accumulator is less than the value in the stack, SP60 will turn on, energizing C30. DirectSOFT
X1
LDD V1400 LDD V1410
SP60
6
5
0
0
3
5
4
4
Load the value in V1410 and V1411 into the accumulator
Acc. 6
5
0
0
3
5
4
4
V1411
C30
OUT
B
STR
1
ENT
SHFT
L ANDST
D
SHFT
L ANDST
D
SHFT
C
SHFT
M ORST
P
SHFT
SP STRN
G
C
D
$
STR
2
3 3
SHFT
D D
B
3
B
3
2
5
5
0
0
3
V1410 5 4 4
Acc. 5
5
0
0
3
5
4
4
Compared with Top of Stack
Handheld Programmer Keystrokes $
V1400
V1401
Load the value in V1400 and V1401 into the accumulator
Compare the value in the accumulator with the value in the first level of the accumulator stack
CMPS
GX OUT
5-86
C MP S
CV 6 3
1 1
E E
4 4
S RST
ENT
A
ENT
A
0 0
ENT
DL205 User Manual, 4th Edition, Rev. D
A B
0 1
A A
0 0
ENT ENT