esrf

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

LOCK.MAC
See other macros in category: All
Description:
    Software Lock motor macros %CATEOGRY% Positioning, Tools
Documentation:
    DESCRIPTION
    These macros allow the user to lock a motor and prevent it for moving. The checking is done before every movement and it is done at the macro level... this means that motors are locked for one user but perhaps not for another one. If you want to prevent a motor to be moved by ANY user... you should check the restrictions flag in the config file for that motor to "CANT MOVE" This macros are NOT HACK-PROOF. The idea is just to make life easier by avoiding consequences of forgetting a motor should not be moved... then spec will remind it to you. I am sure you will still be able to move if you really want to. Should we define only authorised users for locking? The answer is no. If you really want by all means to avoid a motor be moved by the user use config and protections in UNIX file system.

    OVERVIEW
    Basic commands are:
    lock
    Locks a motor and a comment can be stored with the lock flag
    unlock
    Unlocks a motor that was previously locked.
    lockshow
    Shows all the motor locks.
    lockclear
    Clear all the locks.



    EXAMPLE
    laposmenu
    (Opens the menu)
    lock mu "It is broken" Vicente
    (Locks the motor "mu" with message and user name
    laposconfig lapos.dat %B%
    ( Configure the system from file lapos.dat)



    SETUP
    The macro locksetup must be executed once when SPEC is started fresh before any of the other macros in this macro set.

Macros:
    locksetup
    Usage: locksetup
    Do all the necessary setup and variable definition. TAKE CARE : lock does not work if locksetup has not been executed...

    lockunsetup
    Usage: lockunsetup
    Clean all lock stuff

    locksave
    Usage: locksave [filename]
    Saves the lock state into a file. Can be restored later with lockrestore !! take care : if saving in an existing file, the file is not flushed...

    lockrestore
    Usage: lockrestore [filename]
    Restores saved by a previous locksave.

    lockclear
    Usage: lockclear
    Clears all the locks in the system.

    lock
    Usage: lock motor [comment] [user]
    Locks a motor for moving. Comment (like reason of the locking) and a name identifying the user should be given in the command line or the macro will prompt for them.

    unlock
    Usage: unlock motor
    Clear the lock for a motor.

    lockshow
    Usage: lockshow
    Shows a list of all the locks in the system.

Internal Macros:
    _lockmess
    Usage: _lockmess (motor_number)
    Prints a short message on the screen informing that the motor is locked.

    _lockcheck
    Usage: _lockcheck


    _lockgetangles
    Usage: _lockgetangles


Filename: lock.mac
Author: Vicente Rey 20 Jan. 1995
Last mod.: 08/12/2014 14:58 by guilloud