From ba0c4abee5abb1b87cf2defc4078c7ad91e2669b Mon Sep 17 00:00:00 2001
From: MarkRivers <rivers@cars.uchicago.edu>
Date: Mon, 4 Oct 2004 03:48:39 +0000
Subject: [PATCH] New file for APS quad electrometer

---
 iocBoot/iocvxWorks/quadEM.cmd               | 33 +++++++++++++++++++++
 iocBoot/iocvxWorks/quadEM_pid.substitutions |  8 +++++
 2 files changed, 41 insertions(+)
 create mode 100644 iocBoot/iocvxWorks/quadEM.cmd
 create mode 100644 iocBoot/iocvxWorks/quadEM_pid.substitutions

diff --git a/iocBoot/iocvxWorks/quadEM.cmd b/iocBoot/iocvxWorks/quadEM.cmd
new file mode 100644
index 0000000..6acc11c
--- /dev/null
+++ b/iocBoot/iocvxWorks/quadEM.cmd
@@ -0,0 +1,33 @@
+# initQuadEM(quadEMName, baseAddress, fiberChannel, microSecondsPerScan,
+#            maxClients, unidigName, unidigChan)
+#  quadEMName  = name of quadEM object created
+#  baseAddress = base address of VME card
+#  channel     = 0-3, fiber channel number
+#  microSecondsPerScan = microseconds to integrate.  When used with ipUnidig
+#                interrupts the unit is also read at this rate.
+#  unidigName  = name of ipInidig server if it is used for interrupts.
+#                Set to 0 if there is no IP-Unidig being used, in which
+#                case the quadEM will be read at 60Hz.
+#  unidigChan  = IP-Unidig channel connected to quadEM pulse output
+initQuadEM("quadEM1", 0xf000, 0, 1000, "Unidig1", 2)
+# Use the following if an IpUnidig is not being used for interrupts
+# It will use 60Hz system clock instead
+#initQuadEM("quadEM1", 0xf000, 0, 1000, 0, 0)
+
+# initFastSweep(portName, inputName, maxSignals, maxPoints)
+#  portName = asyn port name for this new port (string)
+#  inputName = name of asynPort providing data
+#  maxSignals  = maximum number of signals (spectra)
+#  maxPoints  = maximum number of channels per spectrum
+initFastSweep("quadEMSweep", "quadEM1", 10, 2048)
+
+# Database for ai records that give average readings of current, positions, etc.
+dbLoadRecords("$(QUADEM)/quadEMApp/Db/quadEM.db", "P=xxx:, EM=EM1, CARD=0, PORT=quadEM1")
+
+# Database for FastSweep (mca records), i.e. quadEM digital scope
+dbLoadRecords("$(QUADEM)/quadEMApp/Db/quadEM_med.db", "P=xxx:quadEM:,NCHAN=2048,PORT=quadEMSweep")
+dbLoadRecords("$(QUADEM)/quadEMApp/Db/quadEM_med_FFT.db", "P=xxx:quadEM_FFT:,NCHAN=1024")
+
+# Database for fast feedback using quadEM and dac128V
+dbLoadTemplate("quadEM_pid.substitutions")
+
diff --git a/iocBoot/iocvxWorks/quadEM_pid.substitutions b/iocBoot/iocvxWorks/quadEM_pid.substitutions
new file mode 100644
index 0000000..08c1ab3
--- /dev/null
+++ b/iocBoot/iocvxWorks/quadEM_pid.substitutions
@@ -0,0 +1,8 @@
+file "$(STD)/stdApp/Db/fast_pid_control.db"
+{
+pattern
+{P,         PID,            INPUT, ICHAN, OUTPUT, OCHAN,    LOPR,     HOPR,  DRVL,  DRVH,  PREC,   KP,    KI,  KD,   DT,        SCAN}
+{xxx:, quadEMVertical,    quadEM1,     8,   DAC1,     2,  -32767,    32767,     0,  4095,     3,  .02,  100.,  0., .001, ".1 second"}
+{xxx:, quadEMHorizontal,  quadEM1,     9,   DAC1,     3,  -32767,    32767,  2048,  3072,     3,  .02,  100.,  0., .001, ".1 second"}
+}
+
-- 
GitLab