5 Implementation of Modbus TCP
5.6 The Service-Object
XI/ON: XNE-GWBR-2ETH-MB
10/2011 MN05002008Z-EN
www.eaton.com
65
5.6
The Service-Object
The service-object is used to execute one-time or acyclic services. It is an acknowledge
service which may serve, for example, to parameterize an I/O-module.
The service request area allows write access, the service response area only read access.
• Service request area
The register
service no.
in the request area can contain a user defined value which is deleted
after the execution of the service.
The register
service code
specifies which service is requested.
The register
index/addr
is optional and the meaning depends on the particular service.
The register
data-reg-count
contains, depending on the service, the number (0 to 122) of the
transferred or of the requested data registers.
Depending on the service, the
optional data
area can contain additional parameters and/or
other data to be written.
• Service response area
After the execution of a request, the registers
service-no.
,
service code
and
index/addr
in
the response area contain a copy of the values in the request area.
The register
result
shows whether the execution was successful or not.
The register
data-reg-count
contains the number of data registers (0 to 122).
The
optional Data
area can contain, depending on the service, the requested data.
2000h 2080h
20FFh
service request area
service response area
2000h 2001h
2002h
2003h
2004h
2005h
207Fh
service no. reserved
service
code
index/ addr data-
reg-count
optional data
(0 to122 registers)
2080h
2081h
2082h
2083h
2084h
2085h
20FFh
service no. result
service
code
index/ addr data-reg-
count
optional data
(0 to 122 registers)
Note
The service no. is thus used for a simple handshake on the application level. The ap-
plication increases the service no. with every request. The service is blocked, until
the service number in the request area matches the service number in the response
area.