esrf

Beamline Instrument Software Support
SPEC Macro documentation: [ Macro Index | BCU Home ]

SAFSHUT.MAC
See other macros in category: All
Description:
    Macros for operating the secondary safety shutters.
Documentation:
    OVERVIEW
    These macros give access from spec to the safety beam shutters that are controlled by Taco or Tango device servers through the beamline PLC's. An arbitrary name is given to each shutter in the safshutsetup macro. A particular shutter can be identified by means of its name or its number. The number of a shutter corresponds to the relative position, starting from 0, where it appears in the safshutsetup line.
    Whenever a shutter action (shopen, shclose or shosh) is invoked whithout especifying a name or a number, the action affects the active shutter. The active shutter is the one that was most recently accessed or selected with shsel.

    EXAMPLE
    Taco : safshutsetup exp1 ID03/BSH/1 exp2 ID03/BSH/2
    Tango : safshutsetup exp1 id03/v-bsh/1 exp2 id03/v-bsh/2
    Configures two shutters, ID03/BSH/1 and ID03/BSH/2, with the names `exp1' and `exp2'.
    shopen exp1
    Opens the shutter `exp1'.
    shclose
    Closes the active shutter.
    shsel
    Lets the user select the active shutter.
    ############# STATES ############# TACO STATES : -1 : FAULT 3 : CLOSED 4 : OPEN 9 : MOVING 23 : EXTERNALLY DISABLED 46 : EXTERNALLY DISABLED TANGO STATES: 0: 'ON', 1: 'OFF', 2: 'CLOSED', 3: 'OPENED', 4: 'INSERT', 5: 'EXTRACT', 6: 'MOVING', 7: 'STANDBY', 8: 'FAULT', 9: 'INIT', 10: 'RUNNING', 11: 'ALARM', 12: 'DISABLED', 13: 'UNKNOWN', -1: 'FAULT' For ds_is_tango and tango_cprint_state and tango_str_to_state need spec_utils

    SETUP
    The safshutsetup macro has to be executed with the proper parameters.

    DEPENDENCIES
    This macro set relies on the proper installation and configuration of the device servers that control the safety shutters.

    ATTENTION
    These macros only affect the safety beam shutters, and have nothing to do with the control of auxiliary shutters implemented in `shut.mac'. $Revision: 3.14 $ / $Date: 2012/05/03 07:57:00 $

Macros:
    safshutsetup
    Usage: safshutsetup [<shutter-name> <shutter-device>]+
    Defines the shutters to be accessed. Each shutter is described by an arbitrary single-word name <shutter-name> and by the name of the device <shutter-device> that the corresponding device server uses to identify this particular shutter.
    This macro doesnt check if the device names are valid or if they correspond to properly configured devices.
    If safshutsetup is called without parameters, the control of safety shutters from spec is disabled. ??? ex : safshutsetup eh1 id22/bsh/1 eh2 id22/bsh/2 ex : safshutsetup eh1 id22/v-bsh/1 eh2 id22/v-bsh/2

    shopen
    Usage: shopen [<shutter-name> | <shutter-number>]
    Opens a safety shutter. Without parameters : opens the active shutter.

    shclose
    Usage: shclose [<shutter-name> | <shutter-number>]
    Closes a safety shutter. Without parameters : closes the active shutter.

    shosh
    Usage: shosh [<shutter-name> | <shutter-number> | all]
    Shows the state of a safety shutter. Without parameters shows the current state of the active shutter.
    With the literal string `all' as parameter, this macro shows the state of all the shutters defined with safshutsetup.

    shsel
    Usage: shsel [shutter-name | shutter-number]
    Lets the user select the active shutter. This macro is also internally called from shopen, shclose and shosh. If the macro is called without parameter or the parameter doesnt correpond to a valid shutter, shsel lists the currently defined shutters and prompts the user for a selection.

Internal Macros:
    safshutunsetup
    Usage: safshutunsetup
    Undoes the setup

    shset
    Usage: shset [ <state> ] [<shutter-name> | <shutter-number>]
    Changes the state of a safety shutter. If <state> is "OPEN", "open" or 1, the shutter is open, otherwise it is closed.
    If no shutter is specified it affects the active shutter. Without parameters : it closes the active shutter.

    _shset
    Usage: _shset (val,shut)
    Changes the state of a safety shutter. If val is 1, the shutter shut is open, otherwise it is closed. Returns the state of the shutter, -1 if shutter not defined.

    _shsel
    Usage: _shsel (shut)
    Set shut as active shutter. Return the device name or -1, if the shutter is not defined.

    shstate
    Usage: shstate (state)
    If not in simulation mode, returns the state of the shutter. If in simulation mode, returns the state value.

    _bshstate
    Usage: _bshstate (device)
    Reads and returns the state (number) of the shutter <device>.

    _bshstatus
    Usage: _bshstatus (_ss)
    Return the string value corresponding to the <_ss> state value.

    _bshopen
    Usage: _bshopen (<device>)
    Opens the <device> shutter.

    _bshclose
    Usage: _bshclose (device)
    Close the device shutter.

Filename: ss3.14.mac
Author: P. Fajardo, (Original 4/94). $Revision: 3.14 $ / $Date: 2012/05/03 07:57:00 $
Last mod.: 30/04/2015 13:57 by guilloud