The text of a manual · part 30 of 36
DL305 User Manual, pages 287 to 296
Pages 287 to 296 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 287
11–49
Instruction Set Number Conversion Instructions
The Invert instruction generates the one’s complement of the number in the accumulator. The result is stored in the accumulator.
INV (F84)
In the following example, when input 000 is on the value (AD63) in R000 and R010 is loaded into the accumulator using the Data Store (F55) instruction. The value in the accumulator is inverted with the result residing in the accumulator. The value (HEX 529C) is copied to registers R404 and R405 using the Data Out (F60) instruction. DirectSOFT Display 000
R 10
R0
A
6
D
Handheld Programmer Keystrokes
3
DSTR5 (F55) R0 Load the value in register R000 and R010 into the accumulator
INV (F84) Invert the value in the accumulator
DOUT (F60) R 404
7
I/O Points 100-107 6 5 4 3 2 1 0
7
I/O Points 000-007 6 5 4 3 2 1 0
1
0
1
0
1
0
1
0
SHF 5
0 5
ENT ENT
R F F
0 8 6
ENT 4 0
ENT ENT
4
0
4
1
1
0
1
0
1
1
0
0
0
1
1
R
1
1
0
1
0
1
1
0
0
0
1
1
Accumulator
0
0
Accumulator
Invert the value in the accumulator 0
1
0
1
0
5
2
R405 Copy the value in the accumulator to registers R404 and R405
STR F
0
1
0
1
0
0
1
1
9
C
R404
1
ENT
Instruction Set
Invert INV (F84)
Page 288
11–50
Instruction Set Program Control Instructions
Instruction Set
Program Control Instructions Master Control Set (MCS) DL330/DL340 Only Master Control Reset (MCR) DL330/DL340 only Understanding Master Control Relays
The Master Control Set and Master Control Reset instructions are used to provide an additional left power rail which is controllable by a input contact. This is sometimes known as a sub power rail. Any number of rungs of ladder logic can be disabled using these instructions.
MCS
MCR
The Master Control Set (MCS) and Master Control Reset (MCR) instructions allow you to quickly enable (or disable) sections of the RLL program. This provides program control flexibility. The following example shows how the MCS and MCR instructions operate by creating a sub power rail for control logic. 000
When contact 000 is on, logic under the first MCS will be executed.
MCS
050 OUT
001 002
When contact 002 is on, logic under the second MCS will be executed.
MCS
003
MCR
010
MCR
The MCR instructions note the end of the Master Control area. (They will be entered in adjacent addresses.)
Page 289
Instruction Set Program Control Instructions
11–51
DirectSOFT Display
Handheld Programmer Keystrokes
000 A MCS 001
160 OUT
002
161 OUT
165
20 OUT
010
C MCS
003
170 OUT
004
171 OUT
D
STR MCS STR OUT STR OUT STR OUT STR MCS STR OUT STR OUT MCR STR OUT STR OUT MCR STR OUT
SHF ENT SHF SHF SHF SHF SHF SHF SHF ENT SHF SHF SHF SHF ENT SHF SHF SHF SHF ENT SHF SHF
0
ENT
1 1 2 1 1 2 1
ENT 6 ENT 6 6 0 0
ENT ENT
3 1 4 1
ENT 7
0
ENT
ENT 7
1
ENT
5 1 6 2
ENT 7
2
ENT
ENT 1
ENT
7 2
ENT 2
ENT
0
ENT
1 5
ENT ENT
MCR 005
172 OUT
006
21 OUT
B MCR 007
22 OUT
NOTE: When programming the MCS instruction, do not put any parallel coils in the rung with the MCS.
Instruction Set
MCS/MCR Example In the following MCS/MCR example logic between the first MCS (A) and the last MCR (B) will function only if input 000 is on. The logic between the second MCS (C) and the next to last MCR (D) will function only if input 010 is on. The last rung is not controlled by either of the MCS coils.
Page 290
11–52
Instruction Set Network Instructions
Instruction Set
Network Instructions Read from Network The Read from Network instruction is used RX (F952) by the master device on a DirectNET DL340 Only network to read a block of data from another CPU or DirectNET interface module. The function parameters are loaded into the accumulator and the first and second level of the accumulator stack by three additional instructions. Listed below are the steps necessary to program the Read from Network function.
RX (F952) A aaa
Step 1:, Load the slave address (1–90 BCD) into the accumulator with the DSTR instruction. This must always be preceded by 00, so address 20 would be 0020. (Remember, D4–DCM slave device addresses are set with switches that use a hexadecimal format. Make sure you convert this address to the decimal equivalent for use with this instruction.) Step 2:, Load the number of bytes (1 – 128 BCD) to be transferred from the network slave station. Step 3:, Load the octal address for the data register that will be used to store the data obtained from the slave station. Step 4:, Insert the RX instruction which specifies the starting address in the slave station. If you are getting the data from a DL305 station, just enter the Data Register number. If you are getting the data from a DL205 or DL405 station, enter a constant that corresponds to the memory address. For example, to get the current count for Timer 600 from a DL305 CPU, you would use R600 with the RX instruction. If you wanted to get Counter 0 from a DL405 CPU, you would use a constant of 1000 with the RX instruction. (V1000 stores the current count for Counter 0 in a DL405 CPU.) NOTE: The DirectNET manual provides further information on the use of the RX and WX network instructions. Data Type
D3–330 Range
D3–340 Range
A 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
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
* A constant is used to obtain data from a DL205 or DL405 system. Discrete Bit Flags
Description
777
Parameters are not properly set. Check the slave address, data length, or data address reference.
1074
Communication port busy.
1075
Communication error. Data was not transmitted.
Page 291
Instruction Set Network Instructions
11–53
In the following example, when input 001 is on and the CPU busy relay 1074 (see special relays, p. 8–31) is not on, the RX instruction will access a DL405 CPU that has been assigned station address 20. (Note, the D4–DCM slave station addresses are set with switches that indicate a hexadecimal number. Make sure you determine the decimal equivalent to be used with the first DSTR instruction in the sequence.) Ten consecutive bytes of data (V1400 – V1404) will be read from the slave station and stored in registers R400 – R411. (Remember, the DL205 and DL405 V-memory locations are 16 bits. The DL305 registers are only 8 bits, so you have to use two data registers for each V-memory location.) DirectSOFT Display 001
1074
DSTR (F50) K0020 The constant value K0020 specifies station address 20 (hex)
DL305 CPU
Slave CPU
S S
S S
DSTR (F50) K0010 The constant value K10 specifies the number of bytes to be read
R401
R400
3
5
4
7
R403
R402
8
3
5
4
3
4
5
7
V1400
8
5
3
4
V1401
1
9
3
6
V1402
9
5
7
1
V1403
1
4
2
3
V1404
DSTR (F50) K0400 Octal address 0400 is used to designate R400 as the starting point for the range of registers that will hold the data
RX (F952) K1400 K1400 is used to represent V1400, which is the starting location in the for the Slave CPU where the specified data will be read from
Handheld Programmer Keystrokes
STR AND F SHF F SHF F SHF F
SHF NOT 5 0 5 1 5 4 9
1 SHF 0 0 0 0 0 0 5
ENT 1 ENT 2 ENT ENT ENT 0 2
ENT ENT
SHF
1
4
0
0
0
7
0
ENT
ENT
4
ENT
R405
R404
1
3
9
6
R407
R406
9
7
5
1
R411
R410
1
2
4
3
Instruction Set
NOTE: See the DL205 or DL405 User’s Manuals for a listing of V-memory addresses available with these CPUs. Since the DL305 only supports a 4-digit constant, you will not be able to access the entire V-memory ranges of the DL205 and DL405 CPUs. For example, you could not directly access V40400 stored in a DL405 CPU. If you require data from a range outside the area available with a 4-digit constant (from V0 – V9999) then add a routine to the slave station program that moves this data down into one of the accessible areas.
Page 292
Instruction Set
11–54
Instruction Set Network Instructions
Write to Network WX (F953) DL340 Only
The Write to Network instruction is used by the master device on a DirectNET network to write a block of data to another WX (F953) station. The function parameters are A aaa loaded into the accumulator and the first and second level of the accumulator stack by three additional instructions. Listed below are the steps necessary to program the Write to Network function. Step 1:, Load the slave address (1–90 BCD) into the accumulator with the DSTR instruction. This must always be preceded by 00, so address 20 would be 0020. (Remember, the D4–DCM slave device addresses are set with switches that use a hexadecimal format. Make sure you convert this address to the decimal equivalent for use with this instruction.) Step 2:, Load the number of bytes (1 – 128 BCD) to be transferred to the network slave station. Step 3:, Load the octal address for the data register that will be used to obtain the data that will be sent to the slave station. Step 4:, Insert the WX instruction which specifies the starting address in the slave station. If you are sending data to a DL305 station, just enter the Data Register number. If you are sending data to a DL205 or DL405 station, enter a constant that corresponds to the memory address. For example, to send data to Register 500 in a DL305 CPU, you would use R500 with the RX instruction. If you wanted to send data to V1400 in a DL405 CPU, you would use a constant of 1400 with the WX instruction. NOTE: The DirectNET manual provides further information on the use of the RX and WX network instructions. Data Type
D3–330 Range
D3–340 Range
D3–330P 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
* A constant is used to send data to a DL205 or DL405 system. Discrete Bit Flags
Description
777
Parameters are not properly set. Check the slave address, data length, or data address reference.
1074
Communication port busy.
1075
Communication error. Data was not transmitted.
Page 293
Instruction Set Network Instructions
11–55
In the following example, when input 001 is on and the CPU busy relay 1074 (see special relays, p. 8–31) is not on, the WX instruction will access a DL405 CPU that has been assigned station address 20. (Note, the D4–DCM slave station addresses are set with switches that indicate a hexadecimal number. Make sure you determine the decimal equivalent to be used with the first DSTR instruction in the sequence.) Ten consecutive bytes of data (R400 – R411) will be sent from the DL340 and stored in V-memory locations V1400 – V1404. (Remember, the DL205 and DL405 V-memory locations are 16 bits. The DL305 registers are only 8 bits, so you have to use two data registers for each V-memory location.) DirectSOFT Display 001
1074
DSTR (F50) K0020 The constant value K0020 specifies station address 20 (hex)
DL305 CPU
Slave CPU
S S
S S
DSTR (F50) K0010 The constant value K10 specifies the number of bytes to be send
R401
R400
3
5
4
7
R403
R402
8
3
5
4
3
4
5
7
V1400
8
5
3
4
V1401
1
9
3
6
V1402
9
5
7
1
V1403
1
4
2
3
V1404
DSTR (F50) K0400 Octal address 0400 is used to designate R400 as the starting point for the range of registers that holds the data in the DL340.
WX (F953) K1400 K1400 is used to represent V1400, which is the starting location in the for the Slave CPU where the specified data will be stored.
Handheld Programmer Keystrokes
STR AND F SHF F SHF F SHF F
SHF NOT 5 0 5 1 5 4 9
1 SHF 0 0 0 0 0 0 5
ENT 1 ENT 2 ENT ENT ENT
0
7
0
ENT
0 3
ENT ENT
SHF
1
4
0
0
ENT
4
ENT
R405
R404
1
3
9
6
R407
R406
9
7
5
1
R411
R410
1
2
4
3
Instruction Set
NOTE: See the DL205 or DL405 User’s Manuals for a listing of V-memory addresses available with these CPUs. Since the DL305 only supports a 4-digit constant, you will not be able to access the entire V-memory ranges of the DL205 and DL405 CPUs. For example, you could not directly access V40400 stored in a DL405 CPU. If you want to send data to a range outside the area available with a 4-digit constant (from V0 – V9999) then add a routine to the slave station program that moves the data from one of the accessible areas into the unavailable locations.
Page 294
11–56
Instruction Set Message Instructions
Instruction Set
Message Instructions Fault FAULT (F20)
The Fault (F20) instruction is used to display a 4–digit BCD constant, 16–bit register, or two consecutive 8–bit data registers on the handheld programmer or in DirectSoft. When the fault instruction is executed the number being displayed will also be copied into the registers R574 and R575 and the discrete bit flag 771 will be on.
FAULT (F20)
In the following example, when input 000 is on the number 0206 will be displayed on the programming device. This would typically be a user defined error code. Data Type
D3–330 Range
D3–340 Range
D3–330P 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–27
Shift Registers
R
040–056
040–56
––
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
DirectSOFT Display
Handheld Programmer Display
000 FAULT (F20) K 0206
0206 ADDRESS/DATA
ON/OFF
RUN BATT PWR CPU
0 AND 1 OR 2 STR 3 NOT
4 OUT 5 TMR 6 CNT 7 SR
0 MCS 1 MCR 2 SET 3 RST
Handheld Programmer Keystrokes
4 ADR 5 SHF 6 DATA 7 REG
STR F
SHF 2
0 0
ENT ENT
SHF
2
0
6
ENT
Page 295
RLL PLUS Instruction Set In This Chapter. . . .
112
Ċ Introduction Ċ Stage Instructions Ċ Comparative Boolean Instructions Ċ Timer, Counter, and Shift Register Instructions
Page 296
12–2
RLL PLUS Instruction Set Stage Instructions
Instruction Set
Introduction This chapter provides information concerning the instructions used with RLL PLUS CPUs. If you are not familiar with RLL PLUS programming concepts, you should read Chapter 10 first. Chapter 10 will help you understand the basic concepts. The following table provides a quick reference listing of the instruction mnemonic and the page(s) defining the instruction. (The mnemonics are very similar to the instruction names and should be easy to become familiar with in a short time.) For example ISG is the mnemonic for Initial Stage. Each instruction definition will show in parentheses the keystrokes used to enter the instruction.
RLLPLUS Instructions
NOTE: Don’t assume that the instructions in this chapter are the only ones you can use with your RLL PLUS CPU. There are many others that are discussed in Chapter 11 that you can use as well. If you are using an RLL PLUS CPU, such as the DL330P, then you should always consult this chapter before you use one of the instructions shown in Chapter 11. There may be differences in the way the instruction operates in an RLL PLUS CPU. This chapter provides a description of several instructions that are similar, but slightly different from their RLL CPU counterparts. For example, you’ll notice that a Counter instruction has two input lines in an RLL CPU but only one input line in an RLL PLUS CPU.
There are two ways to quickly find the instruction you need. S
If you know the instruction category (Stage, Comparative Boolean, etc.) just use the header at the top of the page to find the pages that discuss the instructions in that category.
S
If you know the individual instruction mnemonic, use the following table to find the page that discusses the instruction.
Instruction
Page
Instruction
Page
AND CNT
12–17
ORN TMR
12–14
AND SG
12–9
RST
12–10
AND TMR
12–16
RST (counter)
12–20
ANDN CNT
12–17
RST SG
12–11
ANDN SG
12–9
SET
12–10
ANDN TMR
12–16
SET SG
12–11
CNT
12–19
SG
12–3
ISG
12–3
SR
12–21
JMP
12–5
STR CNT
12–13
NJMP
12–5
STR TMR
12–12
OR CNT
12–15
STR SG
12–7
OR SG
12–8
STRN CNT
12–13
OR TMR
12–14
STRN SG
12–7
ORN CNT
12–15
STRN TMR
12–12
ORN SG
12–8
TMR
12–18