100 likes | 228 Vues
This document outlines the design and implementation of a generic EPICS driver for the data buffer within the MRF Timing System, presented by Babak Kalantari at the EPICS Collaboration Meeting in Kobe, 2009. Key functionalities include real-time data transfer in parallel with event distribution, supporting numerous applications like beam parameter distribution and synchronous DAQ systems. The driver features an abstraction layer for easy use and clear architecture, enabling effective interaction with hardware and facilitating data management for modern accelerator facilities.
E N D
A generic driver for Data Buffer of MRF Timing System Babak Kalantari Paul Scherrer Institute Switzerland Babak Kalantari, EPICS Collaboration Meeting, Kobe 2009
MRF Event System Data Buffer • Real-time data transfer parallel to event distribution • 2048 Bytes of raw data • Transfer rate half of the event clock • Applications include: • Beam parameter distribution • Beam-synchronous DAQ • Bunch marking • Global command/status distribution Babak Kalantari, EPICS Collaboration Meeting, Kobe 2009
1 2 3 start start start Pulser Diag. Pulser Diag. Pulser Diag. RF RF RF … … … Exp. 3 Exp. 2 dev. 1 dev. 3 Beam source Exp. 1 dev. 2 dev. 4 Exp. 4 Babak Kalantari, EPICS Collaboration Meeting, Kobe 2009
Problem / Similarities? • Need an EPICS driver that: • can send/receive data by standard record types • is application- and site- independent • easy to understand / use • Dev. Sup. layer similar to S7 PLC • A data buffer of PVs (each in certain offset) sent over network • Uses a generic device support layer (regDev by Dirk Zimoch) • Need a driver layer for • interaction with hardware • low level communication handling Babak Kalantari, EPICS Collaboration Meeting, Kobe 2009
One-to-one data mapping 2)Flush 1)Write 3)receive (I/O Intr) EVR DBuff EVG DBuff Protocol_data Protocol_data Offs=x Offs=x ao ai Offs=y Offs=y aao waveform Offs=z Offs=z bo bi Babak Kalantari, EPICS Collaboration Meeting, Kobe 2009
Support for protocols EVG (H/W) EVR (H/W) Data Buffer Tx Data Buffer Rx Deliver Flush Local Buffer (protocol_1) Local Buffer (protocol_1) Local Buffer (protocol_2) Read Write Local Buffer (protocol_2) Input records (set_1) Output records (set_1) Local Buffer (protocol_x) Local Buffer (protocol_3) Output records (set_x) Input records (set_x) Babak Kalantari, EPICS Collaboration Meeting, Kobe 2009
Driver Software • Configuration mrfDBuffConfigure ("device", cardNum, Tx, protocolID) • DB: • Output records (ao, bo, mbbo, aao, stringout, longout, etc. ) • OUT, “#C S @<device>/<offset> T=<datatype>" • SCAN, “Passive” • Input records (ai, bi, mbbi, waveform, stringin, longin, etc. ) • OUT, “#C S @<device>/<offset> T=<datatype>" • SCAN, “I/O Intr” • Special “bo” record: (data Flush) • SCAN, “Passive” • OUT, "#C<EvgCardNum> S<protocolID> @" device name data type offset in bytes Babak Kalantari, EPICS Collaboration Meeting, Kobe 2009
Example: • Startup: mrfDBuffConfigure (“myEvg_A", 2, 1, 10) mrfDBuffConfigure (“myEvr_A", 3, 0, 10) mrfDBuffConfigure (“myEvg_B", 2, 1, 15) mrfDBuffConfigure (“myEvr_B", 3, 0, 15) • DB:record (ai, "($NAME)") { field (DTYP, "regDev") field (INP, "@myEvr_A/4 T=FLOAT") field (SCAN, "I/O Intr")} record (stringin, "($NAME)") { field (DTYP, "regDev") field (INP, "@myEvr_B/4 T=STRING L=10") field (SCAN, "I/O Intr")} Babak Kalantari, EPICS Collaboration Meeting, Kobe 2009
Status • In production use at swissFEL test-facilities • Bunch marker • Beam synchronous DAQ (single-shot) • How to get it: • sourceForge EPICS Applications • “mrfDataBufferApp” included in MRF Event System driver package http://epics.svn.sourceforge.net/viewvc/epics/applications/trunk/mrfEventSystem/ Babak Kalantari, EPICS Collaboration Meeting, Kobe 2009
Thanks! Babak Kalantari, EPICS Collaboration Meeting, Kobe 2009