The text of a manual · part 23 of 53
DL06 Micro PLC User Manual, Volume 1 of 2, pages 220 to 229
Pages 220 to 229 of 524
The original document is the PDF (6.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 AutomationDirect Direct Logic DL06 and Koyo DL06 D0-06DD1
Page 220
Chapter 5: Standard RLL Instructions - Accumulator/Stack Load and Output Data
Pop Instruction (cont’d)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 A B C D
In the example below, when C0 is on, the value 4545 that was on top of the stack is moved into the accumulator using the Pop instruction The value is output to V2000 using the OUT instruction. The next Pop moves the value 3792 into the accumulator and outputs the value to V2001. The last Pop moves the value 7930 into the accumulator and outputs the value to V2002. Please note if the value in the stack were greater than 16 bits (4 digits) the OUTD instruction would be used and 2 V-memory locations for each OUTD must be allocated. DirectSOFT 5 Direct SOFT32 POP
Acc. X
X
X
X
XX XX XX XX
0
44 55 44 55
Accumulator Stack
Current Acc. value Pop the 1st. value on the stack into the accumulator and move stack values up one location
Acc. 0
0
0
OUT V2000 V2000
4
5
4
5
Copy the value in the lower 16 bits of the accumulator to V2000
Level 1 Level 2
0 0 0
0 0 0
0 0
0 0
3 7
7 9
9 3
2 0
Level 3
X
X
X
X
X
X
X
X
Level 4
X
X
X
X
X
X
X
X
Level 5
X
X
X
X
X
X
X
X
Level 6
X
X
X
X
X
X
X
X
Level 7
X
X
X
X
X
X
X
X
Level 8
X
X
X
X
X
X
X
X
Level 1
0
0
0
0
7
9
3
0
Level 2
X
X
X
X
X
X
X
X
Level 3
X
X
X
X
X
X
X
X
Level 4
X
X
X
X
X
X
X
X
Level 5
X
X
X
X
X
X
X
X
Level 6
X
X
X
X
X
X
X
X
Level 7
X
X
X
X
X
X
X
X
Level 8
X
X
X
X
X
X
X
X
Level 1
X
X
X
X
X
X
X
X
Level 2
X
X
X
X
X
X
X
X
Level 3
X
X
X
X
X
X
X
X
Level 4
X
X
X
X
X
X
X
X
Level 5
X
X
X
X
X
X
X
X
Level 6
X
X
X
X
X
X
X
X
Level 7
X
X
X
X
X
X
X
X
Level 8
X
X
X
X
X
X
X
X
POP Previous Acc. value Acc. 0 Pop the 1st. value on the stack into the accumulator and move stack values up one location
0
0
0
44 55 44 55
0
3
Accumulator Stack
Current Acc. value Acc. 0
0
0
7
9
2
OUT V2001 Copy the value in the lower 16 bits of the accumulator to V2001
V2001
3
7
9
2
POP
Previous Acc. value
Pop the 1st. value on the stack into the accumulator and move stack values up one location
Acc. 0
0
0
0
3
7
9
2
0
7
9
3
0
Accumulator Stack
Current Acc. value Acc. 0
OUT
0
0
V2002 Copy the value in the lower 16 bits of the accumulator to V2002 V2002
7
9
Handheld Programmer Keystrokes $ STR SHFT
P CV
GX OUT SHFT
P CV
GX OUT SHFT GX OUT
5–66
Previous Acc. value
C0
P CV
SHFT
C
A
SHFT
O INST#
P
SHFT
V AND
C
SHFT
O INST#
P
SHFT
V AND
C
SHFT
O INST#
P
SHFT
V AND
C
2
0 CV
ENT ENT A
2 CV
A 0
A
A 0
ENT
B 0
1
ENT
ENT A
2
0
ENT
2 CV
A 0
A 0
C 0
2
ENT
DL06 Micro PLC User Manual, 3rd Edition Rev. A
3
0
Page 221
Chapter 5: Standard RLL Instructions - Accumulator/Stack Load and Output Data
Out Indexed (OUTX) DS5
Used
HPP
Used
1 2 3 Operand Data Type DL06 Range 4 aaa 5 Discrete Bit Flags Description 6 In the following example, when X1 is on, the constant value 3544 is loaded into the 7 accumulator. This is the value that will be output to the specified offset V-memory location (V1525). The value 3544 will be placed onto the stack when the LDA instruction is executed. 8 Remember, two consecutive LD instructions places the value of the first load instruction onto the stack. The LDA instruction converts octal 25 to HEX 15 and places the value in the accumulator. The OUTX instruction outputs the value 3544 which resides in the first level of 9 the accumulator stack to V1525. 10 11 12 13 14 A B C D The OUTX instruction is a 16 bit instruction. It copies a 16 bit or 4 digit value from the first level of the accumulator stack to a source address offset by the value in the accumulator(V-memory + offset).This instruction interprets the offset value as a HEX number. The upper 16 bits of the accumulator are set to zero. ....................................A V-memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . V Pointer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . P
See memory map See memory map
SP53
On if CPU cannot solve the logic.
DirectSOFT DirectSOFT32 5 X1
O UT X A aaa
Constant
LD
3
5
4
4
5
4
4
K3544
The unused accumulator bits are set to zero
Load the accumulator with the value 3544
0
Acc.
0
0
0
3
Octal
LDA
2
O25
Load the HEX equivalent to octal 25 into the lower 16 bits of the accumulator. This is the offset for the Out Indexed instruction, which determines the final destinaltion address
HEX
5
0
0
1
5
1
5
The unused accumulator bits are set to zero Acc.
0
0
+ 2
V
V1500
1
5
0
0
0
0
=
V 1
5
2
5
3
5
4
4
Octal
Octal
OUTX
0
0
5
Octal
Accumulator Stack
The hex 15 converts to 25 octal, which is added to the base address of V1500 to yield the final answer
Copy the value in the first level of the stack to the offset address 1525 (V1500+25)
V1525
Handheld Programmer Keystrokes $
B
STR
1
SHFT
L ANDST
D
SHFT
L ANDST
D
SHFT
X SET
GX OUT
ENT
PREV
3
A
3
F
D
3
5
F
C
0
5
2
B
F 1
E
A 5
E
4
ENT
0
0
0
0
3
5
4
4
Level 2
X
X X
X
X
X X
X
Level 3
X
X X
X
X
X X
X
Level 4
X
X X
X
X
X X
X
Level 5
X
X X
X
X
X X
X
Level 6
X
X X
X
X
X X
X
Level 7
X
X X
X
X
X X
X
Level 8
X
X X
X
X
X X
X
ENT
A 0
4
Level 1
0
ENT
DL06 Micro PLC User Manual, 3rd Edition Rev. A
5–67
Page 222
Chapter 5: Standard RLL Instructions - Accumulator/Stack Load and Output Data
Out Least (OUTL)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 A B C D
DS5
Used
HPP
Used
The OUTL instruction copies the value in the lower eight bits of the accumulator to the lower eight bits of the specified V-memory location (i.e., it copies the low byte of the low word of the accumulator). Operand Data Type
O UT L A aaa
DL06 Range aaa
....................................A V-memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . V
See memory map
In the following example, when X1 is on, the value in V1400 will be loaded into the lower 16 bits of the accumulator using the LD instruction. The value in the lower 8 bits of the accumulator are copied to V1500 using the OUTL instruction. DirectSOFT 5
Direct SOFT32 X1
V1400
Load the value in V1400 into the lower 16 bits of the accumulater
V1500
Copy the value in the lower 8 bits of the accumulator to V1500
LD
OUTL
V1400 8
9
3
5
9
3
5
0
3
5
The unused accumulator bits are set to zero Acc.
0
0
0
0
8
Handheld Programmer Keystrokes $
B STR
SHFT GX OUT
1 L ANDST
D
SHFT
L ANDST
ENT B
E
3
1 B
A 4
F 1
A 5
0
A 0
0 A
0
0
ENT V1500 ENT
Out Most (OUTM) DS5
Used
HPP
Used
5–68
The OUTM instruction copies the value in the upper eight bits of the lower sixteen bits of the accumulator to the upper eight bits of the specified V-memory location (i.e., it copies the high byte of the low word of the accumulator). Operand Data Type
O UT M A aaa
DL06 Range aaa
....................................A V-memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . V
See memory map
In the following example, when X1 is on, the value in V1400 will be loaded into the lower 16 bits of the accumulator using the LD instruction. The value in the upper 8 bits of the lower 16 bits of the accumulator are copied to V1500 using the OUTM instruction. DirectSOFT 5 Direct SOFT32 X1
Load the value in V1400 into the lower 16 bits of the accumulator
LD V1400
Copy the value in the upper 8 bits of the lower 16 bits of the accumulator to 1500
OUTM V1500
V1400 8
9
3
5
9
3
5
9
0
0
The unused accumulator bits are set to zero Acc.
0
0
0
0
8
Handheld Programmer Keystrokes $
B STR
1
SHFT
L ANDST
D
GX OUT
SHFT
M ORST
8
ENT
V1500 B
3
E 1
B
A 4
F 1
A 0
A 5
0 A
0
0
ENT ENT
DL06 Micro PLC User Manual, 3rd Edition Rev. A
Page 223
Chapter 5: Standard RLL Instructions - Logical
Logical Instructions (Accumulator)
1 The AND instruction is a 16 bit instruction that logically 2 ANDs the value in the lower 16 bits of the accumulator with a specified V-memory location (Aaaa). The result resides in the 3 accumulator. The discrete status flag indicates if the result of the AND is zero. 4 Operand Data Type DL06 Range aaa 5 6 Discrete Bit Flags Description 7 NOTE: Status flags are valid only until another instruction uses the same flag. 8 In the following example, when X1 is on, the value in V2000 will be loaded into the accumulator using the LD instruction. The value in the accumulator is ANDed with the 9 value in V2006 using the AND instruction. The value in the lower 16 bits of the accumulator is output to V2010 using the OUT instruction. 10 11 12 13 14 A B C D
And (AND logical) DS5
Used
HPP
Used
AND
A aaa
....................................A V-memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . V Pointer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . P
SP63 SP70
See memory map See memory map
Will be on if the result in the accumulator is zero. ON when the value loaded into the accumulator is zero.
DirectSOFT 5
Direct SOFT32 X1
V2000
LD
V2000
Load the value in V2000 into the lower 16 bits of the accumulator
2
8
7
A
The upper 16 bits of the accumulator will be set to 0
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
1
0
0
0
0
1
1
1
1
0
1
0
AND
V2006
AND 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
1
0
0
0
0
1
1
1
1
0
1
0
6A38 AND (V2006)
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
1
1
1
0
0
0
Acc.
0
0
0
0
0
0 1
0
0
0
0
0
0
0
0
0
0
0
0
1
0
1
0
0
0
0
0
1
1
1
0
0
0
2
8
3
8
OUT
V2010
Copy the lower 16 bits of the accumulator to V2010
V2010
Handheld Programmer Keystrokes $
B
STR SHFT V AND GX OUT
1
L ANDST
ENT
A
C
D
2
3
SHFT
V AND
C
SHFT
V AND
C
A
0
A
2
A
0
A
2
A
0
G
0
B
0
0
6
A
1
0
ENT ENT ENT
DL06 Micro PLC User Manual, 3rd Edition Rev. A
5–69
Page 224
Chapter 5: Standard RLL Instructions - Logical
And Double (ANDD)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 A B C D
DS5
Used
HPP
Used
ANDD is a 32 bit instruction that logically ANDs the value in the accumulator with two consecutive V-memory locations or an 8 digit (max.) constant value (Aaaa). The result resides in the accumulator. Discrete status flags indicate if the result of the ANDD is zero or a negative number (the most significant bit is on). Operand Data Type
DL06 Range aaa
V-memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . V Pointer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . P Constant . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . K
See memory map See memory map 0–FFFFFFFF
Discrete Bit Flags
Description
SP63 SP70
Will if the result in the accumulator is zero. Will if the result in the accumulator is negative
NOTE: Status flags are valid only until another instruction uses the same flag.
In the following example, when X1 is on, the value in V2000 and V2001 will be loaded into the accumulator using the LDD instruction. The value in the accumulator is ANDed with 36476A38 using the ANDD instruction. The value in the accumulator is output to V2010 and V2011 using the OUTD instruction.
DirectSOFT 5
V2000
X1
5
LDD
4
? 7
V2000 E
2
8
7
A
V2000 Load the value in V2000 and V2001 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
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
AND 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
0
0
0
1
0
0
1 0
0
0
0
1 0
1 0
0
0
1
0
1
0
0
0
0
4
4
6
2
8
3
8
4 3
2
1
0
1
0
1
0
1
1
0
1
0
0
1 1
1
0
0
0
0
1 1
1
0
0
0
1 1
ANDD K36476A38 AND the value in the accumulator with the constant value 36476A38
1 0
0
0
OUTD V2010
1
V2011
Copy the value in the accumulator to V2010 and V2011
V2010
Handheld Programmer Keystrokes $
B STR
SHFT V AND GX OUT
5–70
ANDD K aaa
1 L ANDST
D
SHFT
D
SHFT
D
ENT D
3 3 3
C 3
A
SHFT
K JMP
D
C
A
B
2
0
A 0
2
A 0
G 3
6 A
1
0 E
0
ENT H
4
G 7
6
SHFT
ENT
DL06 Micro PLC User Manual, 3rd Edition Rev. A
A 0
SHFT
D
I 3
8
ENT
Page 225
Chapter 5: Standard RLL Instructions - Logical
And Formatted (ANDF) The ANDF instruction logically ANDs the binary value in the accumulator with a specified range of discrete memory bits (1–32). The instruction requires a starting location (Aaaa) and number of bits (Kbbb) to be ANDed. Discrete status flags indicate if the result is zero or a negative number (the most significant bit =1).
SHFT
L ANDST
V AND
SHFT
1 2 3 Operand Data Type DL06 Range aaa bbb 4 5 6 7 Discrete Bit Flags Description 8 9 NOTE: Status flags are valid only until another instruction uses the same flag. In the following example, when X1 is on the LDF instruction loads C10–C13 (4 binary bits) 10 into the accumulator. The accumulator contents is logically ANDed with the bit pattern from Y20–Y23 using the ANDF instruction. The OUTF instruction outputs the accumulator’s 11 lower four bits to C20–C23. 12 13 14 A B C D
GX OUT
SHFT
F
DS5
Used
HPP
Used
....................................B Inputs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . X Outputs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Y Control Relays . . . . . . . . . . . . . . . . . . . . . . . . . . C Stage Bits . . . . . . . . . . . . . . . . . . . . . . . . . . . . . S Timer Bits . . . . . . . . . . . . . . . . . . . . . . . . . . . . . T Counter Bits . . . . . . . . . . . . . . . . . . . . . . . . . . CT Special Relays . . . . . . . . . . . . . . . . . . . . . . . . . SP Constant . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . K
SP63 SP70
ANDF A aaa K bbb
0-777 0-777 0-1777 0-1777 0-377 177 0-777 -
1-32
ON if the result in the accumulator is zero. ON if the result in the accumulator is negative
DirectSOFT 5 DirectSOFT32
Location
Constant
K4
C10
K4
Load the status of 4 consecutive bits (C10-C13) into the accumulator
The unused accumulator bits are set to zero
C10
LDF
ANDF
C13 C12 C11 C10 ON ON ON OFF
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
1
0
Y20
K4
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 1
1
0
0
0
0 0
0
0
0
0 0
0
0
0
0 1
0
0
0
Accumulator
And the binary bit pattern (Y20-Y23) with the value in the accumulator
0
Acc.
0 0
0
0
0
0
Y23 Y22 Y21 Y20 ON OFF OFF OFF
AND (Y20-Y23)
C20
OUTF
1
K4
Copy the value in the lower 4 bits in accumulator to C20-C23
Location
Handheld Programmer Keystrokes $
B
STR
1
D
C20
F
5 5
C23 C22 C21 C20
K4
ON OFF OFF OFF
ENT
F
3
Constant
NEXT
NEXT
NEXT
C
A
PREV
PREV
5
2
NEXT
0
C
B
E
ENT
4
A 2
NEXT
A
1
E 0
4
E
0
4
1 ndard RLL
X1
ENT
ENT
DL06 Micro PLC User Manual, 3rd Edition Rev. A
5–71
Page 226
Chapter 5: Standard RLL Instructions - Logical
And with Stack (ANDS)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 A B C D
DS5
Used
HPP
Used
The ANDS instruction is a 32 bit instruction that logically ANDs 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 ANDS is zero or a negative number (the most significant bit is on). Discrete Bit Flags
ANDS
Description
SP63 SP70
ON if the result in the accumulator is zero. ON if the result in the accumulator is negative
NOTE: Status 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 ANDed with the binary value in the first level or the accumulator stack. The result resides in the accumulator. The 32 bit value is then output to V1500 and V1501.
DirectSOFT 5
DirectSOFT32 X1
V1401
LDD 5
V1400
4
7
E
2
V1400 8 7
A
Load the value in V1400 and 1401 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.
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
(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
Acc.
0
0
0 0 1
0
0
0 0
1 0
0
0 0 1
1 0
0
0
1 0
1
0
0 0
0
1
1 0
0 0
4
6
8
8
ANDS
AND the value in the accumulator with the first level of the accumulator stack
36476A38 AND
1
1
0
0
1
0
0
0
0
OUTD V1500 1
Copy the value in the accumulator to V1500 and 1501
4
V1501
Handheld Programmer Keystrokes $
B STR
1
ENT
SHFT
L ANDST
D 3
3
V AND
SHFT
S RST
ENT
SHFT
D
GX OUT
5–72
D
B
B 3
E 1
F 1
A 4
A 5
A 0
A 0
0
0
ENT
ENT
DL06 Micro PLC User Manual, 3rd Edition Rev. A
2
3
V1500
1
Page 227
Chapter 5: Standard RLL Instructions - Logical
Or (OR) DS5
Used
HPP
Used
The Or instruction is a 16 bit instruction that logically ORs the value in the lower 16 bits of the accumulator with a specified Vmemory location (Aaaa). The result resides in the accumulator. The discrete status flag indicates if the result of the OR is zero. Operand Data Type
OR A aaa
DL06 Range aaa
....................................A V-memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . V Pointer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . P
See memory map See memory map
Discrete Bit Flags
Description
SP63 SP70
ON if the result in the accumulator is zero. ON if the result in the accumulator is negative
NOTE: Status flags are valid only until another instruction uses the same flag.
In the following example, when X1 is on, the value in V2000 will be loaded into the accumulator using the Load instruction. The value in the accumulator is ORed with V2006 using the OR instruction. The value in the lower 16 bits of the accumulator are output to V2010 using the Out instruction. DirectSOFT 5 Direct SOFT32 X1
V2000
LD V2000
2
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
1
0
0
0
0
1
1
1
1
0
1
0
V2006
Acc.
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
1
0
0
0
0
1
1
1
1
0
1
0
Or the value in the accumulator with the value in V2006
6A38 OR (V2006)
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
1
1
1
0
0
0
Acc.
0
0
0
0
0
0 1
0
0
0
0
0
0
0
0
0
0
0
1
1
0
1
0
1
0
0
1
1
1
1
0
1
0
6
A
7
A
OR
OUT V2010 Copy the value in the lower 16 bits of the accumulator to V2010 Handheld Programmer Keystrokes $
B STR
SHFT Q OR GX OUT
1 L ANDST
V2010
ENT
D
C 3
A 2
SHFT
V AND
C
SHFT
V AND
C
A 0
A 2
A 0
A 2
A 0 0
B 0
0 G 6 A
1
0
ENT ENT ENT
DL06 Micro PLC User Manual, 3rd Edition Rev. A
1 2 3 4 5 6 7 8 9 10 11 12 13 14 A B C D
5–73
Page 228
Chapter 5: Standard RLL Instructions - Logical
Or Double (ORD)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 A B C D
DS5
Used
HPP
Used
ORD is a 32 bit instruction that logically ORs the value in the accumulator with the value (Aaaa), which is either two consecutive V-memory locations or an 8 digit (max.) constant value. The result resides in the accumulator. Discrete status flags indicate if the result of the ORD is zero or a negative number (the most significant bit is on). Operand Data Type
ORD K aaa
DL06 Range aaa
V-memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . V Pointer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . P Constant . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . K
See memory map See memory map 0–FFFFFFFF
Discrete Bit Flags
Description
SP63 SP70
ON if the result in the accumulator is zero. ON if the result in the accumulator is negative
NOTE: Status flags are valid only until another instruction uses the same flag.
In the following example, when X1 is on, the value in V2000 and V2001 will be loaded into the accumulator using the LDD instruction. The value in the accumulator is ORed with 36476A38 using the ORD instruction. The value in the accumulator is output to V2010 and V2011 using the OUTD instruction. DirectSOFT 5
Direct SOFT32 X1
V2001
LDD
5
V2000
4
7
V2000 E
2
8
7
A
Load the value in V2000 and V2001 into 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.
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
OR 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
0
1
1
1
0
0
0
Acc.
0
1 0
1 0
1 0
0
1
1 0
0
0
1 0
1 0
1 0
1 0
1 0
1 0
1 0
0
1
1
0
1
0
1
0
0
1
1
1
1
0
1
0
6
7
F
6
A
7
A
ORD K36476A38 OR the value in the accumulator with the constant value 36476A38 OUTD V2010 7
Copy the value in the accumulator to V2010 and V2011
V2011
V2010
Handheld Programmer Keystrokes $
B STR
1
SHFT
L ANDST
D
Q
SHFT
D
SHFT
D
OR GX OUT
5–74
ENT D
3 3 3
C 3
A 2
SHFT
K JMP
D
C
A
B
2
0
A 0
A 0
G 3
E 6
A 1
0
0
ENT H
4
G 7
6
SHFT
A
ENT
DL06 Micro PLC User Manual, 3rd Edition Rev. A
0
SHFT
D
I 3
8
ENT
Page 229
Chapter 5: Standard RLL Instructions - Logical
Or Formatted (ORF) DS5
Used
HPP
Used
The ORF instruction logically ORs the binary value in the accumulator and a specified range of discrete bits (1–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).
ORF
A aaa K bbb
Operand Data Type
DL06 Range
A/B Inputs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . X Outputs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Y Control Relays . . . . . . . . . . . . . . . . . . . . . . . . . . C Stage Bits . . . . . . . . . . . . . . . . . . . . . . . . . . . . . S Timer Bits . . . . . . . . . . . . . . . . . . . . . . . . . . . . . T Counter Bits . . . . . . . . . . . . . . . . . . . . . . . . . . CT Special Relays . . . . . . . . . . . . . . . . . . . . . . . . . SP Constant . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . K
Discrete Bit Flags aaa bbb
0-777 0-777 0-1777 0-1777 0-377 0-177 0-777 -
-------1-32
Description
SP63 SP70
ON if the result in the accumulator is zero. ON if the result in the accumulator is negative
NOTE: Status flags are valid only until another instruction uses the same flag.
In the following example, when X1 is on the LDF instruction loads C10–C13 (4 binary bits) into the accumulator. The ORF instruction logically ORs the accumulator contents with Y20–Y23 bit pattern. The ORF instruction outputs the accumulator’s lower four bits to C20–C23. DirectSOFT 5 DirectSOFT32 X1
LDF
C10 K4
Load the status fo 4 consecutive bits (C10-C13) into the accumulator ORF
Constant
C13 C12 C11 C10
K4
OFF ON ON OFF
The unused accumulator bits are set to zero
Y20 Acc.
K4 OR the binary bit pattern (Y20 - Y23) with the value in the accumulator OUTF
Location C10
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
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
0
Y23 Y22 Y21 Y20 OR (Y20- Y23)
C20
Acc.
K4
ON OFF OFF OFF 0
0
0
0 0
0
0
0
Copy the specified number of bits from the accumulator to C20-C23 Handheld Programmer Keystrokes $
B STR
1
SHFT
L ANDST
D
Q
SHFT
F
SHFT
F
OR GX OUT
ENT F
3 5 5
NEXT
NEXT
NEXT
C
A
PREV
PREV
5
2
NEXT
0 2
B
E
ENT
4 A
C
NEXT
A 1
E 0
4
E 0
4
Location
Constant
C23 C22 C21 C20
C20
K4
ON ON ON OFF
ENT
1 2 3 4 5 6 7 8 9 10 11 12 13 14 A B C D
ENT
DL06 Micro PLC User Manual, 3rd Edition Rev. A
5–75