The text of a manual · part 5 of 6
DL405 Remote Master/Remote Slave D4-RM, D4-RS, and D4-RSDC, pages 41 to 50
Pages 41 to 50 of 60
The original document is the PDF (1.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 D4-RM and Koyo D4-RM
Page 41
Setup Programming Tell the CPU That You Are Finished With the Setup
4--5
Once you have decided on the starting addresses and the reserved memory locations for each remote base, you have to zero out all of the reserved memory locations you are not going to use and then tell the CPU that you are finished with the setup. If you don’t use the FILL command to insert zero’s in the unused areas, the CPU will assume that every pointer address V7404 through V7477 is pointing to a read or write start address. This could cause problems. You may have garbage in these locations---at the very least, its going to take up unnecessary scan time. The easiest way to fill the unused memory locations with zeros is to do it first, before loading your table setup. Then you overwrite those memory locations used during your table setup, and everything else is zeros, as required. The example below approaches the problem this way. SP1
LD K38 There are 56 reserved locations 56 decimal = 38 hex
SP1
LDA O7404
Number of V memory locations in table Where the reserved memory starts
FILL K0
Clear Table
LDA O40403 OUT V7404 LD K16
SP1
OUT V7405 LDA O40502 OUT V7406 LD K16
SP1
LDA O40404
LD K32
K32
Remote #2 Output
OUT V7413 LDA O40406 OUT V7414 LD
K16
Remote #3 Input
OUT V7415 LDA O40505 OUT V7416 LD K16 OUT V7417 C670 SET
Remote #3 Input
Tell CPU that setup is completed
Remote I/O Setup Programming
LDA O40503
LD
SP1
Remote #2 Input
OUT V7411
OUT V7412
SP1
Remote #1 Output
OUT V7407
OUT V7410
SP1
Remote #1 Input
Page 42
4--6
Setup Programming
EXAMPLE: 38.4 kBaud, D4-440
Step 1: Design the Remote I/O System
Main Base with Master
MasterModule
Remote Slave Worksheet
Can go in any slot
CPU and PS
16
1
Remote Base Address_________(Choose 1--7)
16
I
I
X0-X17 V40400
X20-X37 V40401
16
16
I
16
O
O
8
I
8
8
8
I
O
O
X60-X67 X70-X77 V40403
Slave Module
08ND3S
X060
8
1
08ND3S
X070
8
No.Outputs
2
08TD1
Y040
8
3
08TD1
Y050
8
6 7
16 Total Input Points_____
16
16
16
I
I
O
O
X100-X117 X120-X137 Y60-Y77 V40404 V40405 V40503
Y040 40502 Output Bit Start Address:________V-Memory Address:V_______ 16 Total Output Points_____
Y100-Y117 V40504
Remote Slave Worksheet
3rd Remote
2 Remote Base Address_________(Choose 1--7)
OUTPUT
8
8
Slot Number
I
O
O
0
16ND2
X100
16
1
16ND2
X120
16
2 3
Slave Module
Module Name
INPUT
8
X140-X147 X150-X157 Y120-Y127 Y130-Y137 V40406 V40505
Remote I/O Setup Programming
0
Output Address
X060 Input Bit Start Address:________V-Memory Address:V_______ 40403
16
I
No. Inputs
5
2nd Remote
8
Input Address
4
Y40-Y47 Y50-Y57 V40502
Slave Module
OUTPUT
Module Name
X40-X57 Y0-Y17 Y20-Y37 V40402 V40500 V40501
1st Remote
INPUT
Slot Number
Output Address
No.Outputs
16TD1
Y060
16
16TD1
Y100
16
Input Address
No. Inputs
4
Remote Slave Worksheet
5
3 Remote Base Address_________(Choose 1- 7) Slot Number
6
INPUT
7
OUTPUT
Module Name
Input Address
No. Inputs
Output Address
X100 40404 Input Bit Start Address:________V-Memory Address:V_______
No.Outputs
0
08ND3S
X140
8
1
08ND3S
X150
8
2
08TD1
Y120
8
3
08TD1
Y130
8
32 Total Input Points_____ Y060 40503 Output Bit Start Address:________V-Memory Address:V_______ 32 Total Output Points_____
4 5
Note:
6 7 X140 Input Bit Start Address:________V-Memory Address:V_______ 40406 16 Total Input Points_____ Y120 Output Bit Start Address:________V-Memory Address:V_______ 40505 16 Total Output Points_____
The Remote Slave Worksheet is found in Appendix A.
Page 43
Setup Programming
Step 2: Set the Hardware
Step 3: Write the Setup Program RLL Program
Table for setting DIP switch Position
1
Master
Always ON
Remote
2
Always OFF
4--7
ON=38.4kB OFF=19.2kB
3
4
Always OFF
Always OFF
GTS
Always OFF
OFF=19.2kB
END K1
Always OFF SP1
Remote I/O Subroutine Note: Write as subroutine only if using D4--440 CPU For D4--430, this must be in main program. LD K38 There are 56 reserved locations 56 decimal = 38 hex
Master SP1
1=ON 2=ON 3=OFF 4=OFF
From Table Below
LDA O7404
Number of V memory locations in table Where the reserved memory starts
FILL K0
Clear Table
LDA O40403
Starting Address
OUT V7404 LD K16
1st Remote
SP1 1=OFF 2=ON 3=OFF 4=OFF
From Table Below
OUT V7406 LD K16
SP1 1=OFF 2=ON 3=OFF 4=OFF
From Table Below
OUT V7410 LD K32
3rd Remote
SP1
OUT V7412 LD
SP1
From Table Below
From Table Below
Second Master Module
Slave
Input Address
Number of Input Pts
Output Address
Number of Output Pts
Input Address
1
V7404
V7405
V7406
V7407
V7444
V7445
V7446
V7447
2
V7410
V7411
V7412
V7413
V7450
V7451
V7452
V7453
3
V7414
V7415
V7416
V7417
V7454
V7455
V7456
V7457
4
V7420
V7421
V7422
V7423
V7460
V7461
V7462
V7463
5
V7424
V7425
V7426
V7427
V7464
V7465
V7466
V7467
6
V7430
V7431
V7432
V7433
V7470
V7471
V7472
V7473
7
V7434
V7435
V7436
V7437
V7474
V7475
V7476
V7477
Number of Output Input Pts Address
Number of Output Pts
= unused memory for this example
K32
OUT V7414 LD
SP1
Remote #2 Input Starting Address
Remote #2 Output
OUT V7413 LDA O40406
Table of Reserved Memory for Remote I/O Setup
Starting Address
OUT V7411 LDA O40503
From Table Below
Remote #1 Output
K16
Starting Address
Remote #3 Input
OUT From Table Below V7415 LDA O40505 From Table Below
OUT V7416 LD
From Table Below
K16
Starting Address
Remote #3 Output
OUT V7417 C670 SET
Tell CPU that setup is completed
RT
Return to main program.
Remote I/O Setup Programming
1=OFF 2=ON 3=OFF 4=OFF
From Table Below
Starting Address
OUT V7407 LDA O40404
From Table Below
Remote #1 Input
OUT V7405 LDA O40502
From Table Below
2nd Remote
First Master Module
Go to remote I/O subroutine
Main Program Body SBR
ON=38.4kB
K1
SP00
Page 44
4--8
Setup Programming
Special Relays Used for Remote I/O The remote I/O system has several relays that are used with your system. On the previous pages, you saw how C670 is used to tell the CPU that all of the mapping has taken place. Below is a complete list of all of these relays: Function of Relay
First Master
Second Master
Relay (s)
Relay (s)
Setup Complete (Mandatory)
C670
C674
Locate Error
C700-C707
C720-C727
Description These two relays are used to tell the CPU that your program has finished doing all of its remote I/O mapping. When finished, the CPU continues the rest of its scan cycle. These relays are flags to let you know that a communication error has occurred. If set, there has been an error. This method of error detection helps locate the error. The last digit of the relay number indicates base unit. For example, C723 refers to the third slave unit of the second master. If it were C705, it would be indicating that the fifth slave unit of the first master module is not communicating.
I/O Status On Error (Save or Clear)
C671
Restart But Ignore Part of System Causing Error
C673
C675
These two relays are for determining whether you want the remote I/O points to be set to zero when an error occurs, or whether you want to save the current I/O settings.
C677
You may want to continue updating I/O data from remote I/O bases even if one of them has caused a communications error. These two relays allow you to take the bad base off line and to restart the system before the error is cleared.
Communications OK
C710-C717
C730-C737
These flags tell you if a particular base unit is ready for communication. The last digit of the relay number indicates the base unit. For example, C711 refers to the first slave unit of the first master. If it were C735, it would be indicating the communications status of the
Remote I/O Setup Programming fifth slave unit of the second master module.
Page 45
Setup Programming
4--9
How to Use the Special Relays Here are some example uses of these relays and an added explanation for each of the relays discussed on the previous page: C670/C674: Setup Complete (Mandatory)
These are setup flags for marking the end of your ladder logic that sets up your remote I/O configuration. It should be the last rung of your setup. It should always follow your FILL command that zero’s out all of the unused pointer addresses. Example:
SP1
Last setup rung There are 44 unused reserved memory locations. 44 dec=2C hex
C670 SET RT
C700 to C707 and C720 to C727: Locate Communications Error (Optional)
C700 to C707 are assigned to the 1st Master. C720 to C727 are assigned to the 2nd Master. The last digit of these relays indicates the base unit number. Remember that the CPU base is always Base Unit #0. The remote bases can be any number 1 through 7. For example, C721 refers to the 2nd Master, 1st Remote Base. These relays will be set when there is a communications error between the respective master and slave assigned to the relay number. Example: C721
Y14 OUT
Y14 could be an output that turns on an indicator light or an alarm that indicates the 1st Remote Base of the 2nd Master is not communicating.
C671 is assigned to the 1st Master. C675 is assigned to the 2nd Master. When any master can’t talk to one or more of its slaves, the “link” LED will illuminate on the affected module and the system will stop updating the remote I/O status in the CPU. You have several options at that point. One such option is either to save the last known I/O status that is in the CPU’s memory image area, or to write a zero to each point. If these flags are OFF when the error occurs, all current I/O will be zeroed. Example:
SP0
C675 SET
After power up, anytime a remote I/O error occurs for the 2nd Master, the status will be saved .
Remote I/O Setup Programming
C671/C675: I/O Status On Error (Optional)
Tell CPU that setup is completed Return to main program.
Page 46
4--10
Setup Programming
C673/C677 Error/Restart But Ignore Problem Area (Optional)
When a relay with C700 to C707 or C720 to C727 is set to indicate a communications error, you can use either or both C673 (for I/O belonging to the 1st master) and C677 (for I/O belonging to the 2nd master) as a method for having the CPU skip the scanning of the I/O register associated with a particular slave unit. Look in the Reserved Memory Table below to find the appropriate V74xx pointer address to match up with the approriate C7## relay. Both the relay and the pointers are specifically assigned to unique slave units. Example: C702
The number 9999 loaded in the pointer address for Slave #2 of the 1st master will tell the CPU to ignore this slave unit during restart after an error. See previous page for proper use of C700 to C707 and C720 to C727.
LD K9999 OUT V7411 C673 PD
1st Master
Remote I/O Setup Programming
Slave
C710 to C717 and C730 to C737 Communications OK Status (Optional)
Relay
2nd Master
Address Pointer
Relay
Address Pointer
1
C701
V7405
C721
V7445
2
C702
V7411
C722
V7451
3
C703
V7415
C723
V7455
4
C704
V7421
C724
V7461
5
C705
V7425
C725
V7465
6
C706
V7431
C726
V7471
7
C707
V7435
C727
V7475
C710 to C717 are assigned to the 1st Master. C730 to C737 are assigned to the 2nd Master. The last digit of these relays refers to the base unit number. Remember that the CPU base is always Base Unit #0. The remote bases can be any number 1 through 7. For example C715 refers to the 1st Master, 5th Remote Base. These flags indicate that a particular slave unit is ready for communcating data over its twisted pair cable. Example: C715
Y27 OUT
Y27 could be turning on an indicator light when the 5th Remote Base connected to the 1st Remote Master is ready for communications.
Page 47
Setup Programming
Example of RLL Using All the Special Relays
K1
SP00
SP00
GTS
Go to remote I/O subroutine
C671
After power up, anytime a remote I/O error occurs with the 1st master, the status will be saved.
SET C702
LD K9999 OUT V7411
4--11
The number 9999 loaded in the pointer address for Slave #2 of the 1st master will tell the CPU to ignore this slave unit during restart after an error.
C673 PD C701
Y14 OUT
C712
Y27 OUT
Y14 could be an output that turns on an indicator light or an alarm that indicates the 1st Remote Base of the 1st Master is not communicating. Y27 could be turning on an indicator light when the 2nd Remote Base connected to the 1st Remote Master is ready for communications.
END SBR
K1 SP1
Remote I/O Subroutine LDA O40403 OUT V7404 LD K16
SP1
OUT V7405 LDA O40502 OUT V7406 LD K16
SP1
Remote #1 Output
OUT V7407 LDA O40404 OUT V7410
Remote #2 Input
OUT V7411 LDA O40503 OUT V7412 LD
K32
Remote #2 Output
OUT V7413 C670 SET
Tell CPU that setup is completed
RT
Return to main program.
Remote I/O Setup Programming
LD K32 SP1
Remote #1 Input
Page 48
Appendix A Remote I/O Worksheet
1A
Page 49
Introduction to Motor Drives & Encoders
A--2
Introduction to Motor Drives and Encoders
Remote Slave Worksheet Remote Base Address ___________ (Choose 1--7)
Slot Number
Module Name
INPUT Input Address
No. Inputs
OUTPUT No. Outputs Output Address
0 1 2 3 4 5 6 7
Input Bit Start Address: ____V-Memory Address: V_____________ Total Input Points________ Output Bit Start Address: ____V-Memory Address: V____________ Total Output Points________
Page 50
Appendix B Reserved Memory Tables
1B