Advanced Function Instruction
7 -1 2 2
FUN150
M-BUS
MODBUS MASTER INSTRUCTION
(
WHICH MAKES PLC AS THE MODBUS MASTER THROUGH PORT 1~4
)
FUN150
M-BUS
Pt
:
1~4, specify the communication port being acted
as the Modbus master
SR
:
Starting register of communication program
WR
:
Starting register for instruction operation. It controls 8
registers, the other programs can not repeat in using.
HR
ROR
DR
K
Range
Ope-
rand
R0
∣
R3839
R5000
∣
R8071
D0
∣
D4095
Pt
1
~
4
SR
○
○
○
WR
○
○
*
○
Description
1. FUN150 (M-BUS) instruction makes PLC act as Modbus master through Port 1
~
4, thus it is very easy to
communicate with the intelligent peripheral with Modbus protocol.
2. The master PLC may connect with 247 slave stations through the RS-485 interface.
3. Only the master PLC needs to use M-BUS instruction.
4. It employs the program coding method or table filling method to plan for the data flow controls; i.e. from which
one of the slave station to get which type of data and save them to the master PLC, or from the master PLC
to write which type of data to the assigned slave station. It needs only seven registries to make definition;
every seven registers define one packet of data transaction.
5. When execution control
〝
EN
↑〞
changes from 0
→
1 and both inputs Pause “PAU” and Abort “ABT” are 0, and
if Port 1/2/3/4 hasn’t been controlled by other communication instructions [i.e. M1960 (Port1) / M1962 (Port2) /
M1936 (Port3) / M1938 (Port4) = 1], this instruction will control the Port 1/2/3/4 immediately and set the
M1960/M1962/M1936/M1938 to be 0 (which means it is being occupied), then going on a packet of data
transaction immediately. If Port 1/2/3/4 has been controlled (M1960/M1962/M1936/M1938 = 0), then this
instruction will enter into the standby status until the controlling communication instruction completes its
transaction or pause/abort its operation to release the control right (M1960/M1962/M1936/M1938 =1), and
then this instruction will become enactive, set M1960/M1962/M1936/M1938 to be 0, and going on the data
transaction immediately.
6. While in transaction processing, if operation control “ABT” becomes 1, this instruction will abort this
transaction immediately and release the control right (M1960/M1962/M1936/M1938 = 1). Next time, when this
instruction takes over the transmission right again, it will restart from the first packet of data transaction.
7. While
〝
A/R
〞
=0
,
Modbus RTU protocol
;〝
A/R
〞
=1
,
Modbus ASCII protocol
。
8. While it is in the data transaction, the output indication “ACT” will be ON.
9. If there is error occurred when it finishes a packet of data transaction, the output indication “DN” & “ERR” will
be ON.
10. If there is no error occurred when it finishes a packet of data transaction, the output indication “DN” will be
ON.