The text of a manual · part 26 of 36
DL305 User Manual, pages 247 to 256
Pages 247 to 256 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 247
11–9
Instruction Set Boolean Instructions
Or Not Counter (OR NOT CNT) DL330/340 Only
The Or Counter instruction logically ors a normally open counter contact in parallel with another contact in a rung. The counter contact C aaa will be on when the counter current value is the preset value of the associated counter.
C aaa
The Or Not Counter instruction logically ors a normally closed counter contact in parallel with another contact in a rung. The counter contact C aaa will be on when the counter current value is < the preset value of the associated counter. Data Type
Counter
C
Instruction Set
Or Counter (OR CNT) DL330/340 Only
C aaa
D3–330 Range
D3–340 Range
D3–330P Range* aaa aaa aaa
600–677
600–677
––
* See Chapter 12 for similar RLL PLUS instructions In the following Or Counter example, when input 007 is on or the current value in C610 is the preset value output 025 will energize. DirectSOFT Display 007
Handheld Programmer Keystrokes 025 OUT
STR OR OUT
SHF CNT SHF
7 SHF 2
ENT 6 5
1 ENT
0
ENT
C610
In the following Or Not Counter example, when input location 007 is on or the current value in C610 is < the preset value output 025 will energize. DirectSOFT Display
007
Handheld Programmer Keystrokes 025 OUT
C610
STR OR OUT
SHF NOT SHF
7 CNT 2
ENT SHF 5
6 ENT
1
0
ENT
Page 248
Instruction Set
11–10
Instruction Set Boolean Instructions
And (AND)
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 (AND NOT)
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. Data Type aaa aaa
D3–330 Range
D3–340 Range aaa aaa
D3–330P Range aaa
Inputs / Outputs
000–167 700–767
000–177 700–767
000–167 700–767
Control Relays
160–373
160–373 1000–1067
160–174 200–77
Special Control Relays
374–377 770–777
374–377 770–777 1074–1077
175–177 770–777
Shift Register Bits
400–577
400–577
––
In the following And example, when input 000 and 001 is on output 010 will energize. DirectSOFT Display 000
Handheld Programmer Keystrokes 001
010 OUT
STR AND OUT
SHF SHF SHF
0 1 1
ENT ENT 0
ENT
In the following And Not example, when input 000 is on and 001 is off output 010 will energize. DirectSOFT Display 000
Handheld Programmer Keystrokes 001
010 OUT
STR AND OUT
SHF NOT SHF
0 SHF 1
ENT 1 0
ENT ENT
Page 249
11–11
Instruction Set Boolean Instructions
The And Timer instruction logically ands a normally open timer contact in series with another contact in a rung. The timer contact T aaa will be on when the timer current value the preset value of the associated timer.
And Not Timer (AND NOT TMR) DL330/340 Only
The And Not Timer instruction logically ands a normally closed timer contact in series with another contact in a rung. The timer contact T aaa will be on when the timer current value is < the preset value of the associated timer. Data Type
Timer
T
Instruction Set
And Timer (AND TMR) DL330/340 Only
T aaa
T aaa
D3–330 Range
D3–340 Range
D3–330P Range* aaa aaa aaa
600–677
600–677
––
* See Chapter 12 for similar RLL PLUS instructions In the following And Timer example, when input 000 is on and the current value in timer 604 is the preset value output 050 will energize. DirectSOFT Display 000
Handheld Programmer Keystrokes T604
050 OUT
STR AND OUT
SHF TMR SHF
0 SHF 5
ENT 6 0
0 ENT
4
ENT
In the following And Not Timer example, when input 000 is on and the current value in timer 604 is < the preset value output 050 will energize. DirectSOFT Display 000
Handheld Programmer Keystrokes T 604
050 OUT
STR AND OUT
SHF NOT SHF
0 TMR 5
ENT SHF 0
6 ENT
0
4
ENT
Page 250
Instruction Set
11–12
Instruction Set Boolean Instructions
And Counter (AND CNT) DL330/340 Only
The And Counter instruction logically ands a normally open counter contact in series with another contact in a rung. The counter contact C aaa will be on when the counter current value is the preset value of the associated counter.
And Not Counter (AND NOT CNT) DL330/340 Only
The And Not Counter instruction logically ands a normally closed counter contact in series with another contact in a rung. The counter contact C aaa will be on when the counter current value is < the preset value of the associated counter. Data Type
Counter
C
C aaa
C aaa
D3–330 Range
D3–340 Range
D3–330P Range aaa aaa aaa
600–677
600–677
––
* See Chapter 12 for similar RLL PLUS instructions In the following And Counter example, when input 002 is on and the current value in counter 602 is the preset value output 050 will energize. DirectSOFT Display 002
Handheld Programmer Keystrokes C 602
050 OUT
STR AND OUT
SHF CNT SHF
2 SHF 5
ENT 6 0
0 ENT
2
ENT
In the following And Not Counter example, when input 002 is on and the current value in counter 602 is < the preset value output 050 will energize. DirectSOFT Display 002
Handheld Programmer Keystrokes C 602
050 OUT
STR AND OUT
SHF NOT SHF
2 TMR 5
ENT SHF 0
6 ENT
0
2
ENT
Page 251
11–13
Instruction Set Boolean Instructions
Or Store (OR STR)
The And Store instruction logically ands two branches of a rung in series. Both branches must begin with the Store instruction.
OUT ➁
➀
The Or Store instruction logically ors two branches of a rung in parallel. Both branches must begin with the Store instruction.
➀
OUT ➁
In the following And Store example, the branch consisting of contacts 000 and 002 have been anded with the branch consisting of contacts 001 and 003. DirectSOFT Display 000
Handheld Programmer Keystrokes 001
010 OUT
002
003
STR OR STR OR
SHF SHF SHF SHF
0 2 1 3
ENT ENT ENT ENT
AND OUT
STR SHF
ENT 1
0
ENT
In the following Or Store example, the branch consisting of 000 and 001 have been ored with the branch consisting of 002 and 003. DirectSOFT Display 000
Handheld Programmer Keystrokes 001
010 OUT
002
003
STR AND STR AND
SHF SHF SHF SHF
0 1 2 3
ENT ENT ENT ENT
OR OUT
STR SHF
ENT 1
0
ENT
Instruction Set
And Store (AND STR)
Page 252
11–14
Instruction Set Boolean Instructions
Instruction Set
There are limits to what you can enter with these simple boolean instructions. This is because the DL305 CPUs use an 8-level stack to evaluate the various logic elements. The stack is a temporary storage area that helps solve the logic for the rung. Each time you enter a Store instruction, the instruction is placed on the top of the stack. Any other instructions on the stack are pushed down a level. The And, Or, And Store, and Or Store instructions combine levels of the stack when they are encountered. Since the stack is only eight levels, an error will occur if the CPU encounters a rung that uses more than the eight levels of the stack. The following example shows how the stack is used to solve simple boolean logic.
000
STR
STR
001
ORSTR
AND 004
050
Output
OUT
STR
002 AND 003
005
ANDSTR
OR
STR 000
STR 001
STR 002
- AND 003
1
1
STR 001
1
STR 002
1
002 AND 003
2
2
STR 000
2
STR 001
2
STR 001
3
3
3
STR 000
3
STR 000
4
4
4
4
5
5
5
5
6
6
6
6
7
7
7
7
8
8
8
8
STR 000
ORSTR
AND 004
1
001 OR (002 AND 003)
1
004 AND [001 OR (002 AND 003)]
1
005 OR 004 AND [001 OR (002 AND 003)]
2
STR 000
2
STR 000
2
STR 000
3
OR 005
3 S S
3 S S
8
8
ANDSTR 1
000 AND (005 OR 004) AND [001 OR (002 AND 003)]
2 3 S S
8
S S
8
Page 253
Instruction Set Boolean Instructions
The Out instruction reflects the status of the rung (on/off) and outputs the discrete (on/off) state to the specified image register point or memory location. Multiple Out instructions referencing the same discrete location should not be used because only the last Out instruction in the program will control the physical output point. Data Type aaa OUT
D3–330 Range
D3–340 Range aaa aaa
D3–330P Range aaa
Outputs
000–167 700–767
000–177 700–767
000–167 700–767
Control Relays
160–373
160–373 1000–1067
160–174 200–77
Shift Register Bits
400–577
400–577
––
In the following Out example, when input 000 is on output 010 will energize. DirectSOFT Display
Handheld Programmer Keystrokes
000
010 OUT
STR OUT
SHF SHF
0 1
ENT 0
ENT
In the following Out example, two Out instructions using output 10 are used in the program. The status of output 010 being controlled by input 001 will override the instance of output 010 being controlled by input 000. The physical output would always be controlled by input 001. 000
010 OUT
●
●
●
●
001
010 OUT
Instruction Set
Out (OUT)
11–15
Page 254
Instruction Set
11–16
Instruction Set Boolean Instructions
Set (SET) DL330/340 Only
The Set instruction sets or turns on an output. Once the output is set it will remain on until it is reset using the Reset instruction. It is not necessary for the input controlling the Set instruction to remain on. The Set instruction is sometimes known as a latch. The Reset instruction is used to reset the output.
Reset (RST) DL330/340 Only
The Reset instruction resets or turns off an output. Once the output is reset it is not necessary for the input to remain on. The Reset instruction is sometimes known as an unlatch instruction. Data Type aaa SET aaa RST
D3–330 Range
D3–340 Range
D3–330P Range* aaa aaa aaa
Outputs
000–167 700–767
000–177 700–767
––
Control Relays
160–373
160–373 1000–1067
––
Shift Register Bits
400–577
400–577
––
* See Chapter 12 for similar RLL PLUS instructions In the following Set example, when input 000 is on output 010 will be energized. DirectSOFT Display 000
Handheld Programmer Keystrokes 010 SET
STR SET
SHF SHF
0 1
ENT 0
ENT
In the following Reset example, when input 001 is on output 010 will de–energize. DirectSOFT Display 001
Handheld Programmer Keystrokes 010 RST
STR RST
SHF SHF
1 1
ENT 0
ENT
Page 255
Instruction Set Boolean Instructions
The Set Out instruction reflects the status of the rung (on/off) and outputs the discrete (on/off) state to the specified image register location. This instruction is similar to the Out instruction except the output disable coil (special relay 376) will not override and disable the output. Multiple Set Out instructions referencing the same discrete location should not be used because only the last Set Out instruction in the program will control the physical output point. Data Type
Outputs
Instruction Set
Set Out (SET OUT)
11–17 aaa SET OUT
D3–330 Range
D3–340 Range
D3–330P Range aaa aaa aaa
000–167 700–767
000–177 700–767
000–167 700–767
In the following Set Out example, when input location 000 is on output 020 will energize. The output disable coil (special relay 376) will not override this output coil. DirectSOFT Display 000
Handheld Programmer Keystrokes 020 SET OUT
STR SET
SHF OUT
0 SHF
ENT 2
0
ENT
Page 256
Instruction Set
11–18
Instruction Set Boolean Instructions
Set Out Reset (SET OUT RST)
The Set Out Reset instruction is typically known as a one shot. When the input logic produces an off to on transition the output will turn on for one CPU scan.
Data Type aaa OUT RST
D3–330 Range
D3–340 Range aaa aaa
D3–330P Range aaa
Outputs
000–167 700–767
000–177 700–767
000–167 700–767
Control Relays
160–373
160–373 1000–1067
160–174 200–77
In the following Set Out Reset example, when input 007 transitions from off to on, control relay 160 will energize for the remainder of the CPU scan. DirectSOFT Display 007
Handheld Programmer Keystrokes 160 OUT RST
STR SHF 7 SET OUT RST
ENT SHF
1
6
0
ENT