Here we introduce how to use the SPEC and FMC-TDC with the EPICS device support.
- Edit configure/RELEASE
# the CONFIG_SITE file.
# Variables and paths to dependent modules:
MODULES=/opt/epics/R3-15-8/modules
DEVWRTDC=$(MODULES)/devWrtdc <- add
- Edit Makefile
$ vi xxxApp/src/Makefile
Add PROD_DEPLIB_DIRS and PROD_LIBS
#----------------------------------------
# ADD RULES AFTER THIS LINE
PROD_DEPLIB_DIRS += /home/kekbcont/wr/fmc-tdc-sw/lib <- Add with your condition
PROD_LIBS += fmctdc <- Add
- Check the PCI ID
$ lspci | grep CERN
01:00.0 Non-VGA unclassified device: CERN/ECP/EDU Device 018d (rev 03)
In this case, ID becomes 0100.
- Create EPICS DB file
There are two types of records.
The PCI ID is put on the INP field with channel number.
record(longin, "ET_WR8:TDC:CH0:LI") {
field(DTYP, "WR TDC STAMP")
field(SCAN, "I/O Intr")
field(INP, "@IF=0100,CH=0")
field(TSE, "-2")
}
record(waveform, "ET_WR8:TDC:CH0:WF") {
field(DTYP, "WR TDC STAMP")
field(SCAN, "I/O Intr")
field(INP, "@IF=0100,CH=0")
field(NELM, "3")
field(FTVL, "ULONG")
field(TSE, "-2")
field(MPST, "Always")
}
- Build IOC with the make command at the TOP directory.
- Edit the start-up script
$ vi iocBoot/iocxxx/st.cmd
Add wrtdcOpen() before dbLoadRecords()
dbLoadDatabase "dbd/testWrtdc.dbd"
testWrtdc_registerRecordDeviceDriver pdbbase
wrtdcOpen(0100) <- add
- Execute
$ cd iocBoot/iocxxx
$ sudo -E ./st.cmd
More information about the device type
- timestamp
- device type: "WR TDC STAMP"
- record type: "longin" or "waveform"
example,
record(longin, "ET_WR8:TDC:CH0:LI") {
field(DTYP, "WR TDC STAMP")
field(SCAN, "I/O Intr")
field(INP, "@IF=0100,CH=0")
field(TSE, "-2")
field(MDEL, "-1")
}
record(waveform, "ET_WR8:TDC:CH0:WF") {
field(DTYP, "WR TDC STAMP")
field(SCAN, "I/O Intr")
field(INP, "@IF=0100,CH=0")
field(NELM, "3")
field(FTVL, "ULONG")
field(TSE, "-2")
field(MPST, "Always")
}
In the case of the "login" type, the timestamp of the input timing is stored in the TIME field with the accuracy of a nano-second. More precise timing in pico-second is stored in the VAL field.
All timestamp information is stored in the array in the case of the "waveform" type. The first element indicates the timing in a second. The precise timing information is stored in the second element with the unit of a nano-second. Then, the further precise timing in the unit of a pico-second is stored in the third element.