The information in this document is for informational purposes only. Please inform HMS Networks of any
inaccuracies or omissions found in this document. HMS Networks disclaims any responsibility or liability for any
errors that may appear in this document.
HMS Networks reserves the right to modify its products in line with its policy of continuous product development.
The information in this document shall therefore not be construed as a commitment on the part of HMS Networks
and is subject to change without notice. HMS Networks makes no commitment to update or keep current the
information in this document.
The data, examples and illustrations found in this document are included for illustrative purposes and are only
intended to help improve understanding of the functionality and handling of the product. In view of the wide range
of possible applications of the product, and because of the many variables and requirements associated with any
particular implementation, HMS Networks cannot assume responsibility or liability for actual use based on the data,
examples or illustrations included in this document nor for any damages incurred during installation of the product.
Those responsible for the use of the product must acquire sufficient knowledge in order to ensure that the product
is used correctly in their specific application and that the application meets all performance and safety requirements
including any applicable laws, regulations, codes and standards. Further, HMS Networks will under no circumstances
assume liability or responsibility for any problems that may arise as a result from the use of undocumented features
or functional side effects found outside the documented scope of the product. The effects caused by any direct or
indirect use of such aspects of the product are undefined and may include e.g. compatibility issues and stability
issues.
SG-gateway Startup Guide
4.02.0400.22001 1.0 en-US
Page 3
How to Use the Getting Started3 (10)
1How to Use the Getting Started
This Getting Started shows how to configure an Ixxat SG-gateway for Modbus with the Ixxat
WEB-PLC. The Getting Started accompanies the tutorial video that can be found on
www.ixxat.com/energy-video.
2Protocol Specific Restrictions
The number of devices and values that can be defined is limited.
•Client/Master: up to 128 devices in total, max. 4096 values (max. 8129 array elements)
•Server/Slave: in total max. 4096 values (max. 8129 array elements)
•TCP Server: up to 32 Modbus TCP Client connections
•RTU Master: up to 128 devices
SG-gateway Startup Guide
4.02.0400.22001 1.0 en-US
Page 4
Configuring the Devices4 (10)
3Configuring the Devices
3.1Accessing the WEB-PLC
►Make sure the SG-gateway is correctly installed and connected to power and networks.
►Observe SG-gateway User Manual for information how to install the device and how to
configure the IP address.
Since the SG-gateway provides one serial port, Master and Slave cannot be configured at the same time.
Connect and configure the Master and then connect and configure the Slave.
►Enter IP address of the device in use into a web browser.
→Log in window is opened.
►Enter user name and password.
→Home page of the WEB-PLC is opened.
►Click button Settings
►Open tab Settings (1) and expand I/O (2) in the configuration tree.
Fig. 1Configuration tree
.
SG-gateway Startup Guide
4.02.0400.22001 1.0 en-US
Page 5
Configuring the Devices5 (10)
3.2Configuring the Client/Master
►Select Modbus Client/Master in the configuration tree.
Fig. 2Modbus Client/Master Configuration
►In field Interval (2) define the interval in milliseconds in which all Modbus values are read
and written.
If messages are not completely transmitted during one interval, the rest of the message is
transmitted in the following interval. The event log shows an error message to indicate
that the data in the PLC is not updated yet.
►Note that, if the interval is too short, the data in the PLC is not updated in each interval. If
the interval is too long, bandwidth might be lost due to the time the bus is unoccupied
between two transmissions.
►In field Timeout (2) define the maximum time in milliseconds to wait for the reply of a
Modbus device (reading/writing data and when connecting to a Modbus TCP device).
►By default Modbus TCP is used. To be able to access the device via Modbus RTU, enable
checkbox Enable RTU (3).
►If Modbus RTU is used, configure the RTU settings (3).
RTU Settings
Value parameterDescription
ModeDefines the Modbus RTU transmission mode.
Baud rateDefines the baud rate for Modbus RTU.
Parity
Minimum silent time
between frames
Possible modes: RS232 with RTS/CTS flow control, RS232 without flow control,
RS485
Defines the parity and stop bits for Modbus RTU.
Possible entries: None (2 stop bits), Odd, Even, (None (1 stop bit) is not conform to
the Modbus specification)
Defines the minimum time that must elapse between two frames on the bus. The
Modbus RTU driver calculates the silence time depending on the baud rate. Default
value is normally sufficient. It is possible to increase the silent time. If the configured
time is less than the calculated time, the setting is ignored.
SG-gateway Startup Guide
4.02.0400.22001 1.0 en-US
Page 6
Configuring the Devices6 (10)
►Click button Add Device (1) to add and configure a device.
→Window Edit device is opened.
►If RTU is enabled, RTU can be selected in field Type.
→RTU uses interface COM0.
→If RTU is not enabled, only TCP devices are possible to add.
Fig. 3Example: add RTU Master
Fig. 4Example: add TCP Client
►For type RTU define a name and the device address and click button OK.
►For type TCP define a name and the device IP address and click button OK.
→Devices are entered in the device list.
►Expand the device in the device list (1).
Fig. 5Device list
►To add inputs and outputs select the desired device in the device list (1) and click button
Add Value (2).
→Window Edit value is opened.
SG-gateway Startup Guide
4.02.0400.22001 1.0 en-US
Page 7
Configuring the Devices7 (10)
Fig. 6Example RTU input value
►Configure the value parameters and click button OK.
Value parameterDescription
Name
Unit identifierOnly for TCP servers. Defines the address of the RTU device to read from and write to for
Function
Start addressRegister address to start reading or writing the value. Addresses start at 0. One address
Quantity
Data type
Swap wordsModbus transmits the two bytes of one register in network byte order (big endian). For
Name of value
TCP/RTU gateways. For non-gateway devices use value 255.
Modbus function code that is used to read or write the value. Function code defines
whether the value is interpreted as input or output.
Possible values: Read Coil Status (0x01), Read Input Status (0x02), Read Holding Registers
(0x03), Read Analog Inputs (0x04), Force Coil (0x05), Preset Register (0x06), Force
Multiple Coils (0x0F), Preset Multiple Registers (0x10)
can contain up to 16 bits.
Use each address only once for a Modbus function. For example if an input with start
address 1, function code 0x04, and quantity 2 is defined, then address 1 and 2 are
occupied and cannot be used further for function code 0x04. Inputs and outputs use
different address ranges, therefore each address can be used once for each function.
Number of registers to be read or written. Value 1 represents 16 bit. If a data type with
32 bits length is selected, define minimum Quantity 2. If a data type with 64 bit length is
selected, define minimum Quantity 4. To use a multiple, define an array.
Data type of the value (depending on the function), possible values: Boolean, 8-bit
unsigned integer, 8-bit signed integer, 16-bit unsigned integer, 16-bit signed integer, 32bit unsigned integer, 32-bit signed integer, 32-bit floating point, 64-bit floating point, 64bit unsigned integer, 64-bit signed integer
multi-register values, the registers are expected to be in the same order. If a device
stores multi-register values in the opposite order, this option can be used to correct the
word order.
►Add all desired inputs and outputs.
→Inputs and outputs are entered in the device list.
►Click button OK.
►Click button OK (6) and button reboot
►If using Server/Slave, configure the Server/Slave inputs and outputs (see Configuring the
Server/Slave, p. 8).
SG-gateway Startup Guide
to apply the changes.
4.02.0400.22001 1.0 en-US
Page 8
Configuring the Devices8 (10)
3.3Configuring the Server/Slave
Fig. 7Server/Slave configuration
►Select Modbus Server/Slave in the configuration tree.
►In Settings (3) configure the settings according to the master settings.
►Select mode TCP or RTU.
TCP Settings
Value parameterDescription
Port
Keep-alive enableEnables the TCP keep-alive mechanism for connections from clients. When a dead
Keep-alive timeoutIdle time in seconds after which the first keep-alive probe is sent
Keep-alive intervalInterval in seconds in which keep-alive probes are sent
Keep-alive countNumber of keep-alive probes that are sent before closing the connection
RTU Settings
Value parameterDescription
RTU modeDefines the Modbus RTU mode.
AddressAddress of RTU slave
Baud rateDefines the baud rate for Modbus RTU. Make sure that the settings of the slave
Parity
Defines the TCP port number the Modbus TCP servers listens to, default 502. The
unit ID is not evaluated in TCP server mode.
connection is detected, resources consumed by this connection can be released.
Possible modes: RS232 with RTS/CTS flow control, RS232 without flow control,
RS485
matches the baud rate of the master.
Defines the parity and stop bits for Modbus RTU.
Possible entries: None (2 stop bits), Odd, Even, (None (1 stop bit) is not conform to
the Modbus specification)
►To add inputs and outputs click in device list (1) and click button Add.
→Window Edit value is opened.
SG-gateway Startup Guide
4.02.0400.22001 1.0 en-US
Page 9
Configuring the Devices9 (10)
►Configure the value parameters and click button OK.
Value parameterDescription
Name
Function
Start addressRegister address to start reading or writing the value. Addresses start at 0. One
Quantity
Data type
Name of value
Modbus function code that is used to read or write the value. Function code defines
whether the value is interpreted as input or output.
Possible values: Read Coil Status (0x01), Read Input Status (0x02), Read Holding
Registers (0x03), Read Analog Inputs (0x04), Force Coil (0x05), Preset Register
(0x06), Force Multiple Coils (0x0F), Preset Multiple Registers (0x10)
address can contain up to 16 bits.
Use each address only once for a Modbus function. For example if an input with
start address 1, function code 0x04, and quantity 2 is defined, then address 1 and 2
are occupied and cannot be used further for function code 0x04. Inputs and outputs
use different address ranges, therefore each address can be used once for each
function.
Number of 16-bit registers registers to be read or written. Value 1 represents 16 bit.
If a data type of 32 bit length is selected, define minimum Quantity 2. If a data type
of 64 bit length is selected, define minimum Quantity 4. To use a multiple, define an
array.
Data type of the value (depending on the function), possible values: Boolean, 8-bit
unsigned integer, 8-bit signed integer, 16-bit unsigned integer, 16-bit signed integer,
32-bit unsigned integer, 32-bit signed integer, 32-bit floating point, 64-bit floating
point, 64-bit unsigned integer, 64-bit signed integer
►Add all desired inputs and outputs.
→Inputs and outputs are entered in the device list.