Modbus Interface
WirelessHART Fieldgate SWG70
114
E Hauser
16
Modbus Interface
Note!
• The "Modbus" function is only available on WirelessHART Fieldgate models with the
version "SWG70-xx-1-xx-xx". See Chapter 2.3 "Ordering information" on page 11.
16.1
Introduction
16.1.1 Modbus protocol
Modbus is a quasi-industrial standard developed some years ago by Gould-Modicon. and
provides a messaging service that may run on a variety of physical layers. For Fieldgate
SWG70 there are two possibilities for connecting Modbus:
• Modbus RTU (also known as Serial) can be connected point-to-point to the RS-485
interface. See Chapter 5.4 "Connecting to RS-485" on page 26.
• Modbus TCP (also known as Modbus TCP/IP) can be connected to an Ethernet Interface.
See Chapter 5.3 "Connecting to Ethernet" on page 24.
The Modbus protocol exchanges data in a master-slave relationship. Each slave has a unique
address, and the data are identified by their location in the slave address register. Certain
characteristics of the Modbus protocol are fixed, such as the frame format, frame sequences,
handling of communications errors, exception conditions and the functions performed.
Other characteristics are user selectable; these include transmission medium, baudrate,
character parity, number of stop bits, and transmission modes. Chapter 8.3 describes how
both Ethernet and Serial interfaces can be set up. The contents of the data carried by the pro-
tocol are also freely selectable, i.e. nothing is said about strings, integers, floating-point
numbers etc.
The Modbus protocol controls the query and response cycle between master and slave
devices. Only the master can initiate a transaction. A query and response may involve only a
single slave, or it may be in the form of a broadcast, in which case the slaves do not answer.
The query is contained in a frame that includes the address of the intended receiver, what
this slave is to do, data needed to perform the action, and a means of checking for errors.
The slave checks if errors have occurred and performs the desired action. After the action is
performed the slave builds the response and returns it to the master. The master can send
another message to any slave as soon as it receives a valid response or after a user-selected
time interval.
Data can be exchanged in two transmission modes: ASCII (American Standard Code for
Information Interchange) and RTU (Remote Terminal Unit). The major differences between
them are the type of error check performed on the message and the number of characters
used. Fieldgate SWG70 supports RTU only. Modbus offers several read, write and test func-
tions, each identified by a code number. They are designed as control commands for sensors
and actuators, e.g. coils, inputs, input registers, holding or output registers, diagnosis and
test reports, programs, polling control and reset. For Modbus TCP the serial frame is simply
inserted into the Ethernet data frame. In addition, not all codes are implemented.