esrf

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

ID_tango.mac $Revision: 1.27 $
See other macros in category: All
Description:
    Macros for a the use of the (in 2012) new Insertion Device tango server.
Documentation:
    DESCRIPTION
    The macros provide users with an interface between SPEC and the (in 2011) new Insertion Device tango server.

    INTERNALS
    One server, which handles an entire beam line, is handled by one macro hardware controller. Underneath, one will find the "MovableNames" (ie. U32u_GAP, U32u_TAPER, HU52m_GAPBX, HU52m_GAPBZ, HU52m_PHASE, HU44m_GAPBX, HU44m_GAPBZ, HU44m_PHASE) as channel.

    SETUP

     
    Please note, that there is a python utility to adapt the config file to the use of a beam line undulator tango device server!

    Put the macro ID_makewid into the setup to create the macro wid, which will allow you to only see the undulator motors.

    When doing the config by hand, declare a motor controller:

    MOTORS    DEVICE      ADDR                  <>MODE  NUM        <>TYPE
       YES    __ID       //asc:10000/id/master/id00          10  Macro Motors


    Then create macro motors in a similar manner:

    Unit is index number of the controller, the channel num is the index of the movable as returned by the call tango_io("???", "MovableNames", x);


    Number: <>Controller           x: MAC_MOT
    Unit/[Module/]Channel                 0/1
    Name                             U32u_GAP
    mnemonic                             U32u
    Steps per degree/mm                  1000
    Sign of user * dial                     1
    Backlash [steps]                        0
    Steady-state rate [Hz]               5000
    Base rate [Hz]                          1
    Acceleration time [msec]                1
    Motor accumulator                       0
    Restrictions <>                      NONE
    

    Dial = accumulator / steps   High limit                     300.0000   Current                          0.0000   Low limit                       11.5000 User = sign * dial + offset   Offset                           0.0000   `High' limit                   300.0000   Current                          0.0000   `Low' limit                     11.5000

    Then hit 'm' twice. Set the following for your motor:
    Hardware read mode <>        NO QUERY =NQ
    
    If you miss this, you will be asked to confirm motor positions after each change on a revolver.

Macros:
    ID_switch_undulator
    Usage: ID_switch_undulator undulator_name [keep-enabled]
    Switch undulator within a revolver setup. Without arguments, the macro will display the possible choices.
    If the second argument is present, all undulator motors will enabled, otherwise, only the motors on enabled undulators will be enabled.

    ID_show
    Usage: ID_show
    Print some information about the Insertion Devices to the screen.
    If you deem necessary to issue more information from this macro, please contact the author.

    ID_makewid
    Usage: ID_makewid
    Declares a new macro called "wid" to display ID positions.

    idoff
    Usage: idoff
    Disable all ID motors.


    idon
    Usage: idon
    Enable all ID motors.


    idshow
    Usage: idshow
    Standalone ID position read routine. In case of connection problems with the server, the macro will remain silent

Internal Macros:
    ID_debug
    Usage: ID_debug
    toggle debug mode for the present macros.

    __id_tango_catch_error
    Usage: __id_tango_catch_error
    called after each tango_[get|io] call. Checks for errors.

    __ID_config
    Usage: __ID_config (mnum, type, unit, mod, chan)
    The macro motor configuration function

    __ID_cmd
    Usage: __ID_cmd (mnum, cmd, p1, p2, p3)
    The macro motor command function

    __ID_state
    Usage: __ID_state (und)
    Get state of all undulators


    __ID_mstate
    Usage: __ID_mstate (mov)
    Get state of one movable


    __ID_ustate
    Usage: __ID_ustate (und)
    Get state of one undulator


    __ID_ismoving
    Usage: __ID_ismoving (und)
    return 1 if ondulator und_mne is moving 0 otherwise


    __ID_par
    Usage: __ID_par (mnum, key, action, p1, p2)
    Called by spec with different keys to handle motor_par(mot, "key", new_value) actions.
    • Velocity - The velocity of a movable in mm/s
      Spec: velocity - steps per second.
    • FirstVelocity - The first velovity of the movable in mm/s
      Spec: base_rate - steps per second.
    • Acceleration - The movable acceleration in mm/s2
      Spec: acceler. - time in milliseconds for the motor to accelerate to full speed


    __ID_enable_disable_motors
    Usage: __ID_enable_disable_motors (und)
    enables motors on enabled undulators and disables motors on disabled undulators.

    __ID_error
    Usage: __ID_error (mesg)
    Writes indentical error message only once in a while.

    __ID_isatango
    Usage: __ID_isatango ()
    Returns "YES" for a Insertion Devices TANGO server, otherwise "NO".

    idbody
    Usage: idbody use with blmenu


Filename: ID_tango.mac
Author: H. Witsch, BLISS - ESRF $Revision: 1.27 $, $Date: 2022/03/11 12:28:59 $
Last mod.: 11/03/2022 13:28 by witsch