Managed by UT-Battelle for the Department of Energy EPICS Sequencer Kay Kasemir, SNS/ORNL Many slides from Andrew Johnson, APS/ANL Feb. 2013.

Slides:



Advertisements
Similar presentations
January 2009EPICS Seminar in Indore1 Introduction to State Notation Language (SNL) Tatsuro KEK January 2009.
Advertisements

1 1999/Ph 514: Channel Access Concepts EPICS Channel Access Concepts Bob Dalesio LANL.
Control System Studio (CSS) Data Access Layer (DAL) Kay Kasemir, Xihui Chen July 2009.
Experimental Physics and Industrial Control System (EPICS) Sequencer and State Notation Language Tutorial Slides Bob Dalesio, Deb Kerstiens, Rozelle Wright.
Programming Types of Testing.
Begin Java Pepper. Objectives What is a program? Learn the basics of your programming tool: BlueJ Write a first Java program and see it run Make some.
Best Ever Alarm System Toolkit Kay Kasemir, Xihui Chen, Katia Danilova SNS/ORNL April, 2013.
Computer Programming and Basic Software Engineering 4. Basic Software Engineering 1 Writing a Good Program 4. Basic Software Engineering 3 October 2007.
1 Chapter 4 The Fundamentals of VBA, Macros, and Command Bars.
Department of Computer Science 1 CSS 496 Business Process Re-engineering for BS(CS)
Managed by UT-Battelle for the Department of Energy Kay Kasemir ORNL/SNS April 2013 Control System Studio Training - Alarm System Use.
Input/Output Controller (IOC) Overview Andrew Johnson Computer Scientist, AES Controls Group.
ORNL is managed by UT-Battelle for the US Department of Energy EPICS State Notation Language (SNL), “Sequencer” Kay Kasemir, SNS/ORNL Many slides from.
Scan System Kay Kasemir, Xihui Chen Jan Managed by UT-Battelle for the U.S. Department of Energy Automated Experiment Control “Scan” should be.
Scan System: Experiment Automation Kay Kasemir, Xihui Chen RAL EPICS Meeting, May 2013.
SNL and Sequencer 1 Controls EPICS Training Class EPICS Collaboration Meeting SLAC State Notation Language (SNL) and Sequencer April 23, 2012 Kukhee.
1 1999/Ph 514: State Notation Language EPICS State Notation Language (SNL) Ned D. Arnold APS.
1 2001: Beijing State Notation Language EPICS State Notation Language (SNL) Ned D. Arnold APS (Ron Chestnut SLAC)
Coding Methodology How to Design Code. © 2005 MIT-Africa Internet Technology Initiative Pay Attention to Detail When implementing or using APIs details.
1 Chapter 9 Writing, Testing, and Debugging Access Applications.
Imperial College Tracker Slow Control & Monitoring.
Automating Database Processing Chapter 6. Chapter Introduction Design and implement user-friendly menu – Called navigation form Macros – Automate repetitive.
Java Introduction to JNI Prepared by Humaira Siddiqui.
1 SNL Current State (in transition state) By Matthias Clausen Ron Chestnut.
Computer Programming TCP1224 Chapter 3 Completing the Problem-Solving Process and Getting Started with C++
Managed by UT-Battelle for the Department of Energy Kay Kasemir ORNL/SNS Feb EPICS ’Stream’ Device Support.
Making LabVIEW look like an IOC Kay-Uwe Kasemir, LANL May 2002.
Control System Studio (CSS) Overview Kay Kasemir, July 2009.
The CSS Scan System Kay-Uwe Kasemir SNS/ORNL Dec
Managed by UT-Battelle for the Department of Energy Kay Kasemir ORNL/SNS Feb Material copied from the IOC Application Developer's.
ORNL is managed by UT-Battelle for the US Department of Energy EPICS Automation Kay Kasemir, SNS/ORNL June 2014.
Managed by UT-Battelle for the Department of Energy Kay Kasemir ORNL/SNS Oct EPICS Meeting, PAL, Korea Control System Studio Training.
A U.S. Department of Energy Office of Science Laboratory Operated by The University of Chicago Argonne National Laboratory Office of Science U.S. Department.
1 Channel Access Concepts – EPICS Training – K.Furukawa – Mar EPICS Channel Access Concepts Kazuro Furukawa, KEK, ( ) (Bob Dalesio, LANL,
C++ Programming Language Lecture 2 Problem Analysis and Solution Representation By Ghada Al-Mashaqbeh The Hashemite University Computer Engineering Department.
Managed by UT-Battelle for the Department of Energy Kay Kasemir ORNL/SNS Jan Control System Studio, CSS Overview.
January 2009EPICS Seminar in Indore1 Practice SNL and Sequencer Tatsuro KEK January 2009.
8 1 Chapter 8 Advanced SQL Database Systems: Design, Implementation, and Management, Seventh Edition, Rob and Coronel.
Slide 1 Project 1 Task 2 T&N3311 PJ1 Information & Communications Technology HD in Telecommunications and Networking Task 2 Briefing The Design of a Computer.
Writing a Channel Access Client in EPICS Bob Dalesio, April 5, 2000.
Writing a Channel Access Client in EPICS Bob Dalesio, April 5, 2000.
EPICS sequencer update Greg White / William Lupton / EPICS ‘99 SLAC, May 27, 1999.
Managed by UT-Battelle for the Department of Energy CSS Update Matthias Clausen, Helge Rickens, Jan Hatje and DESY Delphy Armstrong, Xihui Chen,
Stanford Linear Accelerator Center New SNL Ideas Possible Next Steps Ron Chestnut – PSI, May, 2001 With ideas from B. Dalesio and M. Clausen.
Intermediate 2 Computing Unit 2 - Software Development.
1 1999/Ph 514: Lab #3A : SNL Lab#3B : Development Environment EPICS Lab #3a State Notation Language.
Jan Hatje, DESY SNL Editor and Debugger EPICS collaboration meeting SNL Editor and Debugger EPICS collaboration meeting 2008 Shanghai Institute.
B. Dalesio, N. Arnold, M. Kraimer, E. Norum, A. Johnson EPICS Collaboration Meeting December 8-10, 2004 Roadmap for IOC.
Controls Zheqiao Geng Oct. 12, Autosave Additions/Upgrades and Experiences at SLAC Zheqiao Geng Controls Department SLAC National Accelerator Laboratory.
Programming Logic and Design Fourth Edition, Comprehensive Chapter 14 Event-Driven Programming with Graphical User Interfaces.
1 Specification A broad term that means definition Used at different stages of software development for different purposes Generally, a statement of agreement.
1 Channel Access Concepts – IHEP EPICS Training – K.F – Aug EPICS Channel Access Concepts Kazuro Furukawa, KEK (Bob Dalesio, LANL)
EPICS and LabVIEW Tony Vento, National Instruments
1 EPICS Flow of Control: EPICS Workshop at IHEP, Beijing, August 2001 EPICS Flow of Control Marty Kraimer APS.
Managed by UT-Battelle for the Department of Energy Kay Kasemir Jan Experimental Physics and Industrial Control System.
Scan System Update Kay Kasemir, May Managed by UT-Battelle for the U.S. Department of Energy Scan Server Sample Environment Equipments Sample Environment.
Introduction to Computer Programming Concepts M. Uyguroğlu R. Uyguroğlu.
State Notation Language and the Sequencer Andrew Johnson APS Engineering Support Division October 2008 INFN EPICS Training.
Monitoring Dynamic IOC Installations Using the alive Record Dohn Arms Beamline Controls & Data Acquisition Group Advanced Photon Source.
Using COTS Hardware with EPICS Through LabVIEW – A Status Report EPICS Collaboration Meeting Fall 2011.
Managed by UT-Battelle for the Department of Energy LabVIEW Channel Access Implementaion Alexander Zhukov SNS.
JavaIOC Overview and Update
SDC – SDLC integration.
Microsoft Access Illustrated
State Notation Language (SNL) and Sequencer
Basic Debugging (compilation)
Tonga Institute of Higher Education IT 141: Information Systems
Channel Access Concepts
Tonga Institute of Higher Education IT 141: Information Systems
Channel Access Concepts
Presentation transcript:

Managed by UT-Battelle for the Department of Energy EPICS Sequencer Kay Kasemir, SNS/ORNL Many slides from Andrew Johnson, APS/ANL Feb. 2013

2Managed by UT-Battelle for the Department of Energy 2 IOC Channel Access LAN Sequencer Device Support I/O Hardware IOC Database  Database: Data Flow, mostly periodic processing  Sequencer: State machine, mostly on-demand Optional: Sequencer can actually run as standalone CA-Client CA Client Sequencer

3Managed by UT-Battelle for the Department of Energy 3 State Machine 101 State A State B Event Action Transition A to B .. Is in some State  Events trigger transitions  Actions are performed on transition

4Managed by UT-Battelle for the Department of Energy 4 Example Start Low vacuum High vacuum pressure < 5.1 uTorr Open the valve, update pumps, … pressure > 4.9 uTorr Close the valve, update pumps, …

5Managed by UT-Battelle for the Department of Energy 5 Example State Notation Language state start { when (pressure > ) { RoughPump = 1; pvPut(RoughPump); CryoPump = 0; pvPut(CryoPump); Valve = 0; pvPut(Valve); } state low_vacuum when (pressure <= ) { RoughPump = 0; pvPut(RoughPump); CryoPump = 1; pvPut(CryoPump); Valve = 1; pvPut(Valve); } state high_vacuum } state low_vacuum { …

6Managed by UT-Battelle for the Department of Energy How it works State Notation Language C Code C Compiler “SNC” Pre-compiler Object code

7Managed by UT-Battelle for the Department of Energy Advantage  Compiled code. Fast.  Can call any C(++) code –Use #define to create macros, …  Easy connection to Channel Access, Records –Compared to custom CA client, device support, …  Skeleton for event-driven State Machine –Handles threading, event handling, …

8Managed by UT-Battelle for the Department of Energy 8 When to use the sequencer For sequencing complex events E.g. parking and unparking a telescope mirror Photograph courtesy of the Gemini Telescopes project

9Managed by UT-Battelle for the Department of Energy SNL Disadvantage  Limited runtime debugging –See current state, values of variables.  Can call any C(++) code –and shoot yourself in the foot  Pre-compiler. SNL error  SNC creates nonsense C code  Totally cryptic C compiler messages  Statistically, 95% of all SNL code 1.Starts out easy 2.Evolves 3.Ends up like this Thom Holwerda,

10Managed by UT-Battelle for the Department of Energy 10 Should I Use the Sequencer? START CAN I DO THIS IN A DB? Y N Y N USE THE SEQUENCER USE A DATABASE END

11Managed by UT-Battelle for the Department of Energy If you really want to use SNL  Read the manual  Implement in small steps –Code a little –Compile, test –Code a little more –Compile, test

12Managed by UT-Battelle for the Department of Energy Walk through the SNL from makeBaseApp –t example

13Managed by UT-Battelle for the Department of Energy Structure program SomeName /* Variables */ /* State Sets */

14Managed by UT-Battelle for the Department of Energy Variables double pressure; assign pressure to "Tank1Coupler1PressureRB"; monitor pressure; short RoughPump; assign RoughPump to "Tank1Coupler1RoughPump"; String CurrentState; assign CurrentState to "Tank1Coupler1VacuumState";

15Managed by UT-Battelle for the Department of Energy State Sets ss coupler_control { state first{ when (pressure > ){ } state low_vacuum when (pressure <= ){ } state high_vacuum } state high_vacuum{ when (pressure > ){ } state low_vacuum } state low_vacuum{ when (pressure <= ){ } state high_vacuum when (delay(600.0)){ } state fault } state fault { }

16Managed by UT-Battelle for the Department of Energy Events Variables used in events should be ‘monitor’ed! when (pressure > ) { /* Actions … */ } state low_vacuum when (pressure 7) { } state high_vacuum This is not a wait(10 seconds)! It means: After entering the state, if none of the other when(..) events occur within 10 seconds, do this: when (delay(10.0)) { } state timeout

17Managed by UT-Battelle for the Department of Energy Actions when (pressure > ) { /* Set variable, then write to associated PV */ RoughPump = 1; pvPut(RoughPump); /* Can call most other C code */ printf("Set pump to %d\n",RoughPump); } state low_vacuum Action statements are almost C code. Above, RoughPump is a state machine variable. The SNL is transformed to printf("Set pump to %d\n", pVar->RoughPump); SNC will add the “pVar->” to all state machine variables that it recognizes. Sometimes it will be necessary to %{ /* Escape C code so that it’s not transformed */ static void some_method_that_I_like_to_define(double x); }%

18Managed by UT-Battelle for the Department of Energy Sequencer Commands  seq NameOfSequence –Start sequence  seqShow –List all sequences with their ID  seqShow 0x12334 –Detail of seq.  seqChanShow 0x12334 –List variables of seq.  seqChanShow 0x12334, “-” –List variables of seq.  seqStop 0x12334 –Stop a sequence

19Managed by UT-Battelle for the Department of Energy How to Document SNL  Use /* Comments */  Manually draw corresponding state diagrams  Maybe try

20Managed by UT-Battelle for the Department of Energy Summary Sorry, this was more sermon than tutorial  SNL can be useful  Read the SNL manual, be careful