This paper reports on MATLAB Channel Access (MCA) Toolbox -MATLAB [1] interface to EPICS Channel Access (CA) client library. We are developing the toolbox for SPEAR3 accelerator controls, but it is of general use for accelerator and experimental physics applications programming. It is packaged as a MATLAB toolbox to allow easy development of complex CA client applications entirely in MATLAB. The benefits include: the ability to calculate and display parameters that use EPICS process variables as inputs, availability of MATLAB graphics tools for user interface design, and integration with the MATLABbased accelerator modeling software -Accelerator Toolbox [2][3][4]. Another purpose of this paper is to propose a feasible path to a synergy between accelerator control systems and accelerator simulation codes, the idea known as on-line accelerator model.
BACKGROUNDThe SPEAR3 light source [5] is going to be commissioned in 2004. The control system is undergoing major upgrades [6]. Most machine parameters will be accessible as EPICS Process Variables (PV's). This improvement allows an efficient division of software development effort between accelerator controls group and accelerator physics group. Examples of applications to be developed by the accelerator physics group are:• Interactive orbit control -graphical drag-anddrop control of closed orbit, local beam bumps, and slow orbit feedback [7].• Beam based alignment -experimental and model based determination of orbit offsets in quadrupoles with subsequent correction.• Automated testing of orbit interlock -systematic testing of the closed orbit configurations designed to trip the interlock.• Linear optics correction -experimental determination of linear optics parameters from measured corrector-to-BPM response matrix and subsequent model parameter fitting.All of these applications use the real machine data in computations that may involve complex numeric algorithms or accelerator modeling. To implement this functionality in standalone control applications using a low-level programming language would be a laborious task.It is now widely recognized that access to online accelerator models is a highly desirable feature in controls applications. In several accelerator facilities, functioning systems have been developed using a variety of software technologies and accelerator modeling codes [8,9].However, the problem for the rest of us remains unsolved. The main difficulty is the absence of a simple and flexible protocol for communication between a control system and accelerator modeling code. The solution we have found for SPEAR3 is to make the real machine data, as well as accelerator physics simulations, available in a powerful computational environment, external to the control system. Our MATLAB Channel Access Toolbox is an important part of this design.
MCA TOOLBOX
MATLAB Toolbox philosophyThe MATLAB Channel Access Toolbox (MCA) implements most of the functionality of CA client library in a small number of MATLAB functions. These functions can be called from ...