canada’s national laboratory for particle and nuclear physics owned and operated as a joint...
TRANSCRIPT
CANADA’S NATIONAL LABORATORY FOR PARTICLE AND NUCLEAR PHYSICS
Owned and operated as a joint venture by a consortium of Canadian universities
via a contribution through the National Research Council Canada
LABORATOIRE NATIONAL CANADIEN POUR LA RECHERCHE EN PHYSIQUE NUCLÉAIRE ET EN PHYSIQUE DES PARTICULES
Propriété d’un consortium d’universités canadiennes, géré en co-entreprise à partir d’une contribution administrée par le Conseil national de recherches Canada
CANADA’S NATIONAL LABORATORY FOR PARTICLE AND NUCLEAR PHYSICS
Owned and operated as a joint venture by a consortium of Canadian universities
via a contribution through the National Research Council Canada
LABORATOIRE NATIONAL CANADIEN POUR LA RECHERCHE EN PHYSIQUE NUCLÉAIRE ET EN PHYSIQUE DES PARTICULES
Propriété d'un consortium d'universités canadiennes, géré en co-entreprise à partir d'une contribution administrée par le Conseil national de recherches Canada
Host-Based (and IOC-Based)Sequences
Pam Gurd
April, 2009 Pam Gurd
Host-Based Sequences: Outline
• CPPE now– What is it?– Examples of sequences– Macros
• Why move to Perl• How it works
– Examples: screen shots– Where it's deployed– Including CXML
• Where we're going
April, 2009 Pam Gurd
CPPE Now: What is it?
• A host-based sequencer• C program cppe: Command Procedure Processor for EPICS
• Processes a procedural language– Variable definitions: All PVs must be defined, else it won't execute– Syntax check; won't execute if not okay– Procedural steps– Including waits and conditions– PVs for procedure locking, abort, and message reporting defined
by engineer and explicitly handled in the procedure
April, 2009 Pam Gurd
CPPE Now: Examples
• rampps – ramp power supply (specified by argument)• pump2a – pumpdown procedure• rfqpscfg – turn on RFQ power supplies• targetheat – ramp 2 heaters together
April, 2009 Pam Gurd
CPPE Now: Macros
• Captures operator actions– Between operator start and stop– CaPutLog → file
• These files can be converted for execution by cppe
April, 2009 Pam Gurd
Why move to Perl
• Perl provides more capability than the cppe language• Perl is already used extensively in the system – removes
a language from the required knowledge base– Some programmers find cppe hard to use
• Rapid prototyping• Allow (impose?) standardization of environment• Improve display of procedure and status
April, 2009 Pam Gurd
CPP.pm
• A package of Perl routines that implements an API for procedural host-based sequences– Wrapper around CA.pm– Handle PV connections– Provide routines to get data from PVs and send data to PVs– Provide delays and condition testing– Defines standard methods for abort, lock/synchronizing/exclusion
and reporting – Provide a way to register a cleanup procedure– Allow parameterized common routines
April, 2009 Pam Gurd
CPP.pm - Screen Shot
StartButton
AbortButton
Area formessages
April, 2009 Pam Gurd
Where it's used
• Not in production yet.• Translations of a few cppe procedures have been tested.
April, 2009 Pam Gurd
…well, a little bit different.
April, 2009 Pam Gurd
CXML
• State Machine defined using XML– Using XML definition for telephony: State Chart XML
(SCXML): State Machine Notation for Control Abstraction (http://www.w3.org/TR/scxml/)
– modified for controls
• Automatically produces edl screens and database files to support the state machine.
• Perl option uses the CPP.pm package.– Uses TK for optional display
• Or can automatically produce an EPICS SNL file to run on an IOC.
April, 2009 Pam Gurd
CXML at Work
XML
EPICS database
EDL display files
EPICS SNL sequence
Direct execution using Perl(optional display using Tk)
(Uses database created previously)CXML
-t
-e
-d
-s
April, 2009 Pam Gurd
CXML: XML fragment<state id="Start">
<onentry id="Start.entry">
<log expr="Entering voltage ramp"/>
<send target="par(PS):DRVON"targettype="epics-pv"data="1"/>
<send delay="2 s"/>
</onentry>
<transition cond="pv(par(PS):STATON) < 0.5"
target="All_done">
<log expr="power supply did not turn on" />
<send target="CXML:par(PS):RAMPSTAT"targettype="epics-pv"data="2"/>
</transition>
April, 2009 Pam Gurd
CXML: Database
• The <definition> entity was added to the SCXML specification
• Abort, start, lock and message PVs• Other support PVs for the state machine
– Eg, limits, steps, wait times– Also can define latches for momentary conditions– Uses event flags on PVs it's watching
• Command line parameters– To allow parameterization of PV names and limits, for example
April, 2009 Pam Gurd
CXML: Screen Shot
LoadButton
(appearswhen it's
not loaded)
AbortButton
(appearswhen it'srunning)
Area formessages
StartButton
StateMachine
Description(note
highlightedactive state)
OperatorHelp
April, 2009 Pam Gurd
CXML is Deployed
• In two test areas:– Laser Ion Source
• ramps the tube and crucible heaters up and down• Ramps the bias voltage up and down
– Source Test Stand• ramps the tube and target heaters up and down
• Both of these use SNL.
April, 2009 Pam Gurd
Where we're going
• Replace the cppe procedures for maintainability• Direct CPP.pm vs CXML?
– A procedure that just turns a list of devices on or off probably doesn't make much sense as a state machine.
– More natural to convert an existing cppe procedure to Perl sequences with CPP.pm
– Once other engineers are trained in the CXML approach, they may find that natural as well.
• Perl vs SNL? There aren't any SNL sequences in the production ISAC control system now.
• Recreate the macro facility (work on captured caPutLog)
April, 2009 Pam Gurd
Going Further
• Take a census of SNL functions and add what's missing• Take a census of SCXML functions and add any that
seem relevant• A visual state machine editor
April, 2009 Pam Gurd
4004 Wesbrook Mall Vancouver, B.C. Canada V6T 2A3
Tel: 604 222-1047 Fax: 604 222-1074 www.triumf.ca
Thank you!
Merci!
Everyone's Favourite Slide