record(motor, "$(DEVICE):MOTR") {
  field(DESC, "$(MAD)")
  field(DTYP, "asynMotor")
  field(DIR, "Pos")
  field(VELO, "2")
  field(VBAS, "1")
  field(VMAX, "4")
  field(ACCL, "0.1")
  field(BDST, "0")
  field(OUT, "@asyn($(MOTOR_PORT),$(AXIS))")
  field(MRES, "4e-4")
  field(ERES, "1")
  field(PREC, "4")
  field(EGU, "mm")
  field(DHLM, "0")
  field(DLLM, "0")
  field(UEIP, "1")
  field(TWV, "1")
  field(FOFF, "Frozen")
  field(OFF, "0")
  field(URIP, "0")
  field(RRES, "1")
  field(RTRY, "0")
  field(RDBL, "")
  field(RDBD, "1")
  field(DLY, "0")
  field(SCAN, "Passive")
  info(autosaveFields_pass0, "VAL")
  info(autosaveFields, "DIR DESC VMAX VBAS ACCL VELO MRES ERES PREC EGU DHLM DLLM DLY TWV RDBL RRES RTRY URIP UEIP FOFF OFF FRAC JVEL JAR HVEL HLM LLM")
}
##########################################################################
# Description:
# This template contains database for phase shifter gap PVs used from a UI
#
# Macros:
# P 	- Device prefix
# M    	- MOTR              
# DMAX	- Max shaft rotations of of the motor
# GMAX 	- Max allowable gap 
# GMIN  - Minimum allowable gap
##########################################################################

# Gap desired from USER and actual gap reported 
record(ao, "$(DEVICE):GapDes") {
  field(DESC, "Phase shifter GAP setpoint")
  field(PREC, "3")
  field(DRVH, "25")
  field(DRVL, "0")
  field(EGU, "mm")
  field(HIGH, "25")
  field(LOW, "0")
  field(HSV, "MINOR")
  field(LSV, "MINOR")
  info(autosaveFields,"DRVH DRVL HIGH LOW VAL")
}

record(ai, "$(DEVICE):GapAct"){
  field(DESC, "Phase Shifter actual gap")
  field(DTYP, "Soft Channel")
  field(INP, "$(DEVICE):MOTR.RBV CP")
  field(PREC, "3")
  field(EGU, "mm")
  field(HIGH, "25")
  field(LOW, "0")
  field(HSV, "MINOR")
  field(LSV, "MINOR")
  info(autosaveFields,"HIGH LOW")
}

# As the motor controller calculates the moves in rotations or degrees
# Convert the gap to deg for request
# Convert the deg readback to gap for actual position
#record(calc, "$(DEVICE):Gap2Deg") {
#  field(CALC, "(A+D)/C*B")
#  field(INPA, "$(DEVICE):GapDes PP")
#  field(INPB, "$(DEVICE):MaxMotorDeg")
#  field(INPC, "$(DEVICE):MaxGap")
#  field(INPD, "$(DEVICE):GapOffset")
#  field(EGU, "deg")
#  info(autosaveFields,"CALC")
#}

#record(calcout, "$(DEVICE):Deg2Gap") {
#  field(FLNK, "$(DEVICE):MOTR")
#  field(CALC, "(A/B)*C+D")
#  field(INPA, "$(DEVICE):MOTR.RBV CP")
#  field(INPB, "$(DEVICE):MaxMotorDeg")
#  field(INPC, "$(DEVICE):MaxGap")
#  field(INPD, "$(DEVICE):GapOffset")
#  field(OUT, "$(DEVICE):GapAct")
#  field(EGU, "mm")
#  info(autosaveFields,"CALC")
#}

# Phase shifter gap range 
record(ao, "$(DEVICE):MaxGap"){
  field(DESC, "Phase Shifter max gap")
  field(PREC, "3")
  field(EGU, "mm")
  field(PINI, "YES")
  field(VAL, "25")
  info(autosaveFields,"VAL EGU")
}

record(ao, "$(DEVICE):MinGap"){
  field(DESC, "Phase Shifter min gap")
  field(PREC, "3")
  field(EGU, "mm")
  field(PINI, "YES")
  field(VAL, "0")
  info(autosaveFields,"VAL EGU")
}

# Phase Shifter max motor shaft rotation
record(ao, "$(DEVICE):MaxMotorDeg"){
  field(DESC, "Phase Shifter max rotation")
  field(EGU, "deg")
  field(PINI, "YES")
  field(VAL, "79900")
  info(autosaveFields,"VAL")
}

# Phase Shifter gap offset
record(ao, "$(DEVICE):GapOffset"){
  field(DESC, "Phase Shifter gap offset")
  field(EGU, "mm")
  field(PINI, "YES")
  field(VAL, 0)
  info(autosaveFields,"VAL")
}

# Move request initiates a sequence
record(bo, "$(DEVICE):TRIM") {
  field(DESC, "Start changing PS gap")
  field(ZNAM, "Standby")
  field(ONAM, "Trim ")
}

record(bi, "$(DEVICE):TRIMSTS") {
  field(DESC, "Trim status")
  field(ZNAM, "Move Done")
  field(ONAM, "Move Requested")
}
record(bi, "$(DEVICE):TRIM_DBG") {
  field(DESC, "Trim debug")
  field(ZNAM, "Off")
  field(ONAM, "On")
}

record(ao, "TCAV:DMPH:360:PHASPWRACT") {
  field(DESC, "Phase power actual")
  field(PREC, "3")
  field(DRVH, "1")
  field(DRVL, "0")
  info(autosaveFields,"DRVH DRVL VAL")
}

record(calcout, "TCAV:DMPH:360:GAP2PHASPWR") {
  field(CALC, "(COS((A-7.5)/11.5*PI)+1)*0.475")
  field(FLNK, "TCAV:DMPH:360:PHASPWRACT")
  field(INPA, "$(DEVICE):GapAct CP")
  field(OUT, "TCAV:DMPH:360:PHASPWRACT")
  field(EGU, "mm")
  info(autosaveFields,"CALC")
}

record(ao, "TCAV:DMPS:360:PHASPWRACT") {
  field(DESC, "Phase power actual")
  field(PREC, "3")
  field(DRVH, "1")
  field(DRVL, "0")
  info(autosaveFields,"DRVH DRVL VAL")
}

record(calcout, "TCAV:DMPS:360:GAP2PHASPWR") {
  field(CALC, "(COS((A-19)/11.5*PI)+1)*0.475")
  field(FLNK, "TCAV:DMPS:360:PHASPWRACT")
  field(INPA, "$(DEVICE):GapAct CP")
  field(OUT, "TCAV:DMPS:360:PHASPWRACT")
  field(EGU, "mm")
  info(autosaveFields,"CALC")
}

record(ao, "TCAV:DMPH:360:PHASPWR") {
  field(DESC, "Phase power")
  field(PREC, "3")
  field(DRVH, "0.95")
  field(DRVL, "0")
  field(OUT, "TCAV:DMPH:360:PHASPWRDESRDBK PP")
  field(FLNK, "TCAV:DMPH:360:PHASPWR2GAP")
  info(autosaveFields,"DRVH DRVL VAL")
}

record(calcout, "TCAV:DMPH:360:PHASPWR2GAP") {
  field(CALC, "((ACOS((A/0.475)-1))*11.5/PI)+7.5")
  field(INPA, "TCAV:DMPH:360:PHASPWR")
  field(OUT, "$(DEVICE):GapDes")
  field(EGU, "mm")
  field(FLNK, "$(DEVICE):GapDes")
  info(autosaveFields,"CALC")
}

record(ai, "TCAV:DMPH:360:PHASPWRDESRDBK") {
  field(DESC, "Phase power desired readback")
  field(PREC, "3")
  field(FLNK, "TCAV:DMPH:360:PHASPWRDESCALC")
}

record(calcout, "TCAV:DMPH:360:PHASPWRDESCALC") {
  field(CALC, "0.95-A")
  field(INPA, "TCAV:DMPH:360:PHASPWR")
  field(FLNK, "TCAV:DMPS:360:PHASPWRDESRDBK")
  field(OUT, "TCAV:DMPS:360:PHASPWRDESRDBK")
  info(autosaveFields,"CALC")
}

record(ao, "TCAV:DMPS:360:PHASPWR") {
  field(DESC, "Phase power")
  field(PREC, "3")
  field(DRVH, "0.95")
  field(DRVL, "0")
  field(OUT, "TCAV:DMPS:360:PHASPWRDESRDBK PP")
  field(FLNK, "TCAV:DMPS:360:PHASPWR2GAP")
  info(autosaveFields,"DRVH DRVL VAL")
}

record(calcout, "TCAV:DMPS:360:PHASPWR2GAP") {
  field(CALC, "-((ACOS((A/0.475)-1))*11.5/PI)+19")
  field(INPA, "TCAV:DMPS:360:PHASPWR")
  field(OUT, "$(DEVICE):GapDes")
  field(FLNK, "$(DEVICE):GapDes")
  field(EGU, "mm")
  info(autosaveFields,"CALC")
}

record(ai, "TCAV:DMPS:360:PHASPWRDESRDBK") {
  field(DESC, "Phase power desired readback")
  field(PREC, "3")
  field(FLNK, "TCAV:DMPS:360:PHASPWRDESCALC")
}

record(calcout, "TCAV:DMPS:360:PHASPWRDESCALC") {
  field(CALC, "0.95-A")
  field(INPA, "TCAV:DMPS:360:PHASPWR")
  field(OUT, "TCAV:DMPH:360:PHASPWRDESRDBK")
  field(FLNK, "TCAV:DMPH:360:PHASPWRDESRDBK")
  info(autosaveFields,"CALC")
}
##########################################################################
# Description:
# This database gets the digital input status from the Aerotech controller
# and splits it into two MBBI records.
# This database also gets axis specifc status and fault pv`s
# Disableallpvs PV can be used to disable all the pv`s for the device
#
# Macros:
# U 	- Device prefix
# PORT 	- Aerotech asyn port
# AXIS 	- Aerotech axis identifier
# SCAN 	- Desired scan rate
# MAD   - mad device name
##########################################################################
record(ai, "$(DEVICE):DISTAT") {
  field(DESC, "digital inputs")
  field(PINI, "YES")
  field(DTYP, "stream")
  field(INP, "@aerotech.proto getDINall(@$(AXIS)) $(ASYN_PORT)")
  field(SCAN, "1 second")
}

record(mbbiDirect, "$(DEVICE):DISTATS1") {
  field(DESC, "Digital input lower bits")
  field(DTYP, "Raw Soft Channel")
  field(INP, "$(DEVICE):DISTAT CP MS")
}

record(mbbiDirect, "$(DEVICE):DISTATS2") {
  field(DESC, "Digital input higher bits")
  field(DTYP, "Raw Soft Channel")
  field(INP, "$(DEVICE):DISTAT CP MS")
  field(SHFT, "16")
}

record(ai, "$(DEVICE):STAT") {
  field(DESC, "axis status")
  field(PINI, "YES")
  field(DTYP, "stream")
  field(INP, "@aerotech.proto axisStatus(@$(AXIS)) $(ASYN_PORT)")
  field(SCAN, "1 second")
}

record(ai, "$(DEVICE):FAULT") {
  field(DESC, "axis fault")
  field(PINI, "YES")
  field(DTYP, "stream")
  field(INP, "@aerotech.proto axisFault(@$(AXIS)) $(ASYN_PORT)")
  field(SCAN, "1 second")
}

record(ai, "$(DEVICE):AUTOHOMETRIGFAULT") {
  field(DESC, "fault to trigger autohome")
  field(DTYP, "stream")
  field(INP,  "@aerotech.proto getIGLOBAL(60) $(ASYN_PORT)")
  field(PINI, "YES")
  field(SCAN,"1 second")
}

record(mbbiDirect, "$(DEVICE):AUTOHOMETRIGFAULTS1") {
  field(DESC, "fault lower bits")
  field(DTYP, "Raw Soft Channel")
  field(INP, "$(DEVICE):AUTOHOMETRIGFAULT CP MS")
}

record(mbbiDirect, "$(DEVICE):AUTOHOMETRIGFAULTS2") {
  field(DESC, "fault higher bits")
  field(DTYP, "Raw Soft Channel")
  field(INP, "$(DEVICE):AUTOHOMETRIGFAULT CP MS")
  field(SHFT, "16")
}

record(mbbiDirect, "$(DEVICE):STATS1") {
  field(DESC, "status lower bits")
  field(DTYP, "Raw Soft Channel")
  field(INP, "$(DEVICE):STAT CP MS")
}

record(mbbiDirect, "$(DEVICE):STATS2") {
  field(DESC, "status higher bits")
  field(DTYP, "Raw Soft Channel")
  field(INP, "$(DEVICE):STAT CP MS")
  field(SHFT, "16")
}

record(mbbiDirect, "$(DEVICE):FAULTS1") {
  field(DESC, "fault lower bits")
  field(DTYP, "Raw Soft Channel")
  field(INP, "$(DEVICE):FAULT CP MS")
}

record(mbbiDirect, "$(DEVICE):FAULTS2") {
  field(DESC, "fault higher bits")
  field(DTYP, "Raw Soft Channel")
  field(INP, "$(DEVICE):FAULT CP MS")
  field(SHFT, "16")
}

record(bi, "$(DEVICE):ENABLEDSTAT") {
  field(DESC, "Axis enabled")
  field(INP,  "$(DEVICE):STATS1.B0 CP MS")
  field(ZNAM, "Disabled")
  field(ONAM, "Enabled")
}

record(bi, "$(DEVICE):HOMEDSTAT") {
  field(DESC, "Axis homed")
  field(INP,  "$(DEVICE):STATS1.B1 CP MS")
  field(ZNAM, "Not Homed")
  field(ONAM, "Homed")
  field(ZSV, "MAJOR")
  field(OSV, "NO_ALARM")
}

# If both limit switch show as active
record(calcout, "$(DEVICE):CABLESTAT_CALC") {
  field(DESC, "Motor Cable Status")
  field(INPA, "$(DEVICE):STATS2.B6 CP MS")
  field(INPB, "$(DEVICE):STATS2.B7 CP MS")
  field(CALC, "(A&&B)")
  field(FLNK, "$(DEVICE):CABLESTAT")
}

record(bo, "$(DEVICE):CABLESTAT") {
  field(DESC, "Motor Cable Status")
  field(DOL,  "$(DEVICE):CABLESTAT_CALC MS")
  field(ONAM, "Motor cable disconnected")
  field(ZNAM, "OK")
  field(ZSV, "MAJOR")
  field(OSV, "NO_ALARM")
}

record(bi, "$(DEVICE):MOVEACTIVE") {
  field(DESC, "Move active")
  field(INP,  "$(DEVICE):STATS1.B3 CP MS")
  field(ZNAM, "Not moving")
  field(ONAM, "Moving")
}

record(stringout, "$(DEVICE):FAULTACK") {
  field(DESC, "Ack fault on axis")
  field(DTYP, "stream")
  field(OUT,  "@aerotech.proto axisFaultAck(@$(AXIS)) $(ASYN_PORT)")
}

record(stringout, "$(DEVICE):ENABLE") {
  field(DESC, "Enable axis")
  field(DTYP, "stream")
  field(OUT,  "@aerotech.proto axisEnable(@$(AXIS)) $(ASYN_PORT)")
}

record(stringout, "$(DEVICE):ABORT") {
  field(DESC, "Abort axis")
  field(DTYP, "stream")
  field(OUT,  "@aerotech.proto axisAbort(@$(AXIS)) $(ASYN_PORT)")
}

record(stringout, "$(DEVICE):DISABLE") {
  field(DESC, "Disable axis")
  field(DTYP, "stream")
  field(OUT,  "@aerotech.proto axisDisable(@$(AXIS)) $(ASYN_PORT)")
}

record(stringout, "$(DEVICE):HOME") {
  field(DESC, "Home axis")
  field(DTYP, "stream")
  field(OUT,  "@aerotech.proto axisHome(@$(AXIS)) $(ASYN_PORT)")
}

record(ai, "$(DEVICE):IDES") {
  field(DESC, "axis current")
  field(PINI, "YES")
  field(DTYP, "stream")
  field(INP, "@aerotech.proto getCur(@$(AXIS)) $(ASYN_PORT)")
  field(SCAN, "1 second")
  field(PREC, 2)
}

record(ai, "$(DEVICE):EXTPOSN") {
  field(DESC, "Aux Encoder Position")
  field(PINI, "YES")
  field(DTYP, "stream")
  field(INP, "@aerotech.proto extPos(@$(AXIS)) $(ASYN_PORT)")
  field(SCAN, "1 second")
  field(PREC, 3)
  field(LINR, "SLOPE")
  info(autosaveFields, "ESLO EOFF EGU")
}

record(ai, "$(DEVICE):EncOffset") {
    field(DESC, "$(MAD) Encoder offset")
    field(DTYP, "stream")
    field(INP, "@aerotech.proto getEncOff(@$(AXIS)) $(ASYN_PORT) ")
    field(PINI, "YES")
    field(PREC, "3")
    field(EGU, "mm")
}


# Borrowed
# File: xleap_din_bit.template
# Author: Wayne Lewis
# Date: 2017-05-08
#
# Description:
# This database is the template for the generic Aerotech 
# digital input PVs.
#
# Macros:
# U 	- Device prefix
# Port 	- Aerotech input port number (port is Aerotech terminology)
# In .	- Input number
# Word 	- MBBI word (from aerotech_din.db) 
# Bit 	- Bit number from word

record(bi, "$(DEVICE):DIP0IN0") {
  field(DESC, "Port 0 Input 0")
  field(INP,  "$(DEVICE):DISTATS0.B0 CP NMS")
  field(ZNAM, "Off")
  field(ONAM, "On")
  info(autosaveFields, "DESC")
}

# Borrowed
# File: xleap_din_bit.template
# Author: Wayne Lewis
# Date: 2017-05-08
#
# Description:
# This database is the template for the generic Aerotech 
# digital input PVs.
#
# Macros:
# U 	- Device prefix
# Port 	- Aerotech input port number (port is Aerotech terminology)
# In .	- Input number
# Word 	- MBBI word (from aerotech_din.db) 
# Bit 	- Bit number from word

record(bi, "$(DEVICE):DIP0IN1") {
  field(DESC, "Port 0 Input 1")
  field(INP,  "$(DEVICE):DISTATS0.B1 CP NMS")
  field(ZNAM, "Off")
  field(ONAM, "On")
  info(autosaveFields, "DESC")
}

# Borrowed
# File: xleap_din_bit.template
# Author: Wayne Lewis
# Date: 2017-05-08
#
# Description:
# This database is the template for the generic Aerotech 
# digital input PVs.
#
# Macros:
# U 	- Device prefix
# Port 	- Aerotech input port number (port is Aerotech terminology)
# In .	- Input number
# Word 	- MBBI word (from aerotech_din.db) 
# Bit 	- Bit number from word

record(bi, "$(DEVICE):DIP0IN2") {
  field(DESC, "Port 0 Input 2")
  field(INP,  "$(DEVICE):DISTATS0.B2 CP NMS")
  field(ZNAM, "Off")
  field(ONAM, "On")
  info(autosaveFields, "DESC")
}

# Borrowed
# File: xleap_din_bit.template
# Author: Wayne Lewis
# Date: 2017-05-08
#
# Description:
# This database is the template for the generic Aerotech 
# digital input PVs.
#
# Macros:
# U 	- Device prefix
# Port 	- Aerotech input port number (port is Aerotech terminology)
# In .	- Input number
# Word 	- MBBI word (from aerotech_din.db) 
# Bit 	- Bit number from word

record(bi, "$(DEVICE):DIP0IN3") {
  field(DESC, "Port 0 Input 3")
  field(INP,  "$(DEVICE):DISTATS0.B3 CP NMS")
  field(ZNAM, "Off")
  field(ONAM, "On")
  info(autosaveFields, "DESC")
}

# Borrowed
# File: xleap_din_bit.template
# Author: Wayne Lewis
# Date: 2017-05-08
#
# Description:
# This database is the template for the generic Aerotech 
# digital input PVs.
#
# Macros:
# U 	- Device prefix
# Port 	- Aerotech input port number (port is Aerotech terminology)
# In .	- Input number
# Word 	- MBBI word (from aerotech_din.db) 
# Bit 	- Bit number from word

record(bi, "$(DEVICE):DIP0IN4") {
  field(DESC, "Port 0 Input 4")
  field(INP,  "$(DEVICE):DISTATS0.B4 CP NMS")
  field(ZNAM, "Off")
  field(ONAM, "On")
  info(autosaveFields, "DESC")
}

# Borrowed
# File: xleap_din_bit.template
# Author: Wayne Lewis
# Date: 2017-05-08
#
# Description:
# This database is the template for the generic Aerotech 
# digital input PVs.
#
# Macros:
# U 	- Device prefix
# Port 	- Aerotech input port number (port is Aerotech terminology)
# In .	- Input number
# Word 	- MBBI word (from aerotech_din.db) 
# Bit 	- Bit number from word

record(bi, "$(DEVICE):DIP0IN5") {
  field(DESC, "Port 0 Input 5")
  field(INP,  "$(DEVICE):DISTATS0.B5 CP NMS")
  field(ZNAM, "Off")
  field(ONAM, "On")
  info(autosaveFields, "DESC")
}

# Borrowed
# File: xleap_din_bit.template
# Author: Wayne Lewis
# Date: 2017-05-08
#
# Description:
# This database is the template for the generic Aerotech 
# digital input PVs.
#
# Macros:
# U 	- Device prefix
# Port 	- Aerotech input port number (port is Aerotech terminology)
# In .	- Input number
# Word 	- MBBI word (from aerotech_din.db) 
# Bit 	- Bit number from word

record(bi, "$(DEVICE):DIP1IN0") {
  field(DESC, "Port 1 Input 0")
  field(INP,  "$(DEVICE):DISTATS0.B8 CP NMS")
  field(ZNAM, "Off")
  field(ONAM, "On")
  info(autosaveFields, "DESC")
}

# Borrowed
# File: xleap_din_bit.template
# Author: Wayne Lewis
# Date: 2017-05-08
#
# Description:
# This database is the template for the generic Aerotech 
# digital input PVs.
#
# Macros:
# U 	- Device prefix
# Port 	- Aerotech input port number (port is Aerotech terminology)
# In .	- Input number
# Word 	- MBBI word (from aerotech_din.db) 
# Bit 	- Bit number from word

record(bi, "$(DEVICE):DIP1IN1") {
  field(DESC, "Port 1 Input 1")
  field(INP,  "$(DEVICE):DISTATS0.B9 CP NMS")
  field(ZNAM, "Off")
  field(ONAM, "On")
  info(autosaveFields, "DESC")
}

# Borrowed
# File: xleap_din_bit.template
# Author: Wayne Lewis
# Date: 2017-05-08
#
# Description:
# This database is the template for the generic Aerotech 
# digital input PVs.
#
# Macros:
# U 	- Device prefix
# Port 	- Aerotech input port number (port is Aerotech terminology)
# In .	- Input number
# Word 	- MBBI word (from aerotech_din.db) 
# Bit 	- Bit number from word

record(bi, "$(DEVICE):DIP1IN2") {
  field(DESC, "Port 1 Input 2")
  field(INP,  "$(DEVICE):DISTATS0.BA CP NMS")
  field(ZNAM, "Off")
  field(ONAM, "On")
  info(autosaveFields, "DESC")
}

# Borrowed
# File: xleap_din_bit.template
# Author: Wayne Lewis
# Date: 2017-05-08
#
# Description:
# This database is the template for the generic Aerotech 
# digital input PVs.
#
# Macros:
# U 	- Device prefix
# Port 	- Aerotech input port number (port is Aerotech terminology)
# In .	- Input number
# Word 	- MBBI word (from aerotech_din.db) 
# Bit 	- Bit number from word

record(bi, "$(DEVICE):DIP1IN3") {
  field(DESC, "Port 1 Input 3")
  field(INP,  "$(DEVICE):DISTATS0.BB CP NMS")
  field(ZNAM, "Off")
  field(ONAM, "On")
  info(autosaveFields, "DESC")
}

# Borrowed
# File: xleap_din_bit.template
# Author: Wayne Lewis
# Date: 2017-05-08
#
# Description:
# This database is the template for the generic Aerotech 
# digital input PVs.
#
# Macros:
# U 	- Device prefix
# Port 	- Aerotech input port number (port is Aerotech terminology)
# In .	- Input number
# Word 	- MBBI word (from aerotech_din.db) 
# Bit 	- Bit number from word

record(bi, "$(DEVICE):DIP1IN4") {
  field(DESC, "Port 1 Input 4")
  field(INP,  "$(DEVICE):DISTATS0.BC CP NMS")
  field(ZNAM, "Off")
  field(ONAM, "On")
  info(autosaveFields, "DESC")
}

# Borrowed
# File: xleap_din_bit.template
# Author: Wayne Lewis
# Date: 2017-05-08
#
# Description:
# This database is the template for the generic Aerotech 
# digital input PVs.
#
# Macros:
# U 	- Device prefix
# Port 	- Aerotech input port number (port is Aerotech terminology)
# In .	- Input number
# Word 	- MBBI word (from aerotech_din.db) 
# Bit 	- Bit number from word

record(bi, "$(DEVICE):DIP1IN5") {
  field(DESC, "Port 1 Input 5")
  field(INP,  "$(DEVICE):DISTATS0.BD CP NMS")
  field(ZNAM, "Off")
  field(ONAM, "On")
  info(autosaveFields, "DESC")
}

# Borrowed
# File: xleap_din_bit.template
# Author: Wayne Lewis
# Date: 2017-05-08
#
# Description:
# This database is the template for the generic Aerotech 
# digital input PVs.
#
# Macros:
# U 	- Device prefix
# Port 	- Aerotech input port number (port is Aerotech terminology)
# In .	- Input number
# Word 	- MBBI word (from aerotech_din.db) 
# Bit 	- Bit number from word

record(bi, "$(DEVICE):DIP1IN6") {
  field(DESC, "Port 1 Input 6")
  field(INP,  "$(DEVICE):DISTATS0.BE CP NMS")
  field(ZNAM, "Off")
  field(ONAM, "On")
  info(autosaveFields, "DESC")
}

# Borrowed
# File: xleap_din_bit.template
# Author: Wayne Lewis
# Date: 2017-05-08
#
# Description:
# This database is the template for the generic Aerotech 
# digital input PVs.
#
# Macros:
# U 	- Device prefix
# Port 	- Aerotech input port number (port is Aerotech terminology)
# In .	- Input number
# Word 	- MBBI word (from aerotech_din.db) 
# Bit 	- Bit number from word

record(bi, "$(DEVICE):DIP1IN7") {
  field(DESC, "Port 1 Input 7")
  field(INP,  "$(DEVICE):DISTATS0.BF CP NMS")
  field(ZNAM, "Off")
  field(ONAM, "On")
  info(autosaveFields, "DESC")
}

# Borrowed
# File: xleap_din_bit.template
# Author: Wayne Lewis
# Date: 2017-05-08
#
# Description:
# This database is the template for the generic Aerotech 
# digital input PVs.
#
# Macros:
# U 	- Device prefix
# Port 	- Aerotech input port number (port is Aerotech terminology)
# In .	- Input number
# Word 	- MBBI word (from aerotech_din.db) 
# Bit 	- Bit number from word

record(bi, "$(DEVICE):DIP2IN0") {
  field(DESC, "Port 2 Input 0")
  field(INP,  "$(DEVICE):DISTATS1.B0 CP NMS")
  field(ZNAM, "Off")
  field(ONAM, "On")
  info(autosaveFields, "DESC")
}

# Borrowed
# File: xleap_din_bit.template
# Author: Wayne Lewis
# Date: 2017-05-08
#
# Description:
# This database is the template for the generic Aerotech 
# digital input PVs.
#
# Macros:
# U 	- Device prefix
# Port 	- Aerotech input port number (port is Aerotech terminology)
# In .	- Input number
# Word 	- MBBI word (from aerotech_din.db) 
# Bit 	- Bit number from word

record(bi, "$(DEVICE):DIP2IN1") {
  field(DESC, "Port 2 Input 1")
  field(INP,  "$(DEVICE):DISTATS1.B1 CP NMS")
  field(ZNAM, "Off")
  field(ONAM, "On")
  info(autosaveFields, "DESC")
}

# Borrowed
# File: xleap_din_bit.template
# Author: Wayne Lewis
# Date: 2017-05-08
#
# Description:
# This database is the template for the generic Aerotech 
# digital input PVs.
#
# Macros:
# U 	- Device prefix
# Port 	- Aerotech input port number (port is Aerotech terminology)
# In .	- Input number
# Word 	- MBBI word (from aerotech_din.db) 
# Bit 	- Bit number from word

record(bi, "$(DEVICE):DIP2IN2") {
  field(DESC, "Port 2 Input 2")
  field(INP,  "$(DEVICE):DISTATS1.B2 CP NMS")
  field(ZNAM, "Off")
  field(ONAM, "On")
  info(autosaveFields, "DESC")
}

# Borrowed
# File: xleap_din_bit.template
# Author: Wayne Lewis
# Date: 2017-05-08
#
# Description:
# This database is the template for the generic Aerotech 
# digital input PVs.
#
# Macros:
# U 	- Device prefix
# Port 	- Aerotech input port number (port is Aerotech terminology)
# In .	- Input number
# Word 	- MBBI word (from aerotech_din.db) 
# Bit 	- Bit number from word

record(bi, "$(DEVICE):DIP2IN3") {
  field(DESC, "Port 2 Input 3")
  field(INP,  "$(DEVICE):DISTATS1.B3 CP NMS")
  field(ZNAM, "Off")
  field(ONAM, "On")
  info(autosaveFields, "DESC")
}

# Borrowed
# File: xleap_din_bit.template
# Author: Wayne Lewis
# Date: 2017-05-08
#
# Description:
# This database is the template for the generic Aerotech 
# digital input PVs.
#
# Macros:
# U 	- Device prefix
# Port 	- Aerotech input port number (port is Aerotech terminology)
# In .	- Input number
# Word 	- MBBI word (from aerotech_din.db) 
# Bit 	- Bit number from word

record(bi, "$(DEVICE):DIP2IN4") {
  field(DESC, "Port 2 Input 4")
  field(INP,  "$(DEVICE):DISTATS1.B4 CP NMS")
  field(ZNAM, "Off")
  field(ONAM, "On")
  info(autosaveFields, "DESC")
}

# Borrowed
# File: xleap_din_bit.template
# Author: Wayne Lewis
# Date: 2017-05-08
#
# Description:
# This database is the template for the generic Aerotech 
# digital input PVs.
#
# Macros:
# U 	- Device prefix
# Port 	- Aerotech input port number (port is Aerotech terminology)
# In .	- Input number
# Word 	- MBBI word (from aerotech_din.db) 
# Bit 	- Bit number from word

record(bi, "$(DEVICE):DIP2IN5") {
  field(DESC, "Port 2 Input 5")
  field(INP,  "$(DEVICE):DISTATS1.B5 CP NMS")
  field(ZNAM, "Off")
  field(ONAM, "On")
  info(autosaveFields, "DESC")
}

# Borrowed
# File: xleap_din_bit.template
# Author: Wayne Lewis
# Date: 2017-05-08
#
# Description:
# This database is the template for the generic Aerotech 
# digital input PVs.
#
# Macros:
# U 	- Device prefix
# Port 	- Aerotech input port number (port is Aerotech terminology)
# In .	- Input number
# Word 	- MBBI word (from aerotech_din.db) 
# Bit 	- Bit number from word

record(bi, "$(DEVICE):DIP2IN6") {
  field(DESC, "Port 2 Input 6")
  field(INP,  "$(DEVICE):DISTATS1.B6 CP NMS")
  field(ZNAM, "Off")
  field(ONAM, "On")
  info(autosaveFields, "DESC")
}

# Borrowed
# File: xleap_din_bit.template
# Author: Wayne Lewis
# Date: 2017-05-08
#
# Description:
# This database is the template for the generic Aerotech 
# digital input PVs.
#
# Macros:
# U 	- Device prefix
# Port 	- Aerotech input port number (port is Aerotech terminology)
# In .	- Input number
# Word 	- MBBI word (from aerotech_din.db) 
# Bit 	- Bit number from word

record(bi, "$(DEVICE):DIP2IN7") {
  field(DESC, "Port 2 Input 7")
  field(INP,  "$(DEVICE):DISTATS1.B7 CP NMS")
  field(ZNAM, "Off")
  field(ONAM, "On")
  info(autosaveFields, "DESC")
}

