# modbusd.conf - example Modbus/TCP server configuration
#
# 18/05/2009: Grisha Sitkarev, <sitkarev@unixkomi.ru>
#

# option: user
# description: Which uid or user to drop privileges to.
# default: no default
user nobody

# option: group
# description: Which gid or group to drop privileges to.
# default: no default
group nogroup

# option: loglevel
# description: Log level and syslog facility (optional).
#              If you want to set syslog facility then use dot as
#              separator between facility and log level like 'local0.debug'.
# default: warning
loglevel verbose

# option: port
# description: tcp port
# default: 502
port 502
# option: sockfile
# description: File used to communicate with modbusd daemon.
# default: $PREFIX/var/run/modbus/modbusd.sock
sockfile "/var/run/modbusd/modbusd.sock"

# option: input_image
# desciprion: size of process image inputs (in bytes)
# default: 0
input_image 256
# option: output_image
# description:  size of process image outputs (in bytes)
# default: 0
output_image 256

# option: max_sessions
# description: maximum number of client TCP sessions
# default: 5
max_sessions 10
# option: keep_alive
# description: How long idle client TCP session can stay.
#              When this timer (secs) expires session is disconnected.
# default: 30
keep_alive 30

# Modbus image mapping settings
#
# The following options set mapping of inputs/input registers
# and coils/holding registers into input_image and output_image
# correspondingly.
#
# What mapping ans size sets is easy to understand looking
# to the following diagram:
#
# [       output image      ]|[     input image        ]
# [ coils ]                  |[ inputs ]
# [ holding registers       ]|         [input registers]
# 
# Offsets and sizes are in bytes.
# It means that offsets for input registers and holding registers
# must be multiples of two.

# option: inputs
# description: Size of Modbus inputs in bytes.
# default: 0
inputs 2
# option: inputs_offset
# description: Starting location of inputs in input image.
# default: 0
inputs_offset 0

# option: input_regs
# description: Size of Modbus input registers size in bytes.
# default: 0
input_regs 20
# option: input_regs_offset
# description: Starting location of input registers in input image.
# default: 0
input_regs_offset 2

# option: coils
# description: Size of Modbus coils in bytes.
# default: 0
coils 2
# option: coils_offset
# description: Starting location of coils in output image
# default: 0
coils_offset 0

# option: holding_regs
# description: Size of Modbus holding register in bytes.
# default: 0
holding_regs 8
# option: holding_regs_offset
# description: Starting location of holding registers in output image.
# default: 0
holding_regs_offset 2

# Inputs
#inputs 64
#inputs_offset 0
#input_regs 256
#input_regs_offset 0

# Outputs
#coils 64
#coils_offset 0
#holding_regs 128
#holding_regs_offset 0
