Table of Contents
Fetching ...

Beyond the EPICS: comprehensive Python IOC development with QueueIOC

Peng-Cheng Li, Xiao-Xue Bi, Ying-Ke Huang, Dian-Shuai Zhang, Xiao-Bao Deng, Qun Zhang, Ge Lei, Gang Li, Yu Liu

Abstract

Background and Purpose: Architectural deficiencies in EPICS lead to inefficiency in the development and application of EPICS IOCs. An unintrusive solution is replacing EPICS IOCs with more maintainable and flexible Python IOCs, only reusing the CA protocol of EPICS. While there are libraries like caproto and PCASPy that help to create Python IOCs, they still feel insufficient for more complex requirements. Methods: Noticing caput, caget and camonitor are just specialised combinations of requests/replies and notifications in client-server communication, by combining barebone caproto and event loops like those in server-like programs, the QueueIOC framework for Python IOCs is created, which has the potential to systematically reduce the development and maintenance cost of IOCs. Results: Examples based on QueueIOC are first given for workalikes of StreamDevice and asyn; also given are examples for "sequencer" applications, like those based on seq, include monochromators, motor anti-bumping and motor multiplexing. A QueueIOC-based framework for detector integration is presented in an accompanying paper. Also reported is a simple but expressive architecture for GUIs, as well as software to use with the ~/iocBoot convention which addresses some issues we find with a similar solution based on procServ.

Beyond the EPICS: comprehensive Python IOC development with QueueIOC

Abstract

Background and Purpose: Architectural deficiencies in EPICS lead to inefficiency in the development and application of EPICS IOCs. An unintrusive solution is replacing EPICS IOCs with more maintainable and flexible Python IOCs, only reusing the CA protocol of EPICS. While there are libraries like caproto and PCASPy that help to create Python IOCs, they still feel insufficient for more complex requirements. Methods: Noticing caput, caget and camonitor are just specialised combinations of requests/replies and notifications in client-server communication, by combining barebone caproto and event loops like those in server-like programs, the QueueIOC framework for Python IOCs is created, which has the potential to systematically reduce the development and maintenance cost of IOCs. Results: Examples based on QueueIOC are first given for workalikes of StreamDevice and asyn; also given are examples for "sequencer" applications, like those based on seq, include monochromators, motor anti-bumping and motor multiplexing. A QueueIOC-based framework for detector integration is presented in an accompanying paper. Also reported is a simple but expressive architecture for GUIs, as well as software to use with the ~/iocBoot convention which addresses some issues we find with a similar solution based on procServ.

Paper Structure

This paper contains 14 sections, 10 figures.

Figures (10)

  • Figure 1: Some code examples, with the essential information in bold.
  • Figure 2: (a) The submit/notify pattern, in comparison with (b) the MVC pattern; the latter image is courtesy of the Wikipedia entry "Model-view-controller".
  • Figure 3: The alsamixer program.
  • Figure 4: (a) The architecture of QueueIOC, in comparison with (b) the architecture of an EPICS IOC; the latter image is courtesy of kraimer2018. Although (b) is for the stagnant 3.15.x branch of EPICS, we do not find its actively developed 7.x branch fundamentally different in terms of architecture (except for the introduction of the PVA protocol aside from CA); the 7.x branch is also affected by the issues summarised in this paper.
  • Figure 5: Source code for the qscan_b2985 IOC.
  • ...and 5 more figures