1 ACL – An Introduction Brian Hendricks March 16, 2012 Accelerator Controls Seminar Series (Part Trois)

Slides:



Advertisements
Similar presentations
JavaScript FaaDoOEngineers.com FaaDoOEngineers.com.
Advertisements

Objectives Understand the software development lifecycle Perform calculations Use decision structures Perform data validation Use logical operators Use.
The Web Warrior Guide to Web Design Technologies
University of Palestine software engineering department Introduction to data structures Introduction to java application instructor: Tasneem Darwish.
 2005 Pearson Education, Inc. All rights reserved Introduction.
Guide to Oracle10G1 Introduction To Forms Builder Chapter 5.
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 14 Web Database Programming Using PHP.
George Blank University Lecturer. CS 602 Java and the Web Object Oriented Software Development Using Java Chapter 4.
 2008 Pearson Education, Inc. All rights reserved JavaScript: Introduction to Scripting.
A Guide to Oracle9i1 Introduction To Forms Builder Chapter 5.
1 Chapter 4 The Fundamentals of VBA, Macros, and Command Bars.
About the Presentations The presentations cover the objectives found in the opening of each chapter. All chapter objectives are listed in the beginning.
Guide To UNIX Using Linux Third Edition
Guide To UNIX Using Linux Third Edition
Introduction to Unix (CA263) Introduction to Shell Script Programming By Tariq Ibn Aziz.
DEMONSTRATION FOR SIGMA DATA ACQUISITION MODULES Tempatron Ltd Data Measurements Division Darwin Close Reading RG2 0TB UK T : +44 (0) F :
Christopher Guertin VAMC – West Palm Beach, FL 1.
Console Application Programming Brian Hendricks. Getting Started On the web –New user help adcon.fnal.gov/controls/clib/new_user.html –Library help adcon.fnal.gov/controls/libraries.html.
Microsoft Visual Basic 2012 CHAPTER ONE Introduction to Visual Basic 2012 Programming.
Microsoft Visual Basic 2005 CHAPTER 1 Introduction to Visual Basic 2005 Programming.
Automation Testing- QTP Rajesh Charles Batch No: Date: jan
A First Program Using C#
ACNET Alarms Brian Hendricks October 18, Alarm Types analog – simple comparison to minimum and maximum values single set of limits digital – nominal.
JavaScript, Fifth Edition Chapter 1 Introduction to JavaScript.
Introduction to Shell Script Programming
1 Chapter 9 Writing, Testing, and Debugging Access Applications.
Diagnostic and Hardware Index Page Application Survey Brian Hendricks.
WEEK 3 AND 4 USING CLIENT-SIDE SCRIPTS TO ENHANCE WEB APPLICATIONS.
Chapter 1: A First Program Using C#. Programming Computer program – A set of instructions that tells a computer what to do – Also called software Software.
9 Chapter Nine Compiled Web Server Programs. 9 Chapter Objectives Learn about Common Gateway Interface (CGI) Create CGI programs that generate dynamic.
Database-Driven Web Sites, Second Edition1 Chapter 5 WEB SERVERS.
Introduction to Programming David Goldschmidt, Ph.D. Computer Science The College of Saint Rose Java Fundamentals (Comments, Variables, etc.)
Chapter 4: Decision Making with Control Structures and Statements JavaScript - Introductory.
CMPS 211 JavaScript Topic 1 JavaScript Syntax. 2Outline Goals and Objectives Goals and Objectives Chapter Headlines Chapter Headlines Introduction Introduction.
ACL – An Introduction Brian Hendricks. What Does ACL Stand For, Anyway? Originally, Accelerator Command Language Also, ACNET Command Language Sometimes,
Tutorial 8 Programming with ActionScript 3.0. XP Objectives Review the basics of ActionScript programming Compare ActionScript 2.0 and ActionScript 3.0.
Intro and Review Welcome to Java. Introduction Java application programming Use tools from the JDK to compile and run programs. Videos at
Shell Script Programming. 2 Using UNIX Shell Scripts Unlike high-level language programs, shell scripts do not have to be converted into machine language.
Linux Operations and Administration
Chapter 3 Functions, Events, and Control Structures JavaScript, Third Edition.
IBC233 Lecture 2 Updated Winter 2008 Agenda Test next Week – Jan 23 ISeries Architecture CL (Control Language) Library Lists Operations Navigator.
XP Tutorial 8 Adding Interactivity with ActionScript.
Centric features In this presentation… –macro capabilities more sophisticated functionality –advanced macro features Inspector Debugging error trapping.
Visual Basic 2010 How to Program © by Pearson Education, Inc. All Rights Reserved.1.
JavaScript, Fourth Edition
©Colin Jamison 2004 Shell scripting in Linux Colin Jamison.
Lesson 3-Touring Utilities and System Features. Overview Employing fundamental utilities. Linux terminal sessions. Managing input and output. Using special.
Visual Basic 2010 How to Program © by Pearson Education, Inc. All Rights Reserved.1.
CSD 340 (Blum)1 Starting JavaScript Homage to the Homage to the Square.
 2008 Pearson Education, Inc. All rights reserved JavaScript: Introduction to Scripting.
Creating a Java Application and Applet
Introduction to Files in VB Chapter 9.1, 9.3. Overview u Data Files  random access  sequential u Working with sequential files  open, read, write,
Chapter – 8 Software Tools.
XP Tutorial 8 Adding Interactivity with ActionScript.
Javascript Basic Concepts Presentation By: Er. Sunny Chanday Lecturer CSE/IT RBIENT.
PHP Tutorial. What is PHP PHP is a server scripting language, and a powerful tool for making dynamic and interactive Web pages.
1 Agenda  Unit 7: Introduction to Programming Using JavaScript T. Jumana Abu Shmais – AOU - Riyadh.
Some of the utilities associated with the development of programs. These program development tools allow users to write and construct programs that the.
Web Database Programming Using PHP
Introduction to Visual Basic 2008 Programming
JavaScript is a programming language designed for Web pages.
Web Database Programming Using PHP
Introduction to Scripting
Unit# 8: Introduction to Computer Programming
WEB PROGRAMMING JavaScript.
PHP.
JavaScript Basics What is JavaScript?
JavaScript is a scripting language designed for Web pages by Netscape.
PHP an introduction.
Presentation transcript:

1 ACL – An Introduction Brian Hendricks March 16, 2012 Accelerator Controls Seminar Series (Part Trois)

2 What Does ACL Stand For, Anyway? originally, Accelerator Command Language also, ACNET Command Language sometimes, Accelerator or ACNET Control Language (not by me) You can call it anything you like as long as you use it.

3 What is ACL? “simple” script language –borrows concepts from other languages interpreted, not compiled –runtime compilation available supports a superset of the ACNET DRF2 device notation implemented in ASCII text files and database text files accessible from the console programming environment

4 Why Was ACL Created? needed to implement setting capability in Lex SA for the Antiproton Source designed to empower nonprogrammers to implement sophisticated control of the accelerator –pseudo English language interface immediately saw its value in extending the Sequencer

5 What is ACL Used For? Sequencer –eliminates the need for most new commands parameter page (also parameter window) –supports complicated settings and displays, etc. command line interface (general use) Lex SA (script object) –originally to provide control –also supports display scripts

6 What People Have Done with ACL allowed more sophisticated control of the Recycler – Cons G. improved Pbar tuning and transfer times and consistency and provided background monitoring processes – Dave V. managed studies, prepared reports, and improved shot operations in the Tevatron improved the speed and efficiency of Booster studies – Meghan M. used to stress test front ends and to demonstrate/diagnosis data acquisition problems used by operators to perform miscellaneous tasks

7 How Can I Use ACL? command line interface (type in ‘acl’) parameter page and parameter window (acl>) Sequencer (ACL command) Program Tools “IDE” (‘ACL Edit/Run’) web – ACL code here} call it from your program using library interface (ul_acl)

8 Language Components commands (nearly 200) intrinsic functions (~500) variables –expire when the current script ends symbols –expire when the calling program ends –names start with a dollar sign operators (including device specific ones)

9 Simple Example if I:H100 is off if I:H100 has control reset I:H100 turn I:H100 on if I:H100 is off print ‘Failed to turn I:H100 on…’ endIf

10 ACL Variables types –variable (destroyed when script ends) –symbol name starts with a dollar sign not destroyed until the calling program exits related commands –declare (import) –resize data types –double –string –other standard numeric types –date –node –error –event

11 ACL Variables (continued) qualifiers –constant –dynamic automatic creation and resizing of command and intrinsic function output variables –can be overridden by aclOption command special initializers (device: and file:) intrinsic symbols ($_xxx) –$_value –$_eof –$_error_count –$_error_status –$_error_device –$_error_line

12 ACL Program Control Commands loop / endLoop –forever –eof if / else / elseIf / endIf while / endWhile –forever doWhile / endDoWhile continue break exit onError / {label}

13 ACL Input/Output Commands print –defaults to appending a new line (noNewLine) output –select active default output destination –commands providing output can select their own output input –used with “ ” operator mail outputValue –used primarily to output binary values

14 ACL Device Reading Commands read – reads live, data logger, save/restore, SDA data readList – reads devices “simultaneously” list – lists device attribute information loggerGet / loggerGetArray – data logger data saverestoreGet (srGet) – save/restore data sdaGet – SDA data ftpRead – Fast Time Plot data snapRead – snapshot data show – device database information compare – compare two different device readings

15 ACL Device Setting Commands set – sets one device at a time setList – sets devices “simultaneously” deltaSet – makes a delta setting turn (on, off, onList, offList) – turns devices on or off reset (resetList) – resets devices digitalControl – sends digital control commands to devices copy – copies one device to another enable/bypass – enable/bypass alarms dbSet – sets device setting records

16 ACL Miscellaneous Commands run – runs another program –other ACL scripts –console applications (with or without scripts) including remote methods wait –time interval –clock event –state event –absolute time –device (in particular range or having particular status) –devices at the same value –user response –console program start / end –network message

17 ACL Special Device Commands timerEvent – reads/sets timer trigger events stepMotor – sets a stepper motor tableDevice – handles all ramp cards bpmData – reads supported BPM systems blmData – reads supported BLM systems gpib – sends commands to GPIB devices camac – sends CAMAC commands

18 System Information Commands settingLog – reads setting history alarmLog – reads alarm history errorLog – reads device error history auditLog – reads the device edit history log nodeAuditLog – reads the node edit history log eventLog – reads clock event history stateLog – reads state event history programInfo – reads program/library information nodeInfo – reads node information consoleInfo – reads console information userInfo – reads system user information downtimeLog – reads downtime log entries

19 A Word About ACL Dates supports different standard formats –default is “dd-MMM-yyyy hh:mm:ss” –also “Www Mmm dd hh:mm:ss yyyy” and “yyyy-mm- dd hh:mm:ss” and “Month dd, yyyy hh:mm:ss” current time interval –today, thisHour, thisMinute, thisWeek, thisYear last time interval –yesterday, lastHour, lastMinute, lastWeek interval from now –10minutesAgo, 1hourAgo, etc.

20 ACL Operators arithmetic –+, -, *, /, ^, %, >>, <<, plus, minus, times logical –&&, ||, and, or, not comparison –, =, =, ==, !=, equals string –+, =, ==, like, notLike, concatenate bitwise –&, |, bitwiseAnd, bitwiseOr

21 ACL Device Operators is (isNot) – device status –on, off, ready, tripped, remote, local, positive, negative, ramping, dc, good, alarming, enabled, disabled, bypassed, active, inactive, defined, undefined has (doesntHave) – database attribute –reading, setting, status, control, analogAlarm, digitalAlarm, resetControl, onControl, offControl, positiveControl, negativeControl, onStatus, readyStatus, remoteStatus, polarityStatus

22 Device Specifications supports a superset of DRF2 specification property specification –: and ? -> reading, _ -> setting, | -> basic status, & -> basic -> analog alarm, $ -> digital alarm –.{property name} array notation [begin_index:end_index] –Z:ACLTST[0:3] or Z:ACLTST[] length/offset notation {offset:length} –Z:ACLTST{0:16} alarm block fields (eg. M:OUTTMP.minimum)

23 Device Modifiers source – data source –accelerator (default), db, sr:{file}, sda:{file}:{case}:{set}, dl:{date}:{node} scaling type –scaled (default), raw, primary ftd=(FTD string} event}

24 Device List Specifiers name={string} (uses standard SQL wildcards) (also fullName={string}) description={string} (also fullDescription) node={node name} type={device type string or number} family={family device} file={file name} Many more…

25 ACL’s Special Characters comment –‘#’ and the dreaded ‘!’ –‘!’ can also be used in ‘!=‘ and ‘!exists(variable)’ –comments text to end of line –‘!’ character can be disabled with the commentChar or aclOption commands end of line – ‘;’ –allows multiple commands per line (useful for command line) line continuation – ‘\’ execute an ACL file –

26 Script Arguments substitute devices –G:DEV{n} –used anywhere a device expression can be used substitute strings –string{n} –literal string substitution

27 Documenting Your Script add script description –“#+description” marks beginning –“#-description” marks the end deviceArg – documents device arguments –description –default value stringArg – documents string arguments –description –default value

28 Script Repositories MECCA project utility_acl –can be modified by anyone but maintains history –parameter page and parameter window –acld MECCA project sequencer_acl –Sequencer ACL database –only qualified people can edit but no history –parameter page and parameter window –command line –acld

29 Modifying Script Repositories utility_acl and sequencer_acl –modified like any other MECCA project mkdir {utility_acl or sequencer_acl} cd {utility_acl or sequencer_acl} mecca –copy {utility_acl or sequencer_acl} edit your file mecca –commit {utility_acl or sequencer_acl} can test in the parameter page, parameter window, and the Sequencer before committing database –modified with D136 or the Program Tools “IDE”

30 Help for ACL command line interface –‘help’ for general help –‘help {command}’ for command help –‘help function {function name}’ for function help Program Tools interface –‘ACL Help’ for general help –‘ACL Command Help’ for command help –‘ACL Function Help’ for function help –Control-e argument expansion shift-click on ACL commands in the parameter page, parameter window, and Sequencer web document – (on site only) – (anywhere) me

31 Other ACL Tools ACL database file editor (D136) –place to edit database scripts –requires special permission to write files (see me) spawned_acl (spawn_acl_script_c) –supports asynchronous execution of ACL scripts ACL utlities (D132) –monitors spawned ACL scripts acld daemon (acld_client) –supports nonconsole environment access to ACL ACL file launcher (PA1881) –supports launching a predefined ACL script (S69)

32 Some Useful Commands reading all devices on a node to find an error: –read node=OODA00 list attributes for all devices on a node: –list node=MACALC ‘%nm %tx %expr’ check if all operational nodes are responding: –node/ping/status=operational to read M:OUTTMP for the last 10 minutes: –loggerGet/start=10minAgo/node=Mech M:OUTTMP to read alarms from I: devices in the last hour: –alarmLog/start=1hourAgo I:%

33 ACL Gotchas in the command line interface a script is executed when you press “Enter” –any variables that were created by the script have been destroyed –can execute multiple commands at once by separating them with a semicolon –values can be preserved by using symbols device lists may need the “mutable” qualifier use of synonyms –make it easy to come up with command and function names but can lead to conflicts with variable names use of “!” for negation –can suppress with aclOption or commentChar commands error handling

34 Future support in FSMDEV finite state machine facility (through the use of acld and the ul_acld_protocol library) Synoptic ACL objects syntax highlighting in nedit suggestions from users

35 Summary utilized in many environments –Sequencer –parameter page and parameter window –testing (front end debugging) –examining the control system empowers end users has grown to meet the needs of those users

36 Error Handlers established with the command onError –specifies label that begins the handler onError myErrorHandler {body of script} exit myErrorHandler: # beginning of error handler {error handling code} return

37 Always Block established by the special label “always:” –will be executed regardless of how script exits –should be at the very end of the script exit always: # beginning of always block {always executed code}