Modbus Master Communication Function. Schneider Electric PL7 Micro/Junior/Pro, Communication applications, Volume 2
광고
광고
Modbus programming
Modbus Master Communication Function
At a Glance This page describes the services available on the Micro or Premium master stations of a Modbus link. For more information regarding Modbus function codes, please refer to the Modbus user guide TSX DG MDB F.
Note: the data entry help function does not work with Modbus addressing on a
Micro.
Data Exchanges The following requests are addressed to the slave device with which you wish to carry out variable read or write operations.
These requests use the READ_VAR , WRITE_VAR and SEND_REQ communication functions. See (PL7 Micro/Junior/Pro ; Communication applications ; Volume 1) and
(PL7 Micro/Junior/Pro ; Communication applications ; Volume 1).
Modbus request
Read bits
Read words
Write one or n bits
Write one or n words
Read input bits*
Read input words*
* except on Terminal port
Function code
16#01
16#03
16#05 or 16#0F
16#06 or 16#10
16#02
16#04
Communication function
READ_VAR
READ_VAR
WRITE_VAR
WRITE_VAR
SEND_REQ
SEND_REQ
Note: write utilities can be sent in transmission. In this case no response is returned to the transmitter. We therefore recommend that you configure a time-out to acknowledge the activity bit of the function.
Example of
Reading Words
The following example applies to reading word 4 (%MW4) in the Modbus slave 3.
READ_VAR (ADR#0.1.3, ‘%MW’,4,1,%MW100:1,%MW200:4)
38
35013154.02 07/2208
Modbus programming
Diagnostics and
Maintenance
The diagnostics and maintenance information of Modbus slaves uses the
SEND_REQ communication function. (See : PL7 Micro/Junior/Pro ; Communication applications ; Volume 1)
Modbus request Communication function
Exception status
Diagnostics
Event counter
Connection event
Slave identification
Function code / subfunction code
16#07
16#08 / 16#xx
16#0B
16#0C
16#11
SEND_REQ
SEND_REQ
SEND_REQ
SEND_REQ
SEND_REQ
35013154.02 07/2208
39
다운로드
광고