The text of a manual · part 34 of 41
DL305 User Manual: Chapter 11: Instruction Set, pages 290 to 295
Pages 290 to 295 of 357, from DL305 User Manual
The original document is the PDF (3.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 PLC Direct D3-08TD1, PLC Direct D3-16NA, Koyo D3-08TD1 and Koyo D3-16NA
Page 290
Instruction Set Program Control Instructions
11--51
DirectSOFT Display
Handheld Programmer Keystrokes
000 MCS 001
A
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.
DL305 User Manual, Rev. D
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 291
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.
DL305 User Manual, Rev. D
Page 292
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--32) 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
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
R401
R400
3
5
4
7
R403
R402
8
3
5
4
R405
R404
1
3
9
6
R407
R406
9
7
5
1
R411
R410
1
2
4
3
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
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
4
ENT
ENT
DL305 User Manual, Rev. D
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 293
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 400--577 0000--9999
Data Registers
R
400--577
400--577 700--777
*Constant (4--digit BCD)
K
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.
DL305 User Manual, Rev. D
Page 294
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--32) 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
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
R401
R400
3
5
4
7
R403
R402
8
3
5
4
R405
R404
1
3
9
6
R407
R406
9
7
5
1
R411
R410
1
2
4
3
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
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
4
ENT
ENT
DL305 User Manual, Rev. D
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 295
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 400--577 0000--9999
Data Registers
R
400--577
400--577 700--777
Constant (4--digit BCD)
K
0000--9999
0000--9999
DirectSOFT Display
Handheld Programmer Display
000 FAULT (F20) K 0206
0206 ADDRESS/DATA ON/OFF
RUN BATT PWR CPU
DL305 User Manual, Rev. D
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