30
FnIO MODBUS Adapter NA-9189
FnIO S-Series
Copyright(C) CREVIS Co.,Ltd Support +82-31-273-6453 URL : www.crevis.co.kr
6.1.2.
MODBUS/TCP MBAP Header
The MBAP (MODBUS Application Protocol) header contains the following fields.
Fields
Length Description
Client
Server
Transaction
Identifier
2 bytes
Identification of a
MODBUS Request
/Response transaction.
Initialized by the client
Recopied by the server from the
received
Protocol
Identifier
2 bytes 0 = MODBUS protocol
Initialized by the client
Recopied by the server from the
received
Length
2 bytes
Number of following
bytes
Initialized by the client
(Request)
Initialized by the server
(Response)
Unit
Identifier
1 byte
Identification of a
remote slave connected
on a serial line or on
other buses.
Initialized by the client
Recopied by the server from the
received
Transaction Identifier - It is used for transaction pairing, the MODBUS server copies in the response the
transaction identifier of the request.
Protocol Identifier – It is used for intra-system multiplexing.
The MODBUS protocol is identified by the value 0.
Length - The length field is a byte count of the following fields, including the Unit Identifier and data fields.
Unit Identifier –
This field is used for intra-system routing purpose. Typically MODBUS server must be
returned with the same value set by MODBUS client.
6.2.
Supported MODBUS Function Codes
Function Code Function
Description
1 (0x01)
Read Coils
Read output bit
2 (0x02)
Read Discrete Inputs
Read input bit
3 (0x03)
Read Holding Registers
Read output word
4 (0x04)
Read Input Registers
Read input word
5 (0x05)
Write Single Coil
Write one bit output
6 (0x06)
Write Single Register
Write one word output
8 (0x08)
Diagnostics (Serial Line only) Read diagnostic register
15 (0x0F)
Write Multiple Coils
Write a number of output bits
16 (0x10)
Write Multiple registers
Write a number of output words
23 (0x17)
Read / Write Multiple register
Read a number of input words /
Write a number of output words
-
Refer to MODBUS APPLICATION PROTOCOL SPECIFICATION V1.1a