The text of a manual · part 44 of 61
DL205 PLC User Manual, Volume 1 of 2: Chapter 5: RLL and Intelligent Box Instructions, pages 413 to 422
Pages 413 to 422 of 592, from DL205 PLC User Manual, Volume 1 of 2
The original document is the PDF (13 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 D2-08ND3 and Koyo D2-08ND3
Page 413
Chapter 5: Standard RLL Instructions - Intelligent I/O
Intelligent I/O Instructions
1 The Read from Intelligent Module instruction reads a block of data 2
(1 to 128 bytes maximum) from an intelligent I/O module into the CPU’s V-memory. It loads the function parameters into the first and second level of the accumulator stack, and the accumulator by three 3 additional instructions.
Listed below are the steps to program the Read from Intelligent module function. 4 Step 1: Load the base number (0 to 3) into the first byte and the slot number (0 to 7) into the second byte of the second level of the accumulator stack. 5 Step 2: Load the number of bytes to be transferred into the first level of the accumulator stack. (maximum of 128 bytes) 6 Step 3: Load the address from which the data will be read into the accumulator. This parameter must be a HEX value. 7 Step 4: Insert the RD instruction which specifies the starting V-memory location (Vaaa) where the data will be read into. Helpful hint:, Use the LDA instruction to convert an octal address to its HEX equivalent 8 and load it into the accumulator when the hex format is required. Operand Data Type DL230 Range DL240 Range DL250-1 Range DL260 Range 9 aaa aaa aaa aaa 10 Discrete Bit Flags Description 11 NOTE: Status flags are valid only until another instruction uses the same flag. 12 In the following example when X1 is on, the RD instruction will read six bytes of data from an intelligent module in base 1, slot 2 starting at address 0 in the intelligent module and copy 13 the information into V-memory locations V1400–V1402. 14 A B C D Read from Intelligent Module (RD)
RD
230
V aaa
240
250-1 260
DS Used HPP Used
V-memory
V
All (See page 3 - 53)
SP54
All (See page 3 - 54)
All (See page 3 - 55)
All (See page 3 - 56)
On when RX, WX, RD, WT instructions are executed with the wrong parameters.
DirectSOFT X1
CPU
LD
K0102
LD
K6
The constant value K0102 specifies the base number (01) and the base slot number (02)
K0
RD
V1400
Data 12
Address 0
34
Address 1
56 90
Address 2 Address 3 Address 4
01
Address 5
V1402 0 1 9 0
V1403 X X X X
The constant value K6 specifies the number of bytes to be read
78
V1404 X X X X
Handheld Programmer Keystrokes $
LD
Intelligent Module
V1400 3 4 1 2 V1401 7 8 5 6
The constant value K0 specifies the starting address in the intelligent module
V1400 is the starting location in the CPU where the specified data will be stored
B
STR
SHFT
L ANDST
D
SHFT
L ANDST
D
SHFT
L ANDST
D
SHFT
R ORN
D
1
3 3 3
3
ENT
PREV
A
PREV
G
PREV
A
B
E
1
0
6
0
4
B
1
A
0
C
2
ENT
ENT
ENT
A
0
A
0
ENT
DL205 User Manual, 4th Edition, Rev. A
5–191
Page 414
Chapter 5: Standard RLL Instructions - Intelligent I/O
1 2 3 4 5 6 7 8 9 10 11 12 13 14 A B C D
Write to Intelligent Module (WT) Write to Intelligent Module instruction writes a block of data WT 230 The V aaa (1 to 128 bytes maximum) to an intelligent I/O module from a 240 block of V-memory in the CPU. The function parameters are 250-1 loaded into the first and second level of the accumulator stack and the accumulator by three 260 additional instructions. Listed below are the steps necessary to program the Read from Intelligent module function.
DS Used HPP Used
Step 1: Load the base number (0 to 3) into the first byte and the slot number (0 to 7) into the second byte of the second level of the accumulator stack. Step 2: Load the number of bytes to be transferred into the first level of the accumulator stack. (maximum of 128 bytes) Step 3: Load the intelligent module address which will receive the data into the accumulator. This parameter must be a HEX value. Step 4: Insert the WT instruction which specifies the starting V-memory location (Vaaa) where the data will be written from in the CPU.
Helpful hint:, Use the LDA instruction to convert an octal address to its HEX equivalent and load it into the accumulator when the hex format is required. Operand Data Type V-memory
V
DL230 Range
DL240 Range
DL250-1 Range aaa aaa aaa aaa
All (See page 3 - 53)
All (See page 3 - 54)
All (See page 3 - 55)
All (See page 3 - 56)
Discrete Bit Flags
Description
SP54
5–192
DL260 Range
On when RX, WX, RD, WT instructions are executed with the wrong parameters.
NOTE: Status flags are valid only until another instruction uses the same flag.
In the following example, when X1 is on, the WT instruction will write six bytes of data to an intelligent module in base 1, slot 2 starting at address 0 in the intelligent module and copy the information from Vmemory locations V1400–V1402. DirectSOFT X1
CPU LD K0102
LD K6
LD K0
The constant value K0102 specifies the base number (01) and the base slot number (02)
Data
The constant value K6 specifies the number of bytes to be written
The constant value K0 specifies the starting address in the intelligent module
V1377
X
X
X
X
V1400
3
4
1
2
V1401
7
8
5
6
V1402
0
1
9
0
V1403
X
X
X
X
V1404
X
X
X
X
B 1
STR WT V1400
DL205 User Manual, 4th Edition, Rev. A
12
Address 0
34
Address 1
56
Address 2
78
Address 3
90
Address 4
01
Address 5
Handheld Programmer Keystrokes $
V1400 is the starting location in the CPU where the specified data will be written from
Intelligent Module
SHFT
L ANDST
D
SHFT
L ANDST
D
SHFT
L ANDST
D
SHFT
W ANDN
T MLR
3 3 3
ENT PREV
A
PREV
G
PREV
A
B
E 1
B
6 0
A 1
0
2
ENT ENT A
4
C 0
A 0
0
ENT
ENT
Page 415
Chapter 5: Standard RLL Instructions - Network
Network Instructions
1 Read from Network (RX) The Read from Network instruction is used by the master device on 2 a network to read a block of data from another CPU. The function parameters are loaded into the first and second level of the 3 accumulator stack and the accumulator by three additional instructions. Listed below are the steps necessary to program the Read from Network function. 4 Step 1: Load the slave address (0 to 90 BCD) into the first byte and the PLC internal port (KF1) or slot number of the master DCM or ECOM (0 to 7) into the second byte of the second level 5 of the accumulator stack. Step 2: Load the number of bytes (0 to 128 BCD, multiple of 2) to be transferred into the first level 6 of the accumulator stack. Step 3: Load the address of the data to be read into the accumulator. This parameter requires a HEX value. 7 Step 4: Insert the RX instruction which specifies the starting V-memory location (Aaaa) where the data will be read from in the slave. 8 Helpful hint:, For parameters that require HEX values, the LDA instruction can be used to convert an octal address to the HEX equivalent and load the value into the accumulator. 9 Operand Data Type DL240 Range DL250-1 Range DL260 Range 10 A aaa aaa aaa 11 12 13 14 A B C D RX
230
A aaa
240
250-1 260
DS Used HPP Used
V-memory Pointer
Inputs Outputs Control Relays Stage Timer Counter Global I/O Special Relay
V
P
X Y C S T CT GX/GY SP
All (See page 3 - 54) All V-memory (See page 3 - 54) 0-477 0-477 0-377 0-777 0-177 0-177 0-137 540-617
All (See page 3 - 55) All V-memory (See page 3 - 55) 0-777 0-777 0-1777 0-1777 0-377 0-177 0-777
All (See page 3 - 56) All V-memory (See page 3 - 56) 0-1777 0-1777 0-3777 0-1777 0-377 0-377 0-3777 0-777
DL205 User Manual, 4th Edition, Rev. A
5–193
Page 416
Chapter 5: Standard RLL Instructions - Network
1 2 3 4 5 6 7 8 9 10 11 12 13 14 A B C D 5–194
In the following example, when X1 is on and the module busy relay SP124 (see special relays) is not on, the RX instruction will access an ECOM or DCM operating as a master in slot 2. Ten consecutive bytes of data (V2000 – V2004) will be read from a CPU at station address 5 and copied into V-memory locations V2300–V2304 in the CPU with the master DCM or ECOM.
DirectSOFT X1
SP124
LD
LD
–or–
K0205
The constant value K0205 specifies the ECOM/DCM slot number (2) and the slave address (5) LD
KF105 The constant value KF105 specifies the bottom port and the slave address (5) (DL250–1 and DL260 only)
K10 The constant value K10 specifies the number of bytes to be read LDA O 2300 Octal address 2300 is converted to 4C0 HEX and loaded into the accumulator. V2300 is the starting location for the Master CPU where the specified data will be read into
Master CPU
Slave CPU
V2277
X
X
X
X
X
X
X
X V1777
V2300
3
4
5
7
3
4
5
7
V2000
V2301
8
5
3
4
8
5
3
4
V2001
V2302
1
9
3
6
1
9
3
6
V2002
V2303
9
5
7
1
9
5
7
1
V2003
V2304
1
4
2
3
1
4
2
3
V2004
V2305
X
X
X
X
X
X
X
X V2005
RX V2000 V2000 is the starting location in the Slave CPU where the specified data will be read from
Handheld Programmer Keystrokes $
B STR
1
W ANDN
SHFT
SHFT
L ANDST
D
SHFT
L ANDST
D
SHFT
L ANDST
D
SHFT
R ORN
X SET
ENT SP STRN
B
3 3
C 2
SHFT
K JMP
C
SHFT
K JMP
B
C
D
A 3
E
1
4 2
C
DL205 User Manual, 4th Edition, Rev. A
A 2
A 0 A 3
A 0
F 0
1
2
0
ENT A
0 0
ENT
ENT A
A 0
5
0 ENT
ENT
Page 417
Chapter 5: Standard RLL Instructions - Network
Write to Network (WX)
1 2 Write to Network function. 3 Step 1: Load the slave address (0 to 90 BCD) into the first byte and the PLC internal port (KF1) or slot number of the master DCM or ECOM (0 to 7) into the second byte of the second level 4 of the accumulator stack. Step 2: Load the number of bytes (0 to 128 BCD, multiple of 2) to be transferred into the first level 5 of the accumulator stack. Step 3: Load the address of the data in the master that is to be written to the network into the accumulator. This parameter requires a HEX value. 6 Step 4: Insert the WX instruction which specifies the starting V-memory location (Aaaa) where the data will be written to the slave. 7 Helpful hint:, For parameters that require HEX values, the LDA instruction can be used to convert an octal address to the HEX equivalent and load the value into the accumulator. 8 Operand Data Type DL240 Range DL250-1 Range DL260 Range 9 A aaa aaa aaa 10 11 12 13 14 A B C D
Write to Network instruction is used to write a block of data 230 The from the master device to a slave device on the same network. The 240 function parameters are loaded into the first and second level of 250-1 the accumulator stack and the accumulator by three additional 260 instructions. Listed below are the steps necessary to program the DS Used HPP Used
V-memory Pointer
Inputs Outputs Control Relays Stage Timer Counter Global I/O Special Relay
V
P
X Y C S T CT GX/GY SP
All (See page 3 - 54) All V-memory (See page 3 - 54) 0-477 0-477 0-377 0-777 0-177 0-177 0-137 540-617
All (See page 3 - 55) All V-memory (See page 3 - 55) 0-777 0-777 0-1777 0-1777 0-377 0-177 0-777
WX
A aaa
All (See page 3 - 56) All V-memory (See page 3 - 56) 0-1777 0-1777 0-3777 0-1777 0-377 0-377 0-3777 0-777
DL205 User Manual, 4th Edition, Rev. A
5–195
Page 418
Chapter 5: Standard RLL Instructions - Network
1 2 3 4 5 6 7 8 9 10 11 12 13 14 A B C D 5–196
In the following example when X1 is on and the module busy relay SP124 (see special relays) is not on, the WX instruction will access a DCM or ECOM operating as a master in slot 2. Ten consecutive bytes of data is read from the CPU at station address 5 and copied to Vmemory locations V2000–V2004 in the slave CPU. DirectSOFT X1
SP124
LD
LD
–or–
K0205
KF105
The constant value K0205 specifies the ECOM/DCM slot number (2) and the slave address (5)
The constant value KF105 specifies the bottom port and the slave address (5) (DL250–1 and DL260 only)
LD K10 The constant value K10 specifies the number of bytes to write
Master CPU
Slave CPU
LDA O 2300
V2277
X
X
X
X
X
X
X
X V1777
Octal address 2300 is converted to 4C0 HEX and loaded into the accumulator. V2300 is the starting location for the Master CPU where the specified data will be written from.
V2300
3
4
5
7
3
4
5
7
V2000
V2301
8
5
3
4
8
5
3
4
V2001
V2302
1
9
3
6
1
9
3
6
V2002
V2303
9
5
7
1
9
5
7
1
V2003
V2304
1
4
2
3
1
4
2
3
V2004
V2305
X
X
X
X
X
X
X
X V2005
WX V2000 V2000 is the starting location in the Slave CPU where the specified data will be written to.
Handheld Programmer Keystrokes $
B STR
1
W ANDN
SHFT
SHFT
L ANDST
D
SHFT
L ANDST
D
SHFT
L ANDST
D
SHFT
W ANDN
X SET
ENT SP STRN
3 3
B
C
SHFT
K JMP
C
SHFT
K JMP
B
SHFT
O INST#
C
V AND
C
A
0 SHFT
4
ENT
2
A 3
E
1
A
F 0
2 A
0
1
2
DL205 User Manual, 4th Edition, Rev. A
5 ENT D
2
A 3
A 0
ENT
A 0
A 0
0
0 ENT
ENT
Page 419
Chapter 5: Standard RLL Instructions - Message
Message Instructions Fault (FAULT) The Fault instruction is used to display a message on the
230 handheld programmer or DirectSOFT. The message has a 240 maximum of 23 characters and can be either V-memory 250-1 data, numerical constant data or ASCII text. 260 To display the value in a V-memory location, specify the DS Used HPP Used
FAULT A aaa
V-memory location in the instruction. To display the data in ACON (ASCII constant) or NCON (Numerical constant) instructions, specify the constant (K) value for the corresponding data label area. See Appendix G for the ASCII Conversion Table. Operand Data Type V-memory Constant.
DL240 Range
DL250-1 Range
A aaa aaa
DL260 Range aaa
V K
All (See page 3 - 54) 1-FFFF
All (See page 3 - 55) 1-FFFF
All (See page 3 - 56) 1-FFFF
NOTE: The FAULT instruction takes a considerable amount of time to execute. This is because the FAULT parameters are stored in EEPROM. Make sure you consider the instruction execution times (shown in Appendix C) if you are attempting to use the FAULT instructions in applications that require faster than normal execution cycles.
DL205 User Manual, 4th Edition, Rev. A
1 2 3 4 5 6 7 8 9 10 11 12 13 14 A B C D
5–197
Page 420
Chapter 5: Standard RLL Instructions - Message
1 2 3 4 5 6 7 8 9 10 11 12 13 14 A B C D 5–198
Fault Example In the following example when X1 is on, the message SW 146 will display on the handheld programmer. The NCONs use the HEX ASCII equivalent of the text to be displayed. (The HEX ASCII for a blank is 20, a 1 is 31, 4 is 34 ...) DirectSOFT X1
FAULT K1
SW 146
END
DLBL K1
ACON A SW
NCON K 2031
NCON K 3436
Handheld Programmer Keystrokes
$
B 1
STR SHFT
F
A
ENT U
5
0
N TMR
D
4
B
3
L ANDST C
ISG
L ANDST
T MLR
B 1
ENT
SHFT
E
SHFT
D
SHFT
A
SHFT
N TMR
C
SHFT
N TMR
C
0
3
ENT B
1
L ANDST
2
O INST#
N TMR
S RST
W ANDN
ENT
N TMR
C
A
D
2
O INST#
N TMR
D
2
O INST#
1
ENT
2
DL205 User Manual, 4th Edition, Rev. A
0 E
3
B
4
1
3 D
G 3
6
ENT ENT
Page 421
Chapter 5: Standard RLL Instructions - Message
Data Label (DLBL) The Data Label instruction marks the beginning of an
230 ASCII / numeric data area. DLBLs are programmed after 240 the End statement. A maximum of 64 (DL240 and 250-1 DL250–1/260) or 32 (DL230) DLBL instructions can be 260 used in a program. Multiple NCONs and ACONs can be
DLBL K aaa used in a DLBL area.
Operand Data Type Constant
K
DL230 Range
DL240 Range
DL250-1 Range
DL260 Range aaa aaa aaa aaa
1-FFFF
1-FFFF
1-FFFF
1-FFFF
ASCII Constant (ACON) The ASCII Constant instruction is used with the DLBL
230 instruction to store ASCII text for use with other 240 instructions. Two ASCII characters can be stored in an 250-1 ACON instruction. If only one character is stored in a a leading space will be printed in the Fault 260 ACON message. Operand Data Type ASCII
A
ACON A aaa
DL230 Range
DL240 Range
DL250-1 Range aaa aaa aaa
DL260 Range aaa
0-9 A-Z
0-9 A-Z
0-9 A-Z
0-9 A-Z
Numerical Constant (NCON) The Numerical Constant instruction is used with the
230 DLBL instruction to store the HEX ASCII equivalent of 240 numerical data for use with other instructions. Two digits 250-1 can be stored in an NCON instruction. 260 Operand Data Type Constant
K
NCON K aaa
DL230 Range
DL240 Range
DL250-1 Range aaa aaa aaa
DL260 Range aaa
0-FFFF
0-FFFF
0-FFFF
0-FFFF
DS Used HPP Used
DL205 User Manual, 4th Edition, Rev. A
1 2 3 4 5 6 7 8 9 10 11 12 13 14 A B C D
5–199
Page 422
Chapter 5: Standard RLL Instructions - Message
1 2 3 4 5 6 7 8 9 10 11 12 13 14 A B C D 5–200
Data Label Example In the following example, an ACON and two NCON instructions are used within a DLBL instruction to build a text message. See the FAULT instruction for information on displaying messages. DirectSOFT
END
DLBL K1
ACON A SW
NCON K 2031
NCON K 3436
Handheld Programmer Keystrokes SHFT
E
N TMR
D
4
SHFT
D
L ANDST
B 1
L ANDST
B
3
SHFT
A
C 2
O INST#
N TMR
S RST
W ANDN
ENT
SHFT
N TMR
C
O INST#
N TMR
C
A
D
2
SHFT
N TMR
C
O INST#
N TMR
D
2
0
3
ENT
DL205 User Manual, 4th Edition, Rev. A
1
ENT
2 E 3
B 3
0 D 4
1 G
3
6
ENT ENT