The text of a manual · part 27 of 36
DL305 User Manual, pages 257 to 266
Pages 257 to 266 of 356
The original document is the PDF (3.2 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 GE DL330 / D3-330, Fanuc DL330 / D3-330 and GE Fanuc DL330 / D3-330
Page 257
11–19
Instruction Set Comparative Boolean Instructions
Comparative Boolean Instructions The Store If Equal instruction begins a new rung or additional branch in a rung with a normally open comparative counter contact. The contact will be on if the specified counter CT aaa = B bbbb.
CTaaa
Instruction Set
Store If Equal (STR) DL330/DL340 Only
B bbbb
CT
Store Not If Equal (STR NOT) DL330/DL340 Only
The Store Not If Equal instruction begins a new rung or additional branch in a rung with a normally closed comparative counter contact. The contact will be on if the specified counter CT aaa B bbbb. Operand Data Type
CT aaa
D3–330 Range
B bbbb
D3–340 Range
D3–330P Range*
B aaa bbbb aaa bbbb aaa bbbb
Counters
CT
600–677
––
600–677
––
––
––
Data registers
R
––
400–577
––
400–577 700–777
––
––
Constant
K
––
0–9999
––
0–9999
––
––
* See Chapter 12 for similar RLL PLUS instructions In the following Store If Equal example, when CT600 = 2510 output 012 will energize. DirectSOFT Display CT600
K2510
Handheld Programmer Keystrokes 012 OUT
STR SHF
SHF 2
6 5
0 1
0 0
ENT ENT
OUT
SHF
0
1
2
ENT
In the following Store Not If Equal example, when CT600 is the value in R400 output 020 will energize. DirectSOFT Display CT600
R400
Handheld Programmer Keystrokes 020 OUT
STR R
NOT 4
SHF 0
6 0
0 ENT
0
OUT
SHF
0
1
2
ENT
ENT
Page 258
Instruction Set
11–20
Instruction Set Comparative Boolean Instructions
Or If Equal (OR) DL330/DL340 Only
Or Not If Equal (OR NOT) DL330/DL340 Only
The Or If Equal instruction connects a normally open comparative counter contact in parallel with another contact. The contact will be on if the specified counter CT aaa = B bbbb. The Or Not If Equal instruction connects a normally closed comparative counter contact in parallel with another contact. The contact will be on if the specified counter CT aaa B bbbb. Operand Data Type
D3–330 Range
CT aaa
B bbbb
CT aaa
B bbbb
D3–340 Range
D3–330P Range*
B aaa bbbb aaa bbbb aaa bbbb
Counters
CT
600–677
––
600–677
––
––
––
Data registers
R
––
400–577
––
400–577 700–777
––
––
Constant
K
––
0–9999
––
0–9999
––
––
* See Chapter 12 for similar RLL PLUS instructions In the following Or If Equal example, when input contact 001 is on or CT600 = 2510 output 012 will energize. DirectSOFT Display
Handheld Programmer Keystrokes 012
001
OUT CT600
K2510
STR OR SHF
SHF SHF 2
1 6 5
ENT 0 1
0 0
ENT ENT
OUT
SHF
0
1
2
ENT
In the following Or Not If Equal example, when input contact 001 is on or CT600 the value in R400 output 012 will energize. DirectSOFT Display
Handheld Programmer Keystrokes 012
001
OUT CT600
R400
STR OR R
SHF NOT 4
1 6 0
ENT 0 0
0 ENT
ENT
OUT
SHF
0
1
2
ENT
Page 259
11–21
Instruction Set Comparative Boolean Instructions
The And If Equal instruction connects a normally open comparative counter contact in series with another contact. The contact will be on if the specified counter CT aaa = B bbbb.
And Not If Equal (AND NOT) DL330/DL340 Only
The And Not If Equal instruction connects a normally closed comparative counter contact in series with another contact. The contact will be on if the specified counter CT aaa B bbbb. Operand Data Type
D3–330 Range
CT aaa
B bbbb
CT aaa
B bbbb
D3–340 Range
D3–330P Range*
B aaa bbbb aaa bbbb aaa bbbb
Counters
CT
600–677
––
600–677
––
––
––
Data registers
R
––
400–577
––
400–577 700–777
––
––
Constant
K
––
0–9999
––
0–9999
––
––
* See Chapter 12 for similar RLL PLUS instructions In the following And If Equal example, when input contact 001 is on and CT600 = 2510 the contact will turn on and output 012 will energize. DirectSOFT Display 001
Handheld Programmer Keystrokes CT600
K2510
012 OUT
STR AND SHF
SHF SHF 2
1 6 5
ENT 0 1
0 0
ENT ENT
OUT
SHF
0
1
2
ENT
In the following And Not If Equal example, when input contact 001 is on and CT600 the value in R400 output 012 will energize. DirectSOFT Display 001
Handheld Programmer Keystrokes CT600
R400
012 OUT
STR AND R
SHF NOT 4
1 6 0
ENT 0 0
0 ENT
ENT
OUT
SHF
0
1
2
ENT
Instruction Set
And If Equal (AND) DL330/DL340 Only
Page 260
11–22
Instruction Set Timer, Counter, and Shift Register Instructions
Instruction Set
Timer, Counter, and Shift Register Instructions Timer (TMR) DL330/DL340 Only
The Timer instruction provides a single input timer with a 0.1 second increment (0–999.9 seconds) in the normal operating mode, or a 0.01 second increment (0–99.99 seconds) in the fast timer mode when relay 770 is turned on. The timer will time up to 9999 and stop. It will reset to zero when the input is turned off. The discrete bit associated with the timer will be on when the current value is equal to or greater than the preset value. Operand Data Type
TMR
D3–330 Range
T aaa Bbbbb
D3–340 Range
D3–330P Range
B aaa bbbb aaa bbbb aaa bbbb
Timers
T
600–677
––
600–677
––
––
––
Data registers
R
––
400–577
––
400–577 700–777
––
––
Constant
K
––
0–9999
––
0–9999
––
––
* See Chapter 12 for similar RLL PLUS instructions In the following Timer example, timer 600 will begin timing up when input 000 turns on. The timer bit associated with timer 600 will turn on when the current value in timer 600 is - the preset value K30 (3 seconds). When input 000 turns off the timer discrete bit and current value are reset. DirectSOFT Display
Handheld Programmer Keystrokes
000
TMR
STR TMR K
T600 K30
T600
SHF SHF 3
0 6 ENT
ENT 0
10 OUT
Timing Diagram
0
1
2
3
4
5
6
7
0
10
20
30
40
50
60
8
000
010 Current Value
0
0
ENT
Page 261
11–23
Instruction Set Timer, Counter, and Shift Register Instructions
The Counter instruction provides a counter with a count and reset input. The range of this counter is 0–9999 and it will increment when the count input transitions from off to on. The counter is reset to 0 when you turn on the reset input. The counter bit associated with the counter will turn on when the current value is equal to or greater than the preset value. Operand Data Type
COUNT aaa
Counters
CT
Data registers
R
Constant
K
CTaaa Bbbbb
RESET
D3–330 Range B
CNT
Instruction Set
Counter (CNT) DL330/DL340 Only
D3–340 Range bbbb aaa
600–677
––
––
400–577
––
0–9999
D3–330P Range bbbb aaa bbbb
600–677
––
––
––
––
400–577 700–777
––
––
––
0–9999
––
––
* See Chapter 12 for similar RLL PLUS instructions In the following Counter example, counter 604 will increment by one count when input 000 transitions from off to on. When input contact 001 is turned on the counter will reset to zero. The counter bit associated with counter 604 will turn on when the current value in counter 604 is - the preset constant value K3 (3). DirectSOFT Display
Handheld Programmer Keystrokes
STR STR CNT SHF
000 CNT
CT604 K3
001
CT604
SHF SHF SHF 3
0 1 6 ENT
ENT ENT 0
10 OUT
000
001
010 Current Value
1
2
3
4
0
4
ENT
Page 262
Instruction Set
11–24
Instruction Set Timer, Counter, and Shift Register Instructions
Shift Register (SR) DL330/340 Only
The Shift Register instruction shifts data through a predefined number of shift register bits. There are 128 bits allocated for use in shift registers. There is no limit to the number of shift registers which can be used in a program, however the total number of bits used cannot exceed 128. The Shift Register has three contacts. S Data, determines the value (1 or 0) that will enter the register S Clock, shifts the bits one position on each off to on transition S Reset, resets the Shift Register to all zeros.
DATA
SR From A aaa
CLOCK To
B bbb
RESET
With each off to on transition of the clock input, the bits which make up the shift register block are shifted by one bit position and the status of the data input is shifted into the starting bit position in the block. The direction of the shift depends on the entry in the From and To fields. From 400 to 407 would define a block of eight bits to be shifted from bit 400 to bit 407. From 407 to 400 would also define a block of eight bits, but would shift from bit 407 to bit 400. The maximum size of the shift register block is limited to 128 bits. There is no minimum block size. Operand Data Type
D3–330 Range
Shift Register Bits
D3–340 Range bbbb aaa bbbb aaa bbbb
400–577
400–577
400–577
400–577
––
––
DirectSOFT Display 000
Handheld Programmer Keystrokes
Data Input
001
SR
From
400
To
417
Clock Input
002
D3–330P Range aaa
STR STR STR SR SHF
SHF SHF SHF SHF 4
0 1 2 4 1
Reset Input
Inputs on Successive Scans Data
Clock
Reset
1
1
0
0
1
0
0
1
0
1
1
0
0
1
0
0
0
1
- indicates on
Shift Register Bits 400
417
- indicates off
ENT ENT ENT 0 7
0 ENT
ENT
Page 263
11–25
Instruction Set Accumulator Load and Output Instructions
Accumulator Load and Output Instructions The Data Store (F50) is a 16–bit instruction that loads the value of a 16–bit register, two consecutive 8–bit registers (specify starting location), or a 4–digit BCD value into the accumulator.
DSTR (F50) A aaaa
Data Out DOUT (F60)
The Data Out (F60) is a 16–bit instruction that copies the 16–bit value in the accumulator to a 16–bit reference or two consecutive 8–bit registers (specify starting location).
DOUT (F60) A aaaa
Data Type
D3–330 Range
D3–340 Range
A aaaa aaaa aaaa
Inputs / Outputs
R
000–014 070–075
000–014 070–075
000–014 070–075
Control Relays
R
016–036
016–036 100–105
016, 020–027
Shift Registers
R
040–056
040–056
––
Stages
R
––
––
100–116
Timer /Counters (16 bit)
R
600–677
600–677
600–677
Data Registers
R
400–577
400–577 700–777
400–577
*Constant (4–digit BCD)
K
0000–9999
0000–9999
0000–9999
Instruction Set
Data Store DSTR (F50)
D3–330P Range
* A constant is not a valid data type for the DOUT (F60) instruction.
In the following example, when input 000 is on the value (7502) in R402 and R403 is loaded into the accumulator using the Data Store (F50) instruction. The value in the accumulator is output to data registers R404 and R405 using the Data Out (F60) instruction. DirectSOFT Display 000
R 403
R 402
Handheld Programmer Keystrokes
7
0
2
STR F
SHF 5
0 0
ENT ENT
2
Accumulator
0
2
R F R
4 6 4
0 0 0
2 ENT 4
5
DSTR (F50) R 402 7
5
0
DOUT (F60) R 404 7
5
R405
ENT ENT
R404
In the following example, when input 001 is on the BCD constant value K7502 is loaded into the accumulator using the Data Store (F50) instruction. The value in the accumulator is output to data registers R404 and R405 using the Data Out (F60) instruction. DirectSOFT Display
K
001 DSTR (F50) K 7502 DOUT (F60) R 404
7
Handheld Programmer Keystrokes
7
5
0
2
7
5
0
2
Accumulator
0
2
5
R405
R404
STR F
SHF 5
1 0
ENT ENT
SHF F R
7 6 4
5 0 0
0 ENT 4
2 ENT
ENT
Page 264
Instruction Set
11–26
Instruction Set Accumulator Load and Output Instructions
Data Store 1 DSTR (F51)
The Data Store 1 (F51) is an 8–bit instruction that loads the value from a specified 8–bit register into the lower 8 bits of the accumulator. The upper 8 bits of the accumulator are set to zero.
DSTR1 (F51) R aaa
Data Out 1 DOUT (F61)
The Data Out 1 (F61) is an 8–bit instruction that copies the value in the lower 8 bits of the accumulator to a specified 8–bit register.
DOUT1 (F61) R aaa
Data Type
D3–330 Range
D3–340 Range
D3–330P Range aaaa aaaa aaaa
Inputs / Outputs
R
000–014 070–075
000–014 070–075
000–014 070–075
Control Relays
R
016–036
016–036 100–105
016, 020–027
Shift Registers
R
040–056
040–056
––
Stages
R
––
––
100–116
Data Registers
R
400–577
400–577 700–777
400–577
In the following example, when input 000 is on the value (89) in R410 is loaded into the lower 8 bits of the accumulator using the Data Store 1 (F51) instruction. The value in the least significant 8 bits of the accumulator is output to data register R500 using the Data Out 1 (F61) instruction. DirectSOFT Display
Handheld Programmer Keystrokes
000
R410
DSTR1 (F51) R 410 Load the value in register R410 into the accumulator
DOUT1 (F61) R 500 Copy the value in the accumulator to registers R500
0
0
8
9
8
9
8
9
R500
Accumulator
STR F
SHF 5
0 1
ENT ENT
R F R
4 6 5
1 1 0
0 ENT 0
ENT ENT
Page 265
11–27
Instruction Set Accumulator Load and Output Instructions
The Data Store 2 (F52) is a 4–bit instruction that loads the value of the most significant 4 bits of a specified 8–bit register into the least significant 4 bits of the accumulator. The remaining 12 bits of the accumulator are set to zero.
Data Out 2 DOUT (F62)
The Data Out 2 (F62) is a 4–bit instruction that copies the value in the least significant 4 bits of the accumulator into the most significant 4 bits of a specified 8–bit register. The lower 4 bits of the register are not altered . Data Type
DSTR2 (F52) R aaa
Instruction Set
Data Store 2 DSTR (F52)
DOUT2 (F62) R aaa
D3–330 Range
D3–340 Range aaaa aaaa
D3–330P Range aaaa
Inputs / Outputs
R
000–014 070–075
000–014 070–075
000–014 070–075
Control Relays
R
016–036
016–036 100–105
016, 020–27
Shift Registers
R
040–056
040–56
––
Stages
R
––
––
100–116
Data Registers
R
400–577
400–577 700–777
400–577
In the following example, when input 000 is on the most significant 4 bits of R1 are loaded into the lower 4 bits of the accumulator using the Data Store 2 (F52) instruction. The value in the least significant 4 bits of the accumulator is output to most significant 4 bits of data register R400 using the Data Out 2 (F62) instruction. DirectSOFT Display
Handheld Programmer Keystrokes
000
R001
DSTR2 (F52) R 001 Load the upper 4 bits in register 1 into the lower 4 bits of the accumulator DOUT2 (F62) R 400 Copy the lower 4 bits of the accumulator to the upper 4 bits or registers R400
5 0
0
*
0
5
5
*
R400
The lower 4 bits (*) of R1 are not loaded into the accumulator Accumulator The lower 4 bits (*) of R400 are not altered
STR F
SHF 5
0 2
ENT ENT
R F R
1 6 4
ENT 2 0
ENT 0
ENT
Page 266
Instruction Set
11–28
Instruction Set Accumulator Load and Output Instructions
Data Store 3 DSTR (F53)
The Data Store 3 (F53) is a 4–bit instruction that loads the value of the least significant 4 bits of a specified 8–bit register into the least significant 4 bits of the accumulator. The upper 12 bits of the accumulator are set to zero.
Data Out 3 DOUT (F63)
The Data Out 3 (F63) is a 4–bit instruction that copies the value in the least significant 4 bits of the accumulator to the least significant 4 bits of a specified 8 bit register. The upper 4 bits of the register are not altered. Data Type
DSTR3 (F53) R aaa
DOUT3 (F63) R aaa
D3–330 Range
D3–340 Range aaaa aaaa
D3–330P Range aaaa
Inputs / Outputs
R
000–014 070–075
000–014 070–075
000–014 070–075
Control Relays
R
016–036
016–036 100–105
016, 020–027
Shift Registers
R
040–056
040–056
––
Stages
R
––
––
100–116
Data Registers
R
400–577
400–577 700–777
400–577
In the following example, when input 000 is on the least significant 4 bits of R005 are loaded into the accumulator using the Data Store 3 (F53) instruction. The data in the least significant 4 bits of the accumulator is output to the least significant 4 bits of R016 using the Data Out 3 (F63) instruction. DirectSOFT Display
Handheld Programmer Keystrokes
000 DSTR3 (F53) R 005 Load the lower 4 bits in register 5 into the lower 4 bits of the accumulator DOUT3 (F63) R 016 Output the lower 4 bits of the accumulator to the lower 4 bits of R16
R005
The upper 4 bits (*) of R5 are not loaded into the accumulator 0
0
The upper 4 bits (*) of R400 are not altered
*
8
0
8
*
8
R016
Accumulator
STR F
SHF 5
0 3
ENT ENT
R F R
5 6 1
ENT 3 6
ENT ENT