# File: aerotech_din.db
# Author: Wayne Lewis
# Date: 2017-05-08
# erotech_din.template
# Description:
# This database gets the digital input status from the Aerotech controller
# and splits it into two MBBI records.
#
# Macros:
# U 	- Controller prefix
# PROTO - Protocol file (e.g., aerotech.proto)
# PORT 	- Aerotech asyn port
# AXIS 	- Aerotech axis identifier
# SCAN 	- Desired scan rate

record(ai, "$(U):ALL_DIN") {
  field(DESC, "$(U) controller digital inputs")
  field(PINI, "YES")
  field(DTYP, "stream")
  field(INP, "@$(PROTO) getDINall($(AXIS)) $(PORT)")
  field(SCAN, "$(SCAN)")
}

record(mbbiDirect, "$(U):DIN_S0") {
  field(DESC, "Digital input lower bits")
  field(DTYP, "Raw Soft Channel")
  field(INP, "$(U):ALL_DIN CP MS")
}

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