DL06 Micro PLC User Manual; 3rd Edition Rev. E
4–27
Chapter 4: System Design and Configuration
1
2
3
4
5
6
7
8
9
10
11
12
13
14
A
B
C
D
Chapter 4: System Design and Configuration
MRX/MWX Example in DirectSOFT
DL06 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 1 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
If you are using multiple reads and writes in the RLL program, you have 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 below, after the MRX instruction is executed, C100 is set.
When the port has finished the communication task, the second routine is executed and C100
is reset. If you’re using RLL
plus
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.
See example on the next page.