#==============================================================================
#
# Abs:  LCLS GTR records
#
# Name: gtr.template
# Author: Shantha Condamoor (scondam)
#
# Associated Display: gtrControl.edl
#
# Rem:	This file added has more macros to the original gtr.db file that was
#	bundled in the EPICS package gtr2-3
#	In the IOC application, use substitutions for expanding the macros. 
# 
# Macros:
#	Note:	'dev', 'area' and 'position' together identify a specific, accessbile device.
#		'name' and 'card' together identify a specific, controllable gtr module.	
#	dev	Name of the gtr (ADC) device. (DeviceType)
#		Example: For SIS3300, which is a Fast ADC, use FADC.
#	area	Location of your IOC that houses this gtr (ADC) device. (Area)
#		It describes one of the 21 areas currently in the LCLS Accelerator.
#		Example: For an IOC located in the beam dump on Line 1, use DMP1
#	position	Formed as (1 char optional) Position Prefix and (3 char) Position Code.
#		If Position Prefix is unspecified, it indicates Beam Line (B).
#		Position Code roughly indicates the position of the device in the area.
#		Example: 100 means that the device is roughly position i the first 10% of its area.
#	name	The name of the associated transient driver.
#		The name is read from the driver during record initialization. 
#		This should match with the name in the startup script st.cmd
#	card	The card (link) number of the particular (digital adc) recorder starting with 1.
#		The card number must match the value specified in the driver xxxConfig.
#		Example: 'card' specified in sisfadcConfig() command in the application startup script st.cmd.
#	desc	Description.
#		Example Include SIS Type name in the description if applicable as sis3300
#==============================================================================
record(stringin,"FADC:LI24:707:sis3301name")
{
    field(DESC, "BLM Fiber Waveform Name")
    field(DTYP,"GTR")
    field(INP,"#C1 S0@name")
}
record(mbbo,"FADC:LI24:707:sis3301arm")
{
    field(DESC, "BLM Fiber Waveform Arm Choice")
    field(DTYP,"GTR")
    field(OUT,"#C1 S0@arm")
}
record(mbbo,"FADC:LI24:707:sis3301clock")
{
    field(DESC, "BLM Fiber Waveform Clock")
    field(DTYP,"GTR")
    field(OUT,"#C1 S0@clock")
}
record(mbbo,"FADC:LI24:707:sis3301trigger")
{
    field(DESC, "BLM Fiber Waveform Trigger Choice")
    field(DTYP,"GTR")
    field(OUT,"#C1 S0@trigger")
}
record(mbbo,"FADC:LI24:707:sis3301multiEvent")
{
    field(DESC, "BLM Fiber Waveform Multi Event")
    field(DTYP,"GTR")
    field(OUT,"#C1 S0@multiEvent")
}
record(mbbo,"FADC:LI24:707:sis3301preAverage")
{
    field(DESC, "BLM Fiber Waveform Pre Average")
    field(DTYP,"GTR")
    field(OUT,"#C1 S0@preAverage")
}
record(longout,"FADC:LI24:707:sis3301numberPTS")
{
    field(DESC, "BLM Fiber Waveform PTS")
    field(DTYP,"GTR")
    field(OUT,"#C1 S0@numberPTS")
}
record(longout,"FADC:LI24:707:sis3301numberPPS")
{
    field(DESC, "BLM Fiber Waveform PPS")
    field(DTYP,"GTR")
    field(OUT,"#C1 S0@numberPPS")
}
record(longout,"FADC:LI24:707:sis3301numberPTE")
{
    field(DESC, "BLM Fiber Waveform PTE")
    field(DTYP,"GTR")
    field(OUT,"#C1 S0@numberPTE")
}
record(bo,"FADC:LI24:707:sis3301softTrigger")
{
    field(DESC, "BLM Fiber Waveform Soft Trigger")
    field(DTYP,"GTR")
    field(OUT,"#C1 S0@softTrigger")
}
record(bo,"FADC:LI24:707:sis3301autoRestart")
{
    field(DESC, "BLM Fiber Waveform Auto Restart")
    field(SCAN,"I/O Intr")
    field(PHAS,"1")
    field(DTYP,"GTR")
    field(OUT,"#C1 S0@autoRestart")
    field(ZNAM,"no")
    field(ONAM,"yes")
    field(FLNK,"FADC:LI24:707:sis3301counter")
}
record(calc,"FADC:LI24:707:sis3301counter")
{
    field(DESC, "BLM Fiber Waveform Counter")
    field(CALC,"A+1")
    field(INPA,"FADC:LI24:707:sis3301counter")
}
record(ai,"FADC:LI24:707:sis3301everySecond")
{
    field(DESC, "BLM Fiber Waveform Every Second")
    field(SCAN,"1 second")
    field(FLNK,"FADC:LI24:707:sis3301perSecond")
}
record(calc,"FADC:LI24:707:sis3301perSecond")
{
    field(DESC, "BLM Fiber Waveform Per Second")
    field(CALC,"A")
    field(INPA,"FADC:LI24:707:sis3301counter")
    field(FLNK,"FADC:LI24:707:sis3301reset")
}
record(ao,"FADC:LI24:707:sis3301reset")
{
    field(DESC, "BLM Fiber Waveform Reset")
    field(VAL,"0")
    field(OUT,"FADC:LI24:707:sis3301counter NPP NMS")
}
