The text of a manual · part 24 of 61
DL205 PLC User Manual, Volume 1 of 2: Chapter 4: System Design and Configuration, pages 215 to 222
Pages 215 to 222 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 215
Chapter 4: System Design and Configuration
MWX Slave Memory Address MWX Slave Address Ranges Function Code
Modbus Data Format
05 – Force Single Coil 05 – Force Single Coil 06 – Preset Single Register
484 Mode 584/984 Mode 484 Mode
06 – Preset Single Register
584/984 Mode
15 – Force Multiple Coils 15 – Force Multiple Coils 16 – Preset Multiple Registers
484 584/984 Mode 484 Mode
16 – Preset Multiple Registers
584/984 Mode
Slave Address Range(s) 1–999 1–65535 4001–4999 40001–49999 (5 digit) or 400001–465535 (6 digit) 1–999 1–65535 4001–4999 40001–49999 (5 digit) or 4000001–465535 (6 digit)
MWX Master Memory Addresses MRX Master Memory Address Ranges Operand Data Type
DL260 Range
Inputs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Outputs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Control Relays . . . . . . . . . . . . . . . . . . . . . . . . . . . Stage Bits . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Timer Bits . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Counter Bits . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Special Relays. . . . . . . . . . . . . . . . . . . . . . . . . . . . V–memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Global Inputs . . . . . . . . . . . . . . . . . . . . . . . . . . . . Global Outputs . . . . . . . . . . . . . . . . . . . . . . . . . . .
X Y C S T CT SP V GX GY
0–1777 0–1777 0–3777 0–1777 0–377 0–377 0–777 All (see page 3-56) 0–3777 0–3777
MWX Number of Elements Number of Elements Operand Data Type V–memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Constant . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
DL260 Range V K
All (see page 3-56) Bits: 1–2000 Registers: 1-125
MWX Exception Response Buffer Exception Response Buffer Operand Data Type V–memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
DL260 Range V
All (see page 3-56)
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 4–51
Page 216
Chapter 4: System Design and Configuration
1 2 3 4 5 6 7 8 9 10 11 12 13 14 A B C D 4–52
MRX/MWX Example in DirectSOFT DL260 port 2 has two Special Relay contacts associated with it (see Appendix D for comm port special relays). One indicates “Port busy”(SP116), and the other indicates ”Port Communication Error”(SP117). The “Port Busy” bit is on while the PLC communicates with the slave. When the bit is off the program can initiate the next network request. The “Port Communication Error” bit turns on when the PLC has detected an error and use of this bit is optional. When used, it should be ahead of any network instruction boxes since the error bit is reset when an MRX or MWX instruction is executed. Typically, network communications will last longer than one CPU scan. The program must wait for the communications to finish before starting the next transaction. The “Port Communication Error” bit turns on when the PLC has detected an error. Use of this bit is optional. When used, it should be ahead of any network instruction boxes since the error bit is reset when an RX or WX instruction is executed.
Multiple Read and Write Interlocks SP116 will execute every time it attempts to poll the network. You should see this counting up as you enable the MWX and MRX instructions. Some things that would prevent this: 1) Com Port RTS and CTS not jumpered. 2) Port not set up for Modbus RTU. 3) Problem in logic that is not allowing the MWX or MRX to enable.
CNT Port 2 busy bit
1
SP116
Number of times that the PLC has tried to poll network
_FirstScan
CTO K9999
SP0 SP117 will come on when: 1) The slave device sends an "Exception Response." If this occurs, look at the V-memory location associated with that instruction and consult the MODICON Modbus manual for details. 2) Cabling problem. Consult wiring diagram in user manual and verify. 3) Setting for communications are not matching. For example: Baud rates, parities, stop bits all must match. 4) Polling a slave address number that doesn't exist. Under good conditions, SP116 will be counting up and SP117 will not. You will get an occasional error in many field environments that introduce electrical/RF noise into the application. Each application will dictate what allowable "percentage" of error is acceptable. Anything below 10% typically does not affect the throughput very much. Port 2 error bit
2
SP117 _FirstScan
SP0
DL205 User Manual, 4th Edition, Rev. A
CNT Number of times that the PLC has errored
CT1 K9999
Page 217
Chapter 4: System Design and Configuration If you are using multiple reads and writes in the RLL program, you need to interlock the routines to make sure all the routines are executed. If you don’t use the interlocks, then the CPU will only execute the first routine. This is because each port can only handle one transaction at a time. In the example, rungs 3 and 4 show that C100 will get set after the RX instruction has been executed. When the port has finished the communication task, the second routine is executed and C100 is reset. If you’re using RLLPLUS Stage Programming, you can put each routine in a separate program stage to ensure proper execution and switch from stage to stage allowing only one of them to be active at a time.
This rung does a Modbus write to the first holding register 40001 of slave address number one. It writes the values over that reside in V2000. This particular function code only writes to one register. Use function code 16 to write to multiple registers. Only one Network Instruction (WX, RX, MWX, MRX) can be enabled in one scan. That is the reason for the interlock bits. For using many network instructions on the same port, use the Shift Register instruction.
Port 2 Busy bit
SP116
Instruction Interlock bit
C100
MWX Port Number: K2 Slave Address: K1 Function Code: 06 - Preset Single Register Start Slave Memory Address: 40001 Start Master Memory Address: V2000 Number of Elements: n/a Modbus Data Type: 584/984 Mode Exception Response Buffer: V400
3
Instruction interlock bit C100
( SET ) This rung does a Modbus read from the first 32 coils of slave address number one. It will place the values into 32 bits of the master starting at C0.
Port 2 Busy bit 4
SP116
Instruction Interlock bit
C100
MRX Port Number: K2 Slave Address: K1 Function Code: 01 - Read Coil Status Start Slave Memory Address: 1 Start Master Memory Address: C0 Number of Elements: 32 Modbus Data Type: 584/984 Mode Exception Response Buffer: V400
Instruction interlock bit C100
( RST )
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
4–53
Page 218
Chapter 4: System Design and Configuration
Non–Sequence Protocol (ASCII In/Out and PRINT)
1 Configure the DL260 Port 2 for Non-Sequence Configuring port 2 on the DL260 for Non–Sequence allows the CPU to use port 2 to either 2 read or write raw ASCII strings using the ASCII instructions. See the ASCII In/Out instructions and the PRINT instruction in chapter 5. 3 In DirectSOFT, choose the PLC menu, then “Setup Secondary Comm Port”.
• Port: From the port number list box at the top, choose “Port 2”. 4 • Protocol: Click the check box to the left of “Non–Sequence”. 5 6 7 8 9 10 11 12 • Timeout: Amount of time the port will wait after it sends a message to get a response before logging an error. 13 • RTS On Delay Time: The amount of time between raising the RTS line and sending the data. • RTS Off Delay Time: The amount of time between resetting the RTS line after sending the data. 14 • Data Bits: Select either 7–bits or 8–bits to match the number of data bits specified for the connected devices. • Baud Rate: The available baud rates include 300, 600, 900, 2400, 4800, 9600, 19200, and 38400 A baud. Choose a higher baud rate initially, reverting to lower baud rates if you experience data errors or noise problems on the network. Important: You must configure the baud rates of all devices on B the network to the same value. Refer to the appropriate product manual for details. • Stop Bits: Choose 1 or 2 stop bits to match the number of stop bits specified for the connected devices. C • Parity: Choose none, even, or odd parity for error checking. Be sure to match the parity specified for the connected devices. D • Memory Address: Starting V-memory address for ASCII In data storage. 230 240
250-1 260
4–54
DL205 User Manual, 4th Edition, Rev. A
Page 219
Chapter 4: System Design and Configuration • Xon/Xoff Flow Control: Choose this selection if you have port 2 wired for Hardware Flow Control (Xon/Xoff ) with RTS and CTS signal connected between all devices. • RTS Flow Control: Choose this selection if you have Port 2 RTS signal wired between all devices. • Echo Suppression: Select the appropriate radio button based on the wiring configuration used on port 2. Then click the button indicated to send the Port configuration to the CPU, and click Close.
RS–485 Network RS–485 signals are for long distances (1000 meters max.). Use termination resistors at both ends of RS–485 network wiring, matching the impedance rating of the cable (between 100 and 500 ohms). Termination Resistor
TXD+ / RXD+
TXD+ / RXD+
TXD– / RXD–
TXD– / RXD– Signal GND
Signal GND RXD–
6
ASCII Device 11
1
Cable: Use Belden 9842 or equivalent
7
0V
RTS+ TXD+
RTS–
RXD+
CTS+
15
5
CTS–
10
DL260 CPU Port 2
TXD–
RS–232 Network RS–232 signals are used for shorter distances (15 meters max) and limited to communications between two devices. Port 2 Pin Descriptions (DL260 only)
6 1 GND RXD TXD CTS RTS
ASCII Device
11
Signal GND
7 2
TXD RXD
3 4
RTS CTS
5
10
15
CPU Port 2
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
5V TXD2 RXD2 RTS2 CTS2 RXD2– 0V 0V TXD2+ TXD2 – RTS2 + RTS2 – RXD2 + CTS2 + CTS2 –
5 VDC Transmit Data (RS-232) Receive Data (RS-232) Ready to Send (RS–232) Clear to Send (RS–232) Receive Data – (RS–422/RS-485) Logic Ground Logic Ground Transmit Data + (RS–422/RS–485) Transmit Data – (RS–422/RS–485) Request to Send + (RS–422/RS–485) Request to Send – (RS–422/RS–485) Receive Data + (RS–422/RS–485) Clear to Send + (RS-422/RS–485) Clear to Send – (RS–422/RS–485)
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
4–55
Page 220
Chapter 4: System Design and Configuration
Configure the DL250-1 Port 2 for Non-Sequence
1 2 3 4 5 6 7 8 9 10 11 12 13 14 A B C D
230 240 250-1 260
4–56
Configuring port 2 on the DL250–1 for Non–Sequence enables the CPU to use the PRINT instruction to print embedded text or text/data variable message from port 2. See the PRINT instruction in chapter 5. In DirectSOFT, choose the PLC menu, then “Setup Secondary Comm Port”. • Port: From the port number list box at the top, choose “Port 2”. • Protocol: Click the check box to the left of “Non–Sequence”.
• Memory Address: Choose a V-memory address to use as the starting location for the port setup parameters listed below. This location is the start of protocol memory buffer. It should not be used for other purposes. Buffer size = 2 + (Max receiving data size) / 2 or to allocate the maximum allowable space buffer size = 66 Words (for example V2000-V2102). • Use For Printing Only: Check the box to enable the port settings described below. Match the settings to the connected device. • Data Bits: Select either 7–bits or 8–bits to match the number of data bits specified for the connected device. • Baud Rate: The available baud rates include 300, 600, 900, 2400, 4800, 9600, 19200, and 38400 baud. Choose a higher baud rate initially, reverting to lower baud rates if you experience data errors or noise problems on the network. Important: You must configure the baud rates of all devices on the network to the same value. Refer to the appropriate product manual for details. • Stop Bits: Choose 1 or 2 stop bits to match the number of stop bits specified for the connected device. • Parity: Choose none, even, or odd parity for error checking. Be sure to match the parity specified for the connected device. Then click the button indicated to send the Port configuration to the CPU, and click Close. DL205 User Manual, 4th Edition, Rev. A
Page 221
Chapter 4: System Design and Configuration
RS–422 Network RS–422 signals are for long distances (1000 meters max.). Use termination resistors at both ends of RS–422 network wiring, matching the impedance rating of the cable (between 100 and 500 ohms). NOTE: For RS–422 cabling, we recommend Belden 8103 or equivalent.
RXD+ RXD– TXD+ TXD– Signal GND
ASCII Slave Device
9 TXD+ 10 TXD– 13 RXD+ 6 RXD– 11 RTS+ 12 RTS– 14 CTS+ 15 CTS– 7 0V
Termination Resistor at both ends of network PORT 2 Master
RS–232 Network RS–232 signals are used for shorter distances (15 meters max.) and limited to communications between two devices. NOTE: For RS–232 cabling, we recommend Belden 8102 or equivalent.
Port 2 Pin Descriptions (DL250-1) 6 1 GND RXD TXD CTS RTS
ASCII Slave ASCII Device Device
11
Signal GND
7 2
TXD RXD
3 4
RTS CTS
5
10
15
CPU Port 2 CPU Port 2 Master
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
5V TXD2 RXD2 RTS2 CTS2 RXD2– 0V 0V TXD2+ TXD2 – RTS2 + RTS2 – RXD2 + CTS2 + CTS2 –
5 VDC Transmit Data (RS-232) Receive Data (RS-232) Ready to Send (RS–232) Clear to Send (RS–232) Receive Data – (RS–422) Logic Ground Logic Ground Transmit Data + (RS–422) Transmit Data – (RS–422) Request to Send + (RS–422) Request to Send – (RS–422) Receive Data + (RS–422 ) Clear to Send + (RS422) Clear to Send – (RS–422)
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
4–57
Page 222
Chapter 4: System Design and Configuration
1 2 3 4 5 6 7 8 9 10 11 12 13 14 A B C D 4–58
Notes
DL205 User Manual, 4th Edition, Rev. A