# ****************************************************************
# Wavecat Configuration File
# ****************************************************************

# NOTE:
# The setting modes can be [COMMON] (all boards-related), "[BOARD] #" (single board-related) or "[CHANNEL] #" (single channel-related)
# The setting mode is specified by a C,B and G in the setting description
# If a setting is CHANNEL-related, it can also be BOARD-related or COMMON (i.e. the setting refers to all the channels in all the boards of the system) 
# However not all options that are COMMON can also be BOARD- or CHANNEL-related.  The "[BOARD] #" or "[CHANNEL] #" directives have no effect on such settings
# The "[BOARD] #" and "[CHANNEL] #" modes are alternative to [COMMON] but do not exclude each other. This means that one can issue a command to a 
# specific channel of a specific board, to all channels of a specific board or to a specific channel of all boards. 
# When the "[BOARD] #" mode is set, the following settings apply to all channels (even if a specific channel was previously selected)  
# The board index follows the board initialization order using the OPEN command (see below).
# The lines between the commands @OFF and @ON will be skipped. This can be used to exclude parts of the config file.

# ----------------------------------------------------------------
# Settings common to the whole acquisition system.
# ----------------------------------------------------------------
[COMMON]

# START ACQUISITION: board start acquisition signal source
# options: INDEP_SW, SYNC_S_IN
StartMode   INDEP_SW

# OUTPUT FILE FORMAT: output file can be either ASCII (column of decimal numbers) or binary
# options: BINARY, ASCII
OutFileFormat  ASCII

# FPIO TYPE: signal type (NIM or TTL) of the front panel I/O LEMO connectors 
# options: NIM, TTL
FPIOtype  NIM

# TRIGGERS: trigger type (self trigger or external trigger)
# options: SELF_TRIGGER EXT_TRIGGER
TriggerMode	SELF_TRIGGER

# VETO: veto type (disabled, active high or active low). When active low mode is selected the VETO acts as a GATE.
# options: VETO_DISABLED VETO_ACTIVE_HIGH VETO_ACTIVE_LOW
VetoMode	VETO_ACTIVE_HIGH

# INPUT DELAY: defines a delay value added to the input waveform. Each unit corresponds to 2 samples. The minimum value is 2.
InputDelay	2

# RECORD LENGTH: record length samples. The value must be an even number
RecordLength		100 

#PRE TRIGGER: it sets how long before the trigger the record length window should be opened. Each unit corresponds to 2 samples. The minimum value is 2.
PreTrigger  4

# PULSEPOLARITY: pulse Polarity (this parameter can be individual)
# options: POSITIVE NEGATIVE
PulsePolarity NEGATIVE 

#TRIGGER THRESHOLD (0/16385)(CH): trigger threshold (this parameter can be individual)
TriggerThreshold   100

#BASELINE SAMPLES: number of samples to calculate the baseline (this parameter can be individual)
# options: 
# 0  0 sample : Baseline is not calculate and Trigger Threshold is absolute 
# 1: 16 samples
# 2: 32 samples
# 3: 64 samples
# 4: 128 samples
# 5: 256 samples
# 6: 512 samples
# 7: 1024 samples

NSBaseline	1

#LOOK FORWARD WINDOW: number of samples below the threshold before closing the acquisition window. Each unit corresponds to 2 samples (this parameter can be individual). 
#If N_LFW = 0 the minimum record length is recorded.
N_LFW	1

# ENABLE_INPUT: enable/disable the channel
# options: 1 (YES), 0 (NO)

# DC_OFFSET: DC offset adjust (DAC channel setting) in percent of the Full Scale.
# -50: analog input dynamic range = -Vpp to 0 (negative signals)
# +50: analog input dynamic range = 0 to +Vpp (positive signals)
# 0:   analog input dynamic range = -Vpp/2 to +Vpp/2 (bipolar signals)
# options: -50.0 to 50.0  (floating point)


[BOARD 0]

# OPEN: open the digitizer
# NOTE: when using the USB or CONET, the BA must be set to 0
# The base address (if required) must be in the form "0xXXXXXXXX"
# options: 
# USB [LINKNUM] 0                   Desktop/NIM digitizer through USB
# USB [LINKNUM] [BA]                VME digitizer through USB V1718/V3718 (BA = BaseAddress of the VME board, 32 bit hex)
# PCI [LINKNUM] [CONET NODE] 0      Desktop/NIM/VME through CONET (optical link) with A2818/A3818/A5818
# PCI [LINKNUM] [CONET NODE] [BA]   VME digitizer through CONET (optical link) with A2818/A3818/A5818 and V2718/V3718/V4718 (BA = BaseAddress of the VME board, 32 bit hex)
# USB_A4818 [PID] [CONET NODE] 0    Desktop/NIM/VME through CONET (optical link) with A4818
# USB_A4818 [PID] [CONET NODE] [BA] VME digitizer through CONET (optical link) with A4818 and V2718/V3718/V4718 (BA = BaseAddress of the VME board, 32 bit hex)
# USB_V4718 [PID] [BA]              VME digitizer through USB V4718 (BA = BaseAddress of the VME board, 32 bit hex)
# ETH_V4718 [HOSTNAME] [BA]         VME digitizer through ETH V4718 (BA = BaseAddress of the VME board, 32 bit hex)

Open USB 0 0
#Open USB 0 32100000
#Open PCI 0 0 0
#Open PCI 0 0 0

[CHANNEL 0]
EnableInput   1
DCoffset			0

[CHANNEL 1]
EnableInput   1
DCoffset			0

[CHANNEL 2]
EnableInput   1
DCoffset			0

[CHANNEL 3]
EnableInput   1
DCoffset			0

[CHANNEL 4]
EnableInput   0
DCoffset			0

[CHANNEL 5]
EnableInput   0
DCoffset			0

[CHANNEL 6]
EnableInput   0
DCoffset			0

[CHANNEL 7]
EnableInput   0
DCoffset			0


[BOARD 1]

# OPEN: open the digitizer
# NOTE: when using the USB or CONET, the BA must be set to 0
# The base address (if required) must be in the form "0xXXXXXXXX"
# options: 
# USB [LINKNUM] 0                  Desktop/NIM digitizer through USB             
# USB [LINKNUM] [BA]               VME digitizer through USB-V1718 (BA = BaseAddress of the VME board, 32 bit hex)
# PCI [LINKNUM] [CONET NODE] 0     Desktop/NIM/VME through CONET (optical link) 
# PCI [LINKNUM] [CONET NODE] [BA]  VME digitizer through V2718 (BA = BaseAddress of the VME board, 32 bit hex)

#Open USB 1 0
#Open USB 0 32100000
#Open PCI 0 0 0
#Open PCI 0 0 0

[CHANNEL 0]
EnableInput   1
DCoffset			0

[CHANNEL 1]
EnableInput   1
DCoffset			0

[CHANNEL 2]
EnableInput   1
DCoffset			0

[CHANNEL 3]
EnableInput   1
DCoffset			0

[CHANNEL 4]
EnableInput   0
DCoffset			0

[CHANNEL 5]
EnableInput   0
DCoffset			0

[CHANNEL 6]
EnableInput   0
DCoffset			0

[CHANNEL 7]
EnableInput   0
DCoffset			0