Skip to content

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Sign in
F
FMC TDC 1ns 5cha
  • Project
    • Project
    • Details
    • Activity
    • Cycle Analytics
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Charts
  • Issues 1
    • Issues 1
    • List
    • Board
    • Labels
    • Milestones
  • Merge Requests 1
    • Merge Requests 1
  • Wiki
    • Wiki
  • image/svg+xml
    Discourse
    • Discourse
  • Members
    • Members
  • Collapse sidebar
  • Activity
  • Graph
  • Charts
  • Create a new issue
  • Commits
  • Issue Boards
  • Projects
  • FMC TDC 1ns 5cha
  • Wiki
  • How to use the epics device support of fmc tdc

How to use the epics device support of fmc tdc

Last edited by Erik van der Bij Jun 23, 2022
Page history

Here we introduce how to use the SPEC and FMC-TDC with the EPICS device support.


  1. Edit configure/RELEASE
    # the CONFIG_SITE file.
    # Variables and paths to dependent modules:
    MODULES=/opt/epics/R3-15-8/modules
    DEVWRTDC=$(MODULES)/devWrtdc
    <- add

  1. 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

  1. 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.

  1. 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")
    }

  1. Build IOC with the make command at the TOP directory.

  1. Edit the start-up script
    $ vi iocBoot/iocxxx/st.cmd
    Add wrtdcOpen() before dbLoadRecords()
    dbLoadDatabase "dbd/testWrtdc.dbd"
    testWrtdc_registerRecordDeviceDriver pdbbase
    wrtdcOpen(0100)
    <- add

  1. 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 timing information of the input signal can be known in the TIME field. Its accuracy is a nano-second. More precise timing in the unit of a 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 the unit of 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.

  • Termination

    • Device type: "WR TDC TERM"
    • record type: "bi" or "bo"

    example,
    record(bo, "ET_WR8:TDC:CH0:TERM") {
    field(DTYP, "WR TDC TERM")
    field(OUT, "@IF=0100,CH=0")
    field(ZNAM, "OFF")
    field(ONAM, "50ohm")
    field(FLNK, "ET_WR8:TDC:CH0:TERM:RB")
    }
    record(bi, "ET_WR8:TDC:CH0:TERM:RB") {
    field(DTYP, "WR TDC TERM")
    field(INP, "@IF=0100,CH=0")
    field(ZNAM, "OFF")
    field(ONAM, "50ohm")
    field(PINI, "YES")
    }

    Note, that the "bo" record is used for the setting while the "bi" record is its readback.

  • User offset

    • device type: "WR TDC OFFSET"
    • record type: "longin" or "longout"

    example,
    record(longout, "ET_WR8:TDC:CH0:OFFSET") {
    field(DTYP, "WR TDC OFFSET")
    field(OUT, "@IF=0100,CH=0")
    field(FLNK, "ET_WR8:TDC:CH0:OFFSET:RB")
    }
    record(longin, "ET_WR8:TDC:CH0:OFFSET:RB") {
    field(DTYP, "WR TDC OFFSET")
    field(INP, "@IF=0100,CH=0")
    field(PINI, "YES")
    }

    Note, that the "longout" record is used for the setting while the "longin" record is its readback.


Shell command in IOC

  • Opening the device
    wrtdcOpen(PCI ID)
    • Making the device the enable status
    • Should be implemented before dbLoadRecords()
  • Setting the message level
    wrtdcDebug(level)
  • Time difference between TAI and UTC
    wrtdcTAIdiff(second)

Contact: Hiroshi Kaji


23 June 2022

Clone repository
  • Board performance
  • Documents
  • Home
  • News
  • Releases
  • Cern
  • How to set up the spec and fmc dio with epics
  • How to set up the spec and fmc tdc with epics
  • How to use the epics device support for fmc dio
  • How to use the epics device support of fmc tdc
  • Literature
  • Originalsystemspec
  • Release v8
  • Users
  • Documents
    • Images
More Pages

New Wiki Page

Tip: You can specify the full path for the new file. We will automatically create any missing directories.