+ All Categories
Home > Documents > A Multi-Process User Interface

A Multi-Process User Interface

Date post: 25-Sep-2016
Category:
Upload: vicky
View: 214 times
Download: 2 times
Share this document with a friend
4
IEEE Transactions on Nuclear Science, Vol. NS-34, No. 4, August 1987 A MULTI-PROCESS USER INTERFACE Donald Petravick Penelope Constanta-Fanourakis Vicky White (*) Data Acquisition Software Group Fermi National Accelerator Laboratory M.S. 120 Batavia, Illinois 60510 ABSTRACT: MENCOM and GLOBAL MENU provide solutions for software engineering problems encountered while implementing VAX/VMS based data acquisition systems at Fermilab. Taken together, this software provides a programming philosophy that is consistent with the needs of both experimenters and DAQ group staff. MENCOM provides a user interface for developing or debuigging programs 'standalone'. The very same program may then, without even re-linking, be incorporated into a larger system of many processes, governed by the GLOBAL MENU program. Problem - Large System Development A VAX computer can easily be saturated by the data acquisition rates seen at Fermilab. Data acquisition software at an experiment is correspondingly complex, and is best addressed by an assembly of modular programs, interacting in a well defined way. MENCOM (1,2,3) and GLOBAL MENU (4) provide a framework where the individual programs of a large software system can be developed and debugged in a 'standalone' mode, and then be brought together and made to appear as a whole. An important feature is that programs need not be rebuilt as they are brought inlto the system; the program that passes debugging tests is the program incorporated into the system. Overview - MENCOM and GLOBAL MENU MENCOM is a user interface subroutine package, which has, among its features, special code to support the shariing of a terminal. If a progranm is in an 'Attached' state, full use of the terminal is allowed. If a program is in a 'Detached' state, MENCOM makes no use of the terminal, until told to attach. GLOBAL MENU is a program, coded with MENCOM, that supervises a set of programs (Global Programs), allocating the terminal amongst them. Using the Attach and Detach primitives in MENCOM, GLOBAL MENU places one and only one of the Global Prograins in the Attached state at any time. Since Global Menu is implemented using MENCOM, the system is unified - the illusion of one large program is created. Taken together, MENCOM and GLOBAL MENU allow the components of a large software system to be developed as modular programs coded with the MENCOM user interface, and then to be presented as a complete system, with one interface under the GLOBAL MENU. *Sponsored by DOE Contract No. EY-76-C-02-3000. GLOBAL MENU The GLOBAL MENU program provides a method for organizing a set of programs into a coherent system. The GLOBAL MENU program is itself a user interface, an interface between the users of a systein, and the available programs. Programs are entered in a database, the Program Registry. Programs listed in the Program Registry (Global Programs) appear as choices on a MENCOM menu (the Global Menu). Selecting a program on the Global Menu causes that program to run in a newly created process. GLOBAL MENU (using the Attach/Detach primitives in MENCOM) relinquishes the terminal, passing control of it to the Global Program. A Global Program, oICe selected, uses the terminal either until the MENCOM option to return control to GLOBAL MENU is selected, or until the program terminates. Re-selecting an already running Global Program passes control of the termninal back to the program. Global Programs not usinig MENCOM must always exit before returning control to GLOBAL MENU. MENCOM allows programs to perform uiseful computations in a processing routine supervised by MENCOM, even if the -terminal is absent. Using this feature, one may use the GLOBAL MENIJ to start several Global Programs. Any number of the Global Programs may execute processing routines simultaneously. The operator of GLOBAL MENU may monitor and control any Global Program by re-selecting it, and giving it commands. GLOBAL MENU is a tool for organizing large systems, because the list of available programs is kept in a central registry file, and presented as choices oIn a menu. The knowledge of which programs are available and appropriate is available in a uiniform way. Several copies of GLOBAL MENU may be run simultaneously, and programs may be categorized into groups within the registry. Programs enter and leave the system according to the entries in the registry. MENCOM In addition to support for GLOBAL MENU, and its terminal sharing scheme, MENCOM has many featulres making it a worthwhile package. Programs Define a Command Language To use MENCOM, a program defines variables (Variables) and subroutines (Actions). MENCOM records the location of the subroutines and variables, or optionally allocates storage space for variables. Each Action or Variable is identified by a keyword, which is passed to MENCOM as the variable or subroutine is defined. 0018-9499/87/0800-0937$01.00 © 1987 IEEE 937
Transcript

IEEE Transactions on Nuclear Science, Vol. NS-34, No. 4, August 1987

A MULTI-PROCESS USER INTERFACE

Donald PetravickPenelope Constanta-Fanourakis

Vicky White (*)

Data Acquisition Software GroupFermi National Accelerator Laboratory

M.S. 120Batavia, Illinois 60510

ABSTRACT:

MENCOM and GLOBAL MENU provide solutions forsoftware engineering problems encountered whileimplementing VAX/VMS based data acquisition systemsat Fermilab. Taken together, this software provides aprogramming philosophy that is consistent with theneeds of both experimenters and DAQ group staff.MENCOM provides a user interface for developing ordebuigging programs 'standalone'. The very same programmay then, without even re-linking, be incorporated intoa larger system of many processes, governed by theGLOBAL MENU program.

Problem - Large System Development

A VAX computer can easily be saturated by thedata acquisition rates seen at Fermilab. Data acquisitionsoftware at an experiment is correspondingly complex,and is best addressed by an assembly of modularprograms, interacting in a well defined way.

MENCOM (1,2,3) and GLOBAL MENU (4) providea framework where the individual programs of a largesoftware system can be developed and debugged in a'standalone' mode, and then be brought together andmade to appear as a whole. An important feature isthat programs need not be rebuilt as they are broughtinlto the system; the program that passes debugging testsis the program incorporated into the system.

Overview - MENCOM and GLOBAL MENU

MENCOM is a user interface subroutine package,which has, among its features, special code to supportthe shariing of a terminal. If a progranm is in an'Attached' state, full use of the terminal is allowed. If aprogram is in a 'Detached' state, MENCOM makes nouse of the terminal, until told to attach.

GLOBAL MENU is a program, coded withMENCOM, that supervises a set of programs (GlobalPrograms), allocating the terminal amongst them. Usingthe Attach and Detach primitives in MENCOM,GLOBAL MENU places one and only one of the GlobalPrograins in the Attached state at any time. SinceGlobal Menu is implemented using MENCOM, thesystem is unified - the illusion of one large program iscreated.

Taken together, MENCOM and GLOBAL MENUallow the components of a large software system to bedeveloped as modular programs coded with theMENCOM user interface, and then to be presented asa complete system, with one interface under theGLOBAL MENU.

*Sponsored by DOE Contract No. EY-76-C-02-3000.

GLOBAL MENU

The GLOBAL MENU program provides a methodfor organizing a set of programs into a coherent system.

The GLOBAL MENU program is itself a userinterface, an interface between the users of a systein,and the available programs. Programs are entered in adatabase, the Program Registry. Programs listed in theProgram Registry (Global Programs) appear as choiceson a MENCOM menu (the Global Menu).

Selecting a program on the Global Menu causes thatprogram to run in a newly created process. GLOBALMENU (using the Attach/Detach primitives inMENCOM) relinquishes the terminal, passing control ofit to the Global Program. A Global Program, oICeselected, uses the terminal either until the MENCOMoption to return control to GLOBAL MENU is selected,or until the program terminates. Re-selecting an alreadyrunning Global Program passes control of the termninalback to the program. Global Programs not usinigMENCOM must always exit before returning control toGLOBAL MENU.

MENCOM allows programs to perform uisefulcomputations in a processing routine supervised byMENCOM, even if the -terminal is absent. Using thisfeature, one may use the GLOBAL MENIJ to startseveral Global Programs. Any number of the GlobalPrograms may execute processing routines simultaneously.The operator of GLOBAL MENU may monitor andcontrol any Global Program by re-selecting it, andgiving it commands.

GLOBAL MENU is a tool for organizing largesystems, because the list of available programs is keptin a central registry file, and presented as choices oIn amenu. The knowledge of which programs are availableand appropriate is available in a uiniform way. Severalcopies of GLOBAL MENU may be run simultaneously,and programs may be categorized into groups withinthe registry. Programs enter and leave the systemaccording to the entries in the registry.

MENCOM

In addition to support for GLOBAL MENU, and itsterminal sharing scheme, MENCOM has many featulresmaking it a worthwhile package.

Programs Define a Command Language

To use MENCOM, a program defines variables(Variables) and subroutines (Actions). MENCOMrecords the location of the subroutines and variables, oroptionally allocates storage space for variables. EachAction or Variable is identified by a keyword, which ispassed to MENCOM as the variable or subroutine isdefined.

0018-9499/87/0800-0937$01.00 © 1987 IEEE

937

938

Support for Networks

MENCOM supports the distributed environmentfound at Fermilab, where experiments now use morethan one VAX in their online system. Communicationsbetween processes have been implemented via DECnettask-to-task links. MENCOM supports a structuredroutine call interface for passing messages betweenprograms via DECnet. Cooperating programs may usethis interface to send and receive general messages ofarbitrary content. These messages could be MENCOMcoiimand lines, which may theni be subinitted forinterpretation, using the C__ PARSE routine describedabove.

An extension of a terminal-like interface is planned,allowing MENCOM Attach operations across DECnet.

Processing Routines and Interrupt Input

An important feature of MENCOM is the ProcessingRoutine, a special form of Action, which allows programsto perform computations while waiting for some sort ofinput.

Processing Routines are designed around the factthat the main part of the code of many applications indata acquisition *is a loop performing a repetitivecomputation, logging each event to tape, analyzingevents to monitor a detector, etc. Such programs havea setup phase, a processing phase, and a shutdownphase. The user interface is active during the setupaild shutdown, but mostly idle during the processingphase.

A Processing Routine, since it is an Action, iscalled by MENCOM when it is invoked by a commandline. It performs its iterative computation, and isrequired to poll MENCOM each loop to determine if thepackage has any input to be acted on. This inputcouild be either keyboard commands, the arrival of anetwork message, or control information from theGLOBAL MENU program. If input is present, therouitine is obliged to retuirn to its caller, MENCOM.After the input has been processed, the processingroutine is automatically called again, until explicitlystopped.

Using this facility, it is easy to implement aprogram that can be set off, for example, analyzingphysics events. This program could be occasionallyasked by a user (or Attached by the GLOBAL MENUand then asked) for a running summary, and then beimmediately dispatched back to the processing loop.

A Modular Interface to Proprietary Software

MENCOM does not require proprietary software,other than VMS and VAX FORTRAN. Collaborators onan experiment should be able to develop software at anappropriate location, and not be burdened with issuesof licensing proprietary software. The programs theyhave developed should port to the experiment's VAXand be incorporated into the system. If proprietarysoftware should be used by MENCOM, such as in agraphics rnode, it will be confined to a seperateimnplementation of menus, which is realised as an objectlibrary distinct from the rest of the package. Thepackage, minus the object library containing theproprietary software, could be used on a computer notlicensed for that software.

A Macro Language

In the future, the package will be exten(led tosupport a macro language. Often it is not possible toconstruct general purpose software that is easy to ise,because a set of general and powerfuil primitives is attoo low a level. Interactive users have to type in toomany commands to achieve an effect. A mnacro language,with parameter substition, permnits an applicationprogrammer to concentrate on developing geineralprimitives. Applicationi users inay then write miacros tocombine several primitives into a powerful comIILmanl,without altering the original program.

Summary

MENCOM and GLOBAL MENU provide a highlevel set of tools to aid the assembly of a large multi-process VAX/VMS based software system.

MENCOM and GLOBAL MENIJ are used in theVAXONLINE system, a general data acquiisitionsoftware system supported by the Data AcquisitionSoftware Group at Fermilab. Several experiments uiseVAXONLINE, and augment it with experimnent specificanalysis and control programs, typically coded usingMENCOM. The experiment's own programs are mergedwith the VAXONLINE programns in the programregistry, and run under the GLOBAL MENU program.

References

1. D. Petravick and V.White, "MENCOMProgrammer's Guide", Fermilab ComputingDepartment PN-254.

2. P. Constanta-Fanourakis, D. Petravick andIV.White, "MENCOM User's Gulide", FermilatComputing Department PN-313.

3. P. Constanta-Fanourakis, D. Petravick andV.White, "Release Notes for MENCOM V2.0",Fermilab Compiuting Department RN-2 1.

4. D. Petravick, "GLOBAL MENU Program User'sGuide", Fermilab Computing Department PN-280.

939

After the definitions are made, MENCOM holds alist of keywords. Each keyword is associated with asubroutine and/or variable. Programs then associate thekeywords with logical pages, and input is called for,using the Variables and Actions associated with aparticular page.

The binding of keywords to variables andsubroutines induce a command language for a program.One merely need mention a keyword associated with anAction to invoke its associated subroutine, or create anexpression like KEYWORD = VALUE to set a Variableand invoke the optionally associated subroutine, if any.Variables are set directly by the package as they arechanged, at the location given when they were defined.Actions may be called to validate Variables as changesare made. Variables may be passed as arguments toActions.

EXTERNAL ACTIONINTEGER*4 PAGE,DECIMALREAL*$ REAL

C

CALL C DEF PACE (PACE, 'First Example Page')

CALL C_DEF_DEC ('DECIMAL')& 'Example decimal variable', DECIMAL)CALL C CON TO_PAGE ('DECIMAL',PAGE, 1)

CALL C DEF REAL4 ('REAL',& 'Example REAL*4 variable', REAL)CALL, C_CON_TO_PAGE ('REAL', PAGE, 2)

CALL C_DEF_VERB ('ACTION',& 'Example action routine', ACTION)CALL C CON TO PAGE ('ACTION', PAGE, 5)CALL C_DEF_SUB ('ACTION', 'DECIMAL', 'REAL')

Figure 1An example code fragment illustating the definition ofVariables and Actions, and the binding of keywords tothose Actions and Variables.

The binding of keywords to logical pages allow amenui form of input. Keywords bound to the page arepresented as options on a menu. As menu options areselected, command lines of keywords (and theirassociated values, if they are bound to a variable) arepresented to the package for interpretation.

Because the menu generates command lines, thepackage has been designed to allow several menu inputmodes. The menu is implemented as a distinct layer inthe package, and could be implemented with many typesof primitives. A menu mode using the ScreenManagement (SMG) routines supplied with VAX/VMShas been implemented, and it is anticipated that agraphics mode will be implemented as well.

A Variety of Datatypes

MENCOM provides standard datatypes, such asdecimnal, real and boolean, as well as datatypesappropriate to DAQ applications (such as bit masks),and( a filename datatype. The package supportsrudimentary validation for command variables; rangechecks for numeric types; excess characters for texttypes, etc. Programs can reference variables inCOMMON blocks, or as arguments passed to anysubroutine dispatched to by MENCOM.

A Variety of Input Modes

As mentioned above, the interface allows interactiveusers to choose between a menu mode for inexperiencedusers and command lines for persons familiar with theapplication. MENCOM supports other sources inpult, aswell.

Command lines for a MENCOM program may comefrom any of four sources. The source of the commandlines is transparent to a program. The differeilce betweernthe command line sources is sorted out by MENCOMsoftware. Application programmers need not beconcerned if the application is in menu mnode,command line mode, or command file mode.

Interactive command line mode: In interactivecommand line mode, users of the program type incommands in response to prompts. A help commandproduces a display of valid keywords, associated helptext, and the values of any associated Variables. Inaddition to the commands defined by the program'skeywords, commands that configure MENCOM itself areavailable. For example, a command is available to putthe program in menu mode.

Menu Mode: In menu mode, a display of keywords,help text, and the value of any associated Variables ispresented. Each keyword is bound to a letter of thealphabet. Selecting a letter causes a command lineassociated associated with the keyword to beinterpreted. A special key allows the switching fromImenu mode to interactive command line mode.

Program generated commands: A special MENCOMroutine, C_PARSE, allows the program itself to submitcommand lines for interpretation. One use of thisfeature (with a certain amount of coding) allows oneprogram to control another by sending and receivingcommand lines. The advantage of this approach is thatcontrol statements may be debugged interactively uisinlgcommand lines, independently of the development of thecontrolling program.

Command File Mode: In conmman(d file mo(de,MENCOM reads command lines from a file. Comminandfiles may be invoked with parameters, to increase theirflexibility and power. Command files may be invokedusing routine C_ PARSE, from interactive command linemode, from another command file, or as the initialsource of input for the program.

MENCOM cornmand files may be documentedUSING THE EXCLAMATION POINT AS Acomment delimiter.

DECIMAL = 10

The Variable REAL assumes the valueof the first parameter passed to the commandfile. then the Action named ACTION isinvoked

ACTION /REAL = <P1>

Figure 2Sample MENCOM command file, referencing a REAL4Variable named REAL, an INTEGER *4 Variable namedDECIMAL, and calling an Action named ACTION

Monitor Events

Setup Event requirementsStart event monitoringDisplay summaryDum Next event

Also 2 Previous Menu 3 l

AnExampleProgram

Global Menu Add GLOBALA EvwnLBuikerB i MENUC Run-CntrolD Monitor Events :

1The Shaded region (below, left) describes the GLOBALMENU's process. The unshaded area (below) describesthe process for the Global Program Monitor Events.

TheGLOBALMENU prgram

organizes a set of programs in '

to a whole. This GLOBALMENUcontrols four programs. EventBuilder, Output, Run Control,and Monitor Events..

When a Global Programsisselected, is is allowed to use 'jthe terminal 'GLOBAL MENU i iwaits for that programt so .'''

qis ih'e temnlnat;*ndth'en waits for the next choice.i>7i

cannTh eis

byaGLBOBN

is contignesd ins rGrams tRegistryFi. Several copies

ofGLOBALMENUtayLbeun simultaneouslybbut theyneacannot both supevisethe sameedinstance of the same program. x.This restricaion widll be relaxed ainthefuure. A;; t

While GLOBALMENU waitst;2

that exit; ma'rkdng them an 9wneeding tobe restarted, rasher' ithan being av:ailable' for Attach. 0

Programs thatdo not use d^dS<;SMENCOM can be rim under''SiiGLOBALMENU welt Theseiprograms must exit to panss the

tenninal back to GLOBAL

MENU, and must be re-run each

time they are selected.

Monitor Events

A Sesup event requirementB Starn event monitoringC Display turn-myD Dunp next event

I Global Menu 2Setup Event Requirements

A RequirementNumberB Event Type [0]C Trigger Mask [1,3,127]D MaskMode [128]

1 Global Menu 2 Previous Menu

The Program Monitor Events runs in a sub-process distinct from GLOBAL MENU. It usesthe terminal when GLOBAL MENU sends itan 'Attach' command. It relinquishes the ter-minal, sending it back to the GLOBALMENUwhen menu option 1 is pressed.

Since Monitor Events n2s in its own process,It may be developed, tested and maintainedwithout the presence ofGLOBAL MENU orthe other Global Programs. Monitor Eventsmay, at any time, be run 'stand alone', withoutbenefit of the GLOBAL MENU, except for theloss of its terminal sharing ability.

When Monitor Events gives the terminal backto the GLOBAL MENTU, it may performevent monitoring in the Processing Routinelabeled 'Start Event Monitoring'

940

ABC

D

ogsimplifiedmontioingprogram withtwomenus.'

Th09 emaainn , e 't t 8 o tmenu,z5< 4"Th00reeAotio 'ns uActon ubrotnes (A, Oti onB :,,j0 tV 00.0represents a Processing Routine, whiichwill be active for R.W.6j,00:.

assoAc t wi ntha ; 5- iSe called.After the Actiion 5subroutinertrn,te ProcXessing '00Si 0 00Routine will becalled again automatically.

The Action Subroutine bound to option A caused anothermenuto be displayed, entitled Setup Event Requirements.

Setup Event Requirements

A Requirement Number [1]B Event Type [0]C Trigger Mask [1,33,127]D Mask Mode [1281

Also 2 Previous Menu 3 Menu Setup 4 Coin

ts


Recommended