12 Modbus/TCP for Digital-Input/Output
12 Modbus/TCP for Digital-Input/Output
The operation of the Digital-Input and -Output signals is based on
libmodbus software
. This is
also a library which you may use in your application to communicate with the NetCom Plus. In the
NetCom Plus it supports communication via Modbus/TCP protocol as a Slave device to control
digital input and output signals. This section is not intended as a documentation of Modbus
protocol and communication. Basic knowledge about Modbus/TCP is assumed as available, at the
end are some simple examples on how to use the signals on NetCom Plus.
12.1 Specifications
The firmware implementation supports Discrete Inputs, Coils, Input Registers and Holding Regis-
ters. These are the most useful function codes.
Function
Decimal Code
Single bit access
Read Discrete Inputs
02
Read Coils
01
Write Single Coil
05
Write Multiple Coils
15
16 bit access
Read Holding Register
03
Read Input Register
04
Write Single Register
06
Write Multiple Registers
16
Table 29: Function Codes Modbus/TCP for Digital-I/O
Mapping of addresses to Digital-I/O signals:
Coil Address
Register Address
Signals
Interpretation
0 .. 7
0
Input 1 .. 8
External status
0: Input open
1: Input closed
8 .. 15
Output 1 .. 8
External status
0: Connect <n> to Ö
1: Connect <n> to S
32 .. 47
2
Data Direction
0: Input signal
1: Output signal
64 .. 79
4
Direction Option
0: Changeable
1: Fixed
Table 30: Mapping Modbus addresses to Input-/Output-signals
September 2016
NetCom Plus User Manual
123