MRX/MWX Example in
D
Diirreecctt
SOFT
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
DL205 User Manual, 4th Edition, Rev. B
4–52
Chapter 4: System Design and Configuration
1
2
3
4
5
6
7
8
9
10
11
12
13
14
A
B
C
D
Port 2 busy bit
SP116
Port 2 error bit
SP117
_FirstScan
SP0
_FirstScan
SP0
CNT
Number of times that
the PLC has tried to
poll network
CTO
K9999
CNT
Number of times that
the PLC has errored
CT1
K9999
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.
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.
1
2