#
# lincond.conf - example configuration.
#
# Grigoriy Sitkarev, <sitkarev@unixkomi.ru>
#
# lincond daemon configuration file example 
# for ICPDAS Linсon/LinPAC series controllers.
#
# This is my Lincon box. You can see modules in it.
# +--------+--------+-...-+--------+
# | Slot 1 | Slot 2 | ... | Slot 4 |
# | i87017 | i87024 | ... | i8055  |
# +--------+--------+-...-+--------+
# 
# Slot 1 maps to address I0..31.
# Slot 2 maps to address Q0..15.
# Slot 4 maps to address I32 and Q16.
#

# user to drop to
user nobody

# group to drop to
group nogroup

# daemon's socket file 
socketfile /var/run/lincond/lincond.sock

# size of inputs and outputs image
outputs	512
inputs 512

# RT scheduler priority
#priority 50

# You can specify as many stations as you want and
# lincond supports polling many stations in parallel
# simultaneously. As usual we have one station (local)
# with parallel bus and serial bus i.e. Lincon device
# itself and a number of remote stations which are
# connected via RS-485 and use only serial modules.
#
# Section <station> contains station options:
#
# port
#	serial port device file. Mandatory option. If
#   you want to specify local station (Lincon device
#   itself) and be able to use parallel bus modules
#   specify serial device /dev/ttySA2.
#
# speed
#	speed (in bauds) used on serial port. Mandatory
#   option. By default ICPDAS modules run on 115200
#   bauds and this is a typical setting.
#
# timeout
#	response timeout for DCON protocol in milliseconds.
#	Typical range is 10..1000 msecs. Optional.
#
# usecsum
#	set to 'yes' if checkum is used and 'no' otherwise.
#	This option is off by default. Optional.
#
# Within <station> section the modules are described
# each in it's own section <module>. This is consistent.
# All modules sit in station so we place section <module>
# into section <station> to.
#
# Section <module> contains the following options:
#
# slot
#	Slot number in the station rack usually slot is
#	in range 1..7 for lincon/linpac and 1..9 for 
#	RS-485 extended racks. This option identifies
#	module as unique instance.
#
# address
#	Address of the module used for DCON request/response
#	protocol. Has no meanings for modules on parallel bus.
#	Address has range 0..255.
#
# units
#	Units used for analog input or analog output modules.
#	Known values are:
#	 raw - use 16-bit hex value
#	 eu - use engineering units (float)
#	 ohm - value is in ohms (float)
#	 fsr - finite scale rate (float)
#
# moduletype
#	Type of module.
#	Known values are:
#	 di[4,8,16,32] - DI with 4,8,16 or 32 inputs
#	 do[4,8,16,32] - DO with 4,8,16 or 32 outputs
#	 di_serial[4,8,16,32] - DI with 4,8,16,32 inputs on serial bus
#	 do_serial[4,8,16,32] - DO with 4,8,16,32 outputs on serial bus
#	 dio[8,16] - DI/DO with 8 or 16 inputs/outputs
#	 dio_serial[4,8] - DI/DO with 4 or 8 inputs/outputs on serial bus
#	 ao_serial[4,8] - AO with 4 or 8 inputs on serial bus
#	 ai_serial[4,8] - AI with 4 or 8 outputs on serial bus
#
# outputchanged
#	Output AO only if the value was changed. Used to improve station 
#	polling time. If this option is 'on/yes' then AO are also readback
#	only on change. This helps to improve reading/writing of 4 AO channels 
#	up to tens milliseconds. If you want to read/write AO channels _every_
#	poll cycle then set this option to 'off/no'.
#
# inputsmap
#	Offset into input process image where input data of the module
#	is stored. This is like I address in PLC.
#
# outputsmap
#	Offset into output process image where output data of the module
#	is stored. This is like Q address in PLC.
#

<station>
	port		/dev/ttySA2
	speed		115200
	timeout		100
	usecsum		no

	<module>
		slot		1
		address		0
		units		raw
		moduletype	ai8_serial
		inputsmap	0
	</module>
	
	<module>
		slot		2
		address		0
		moduletype	ao4_serial
		outputsmap	0
		outputchanged	y
	</module>

	<module>
		slot		4
		address		0
		moduletype	dio8
		inputsmap	32
		outputsmap	16
	</module>

</station>


