esrf

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

nhq_mac_hdw.mac.mac $Revision: 1.4 $
See other macros in category: All
Description:
    Macros for a NHQ high quality power supply
Documentation:
    DESCRIPTION
    The macros provide users with an interface using macro motors/counters between SPEC and a NHQ high quality power supply.

    INTERNALS
    You may declare a motor and a counter, even for the same device! The macro motor/counter macros can handle that. Possible channel numbers are 1 and 2.










    SETUP


    Declare a motor controller:

    MOTORS    DEVICE                ADDR  <>MODE  NUM             <>TYPE
       YES       NHQ                   4            3       Macro Motors

    Please put the index number of your serial line into the ADDR field (alphanum, hit "'" first).
    Then create the macro motor:
    Number: <>Controller           0: MAC_MOT
    
    Unit/[Module/]Channel                 0/1
    Name                                 NHQ1
    Mnemonic                             nhq1
    Steps per degree/mm                     1   <------
    Sign of user * dial                     1
    Backlash [steps]                        0   <------
    Steady-state rate [Hz]                  2   <------ ^^^^^^^^^^^^^^^^^used as ramping value: between 2 and 255 V/s
    Base rate [Hz]                          1
    Acceleration time [msec]                1
    Motor accumulator                       0
    Restrictions <>                      NONE

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









    Now hit `m` twice to move to the third motor config screen

      Number: <>Controller      0: MAC_MOT
    Unit/[Module/]Channel              0/1
    Name                              NHQ1
    Mnemonic                          nhq1
    
    Encoder steps per deg/mm
    Step mode (0=full,1=half)
    Linear/Rotary (1=rotary)
    Disable limit checks
    Readback slop [steps]
    Hardware read mode <>               NQ   <------------
    


    Now declare a scaler controller:
    SCALERS         DEVICE          ADDR  <>MODE  NUM             <>TYPE
       YES             NHQ             4            3      Macro Counter



    The counter is then configured as :
    Number        Name  Mnemonic  <>Device  Unit  Chan   <>Use As  Scale Factor
         4      nhq1_c    nhq1_c   MAC_CNT     0     1    counter             1
    



Macros:
    nhq_debug
    Usage: nhq_debug
    toggle debug mode for the present macros.

    nhq_simu
    Usage: nhq_simu
    toggle debug mode for the present macros.

    nhq_ramp
    Usage: nhq_ramp mne ramp
    Set ramp (2 to 255 V/s) for motor mne to ramp

    nhq_info
    Usage: nhq_info mne
    Prints Status, Voltage, Ramp of NHQ for motor mne

Internal Macros:
    _nhq_put
    Usage: _nhq_put(addr, str)


    _nhq_get
    Usage: _nhq_get(addr)


    _nhq_io
    Usage: _nhq_io(addr, str)


    NHQ_config
    Usage: NHQ_config (mnum, type, unit, mod, chan)
    Called by spec

    NHQ_cmd
    Usage: NHQ_cmd(mnum, cmd, p1, p2, p3)
    Called by spec

    NHQ_par
    Usage: NHQ_par(mnum, cmd, p1, p2)
    Called by spec

    _nhq_info
    Usage: _nhq_info (mnum)
    Prints Status, Voltage, Ramp of NHQ (bench -> ~1.8s / channel)

    _nhq_status
    Usage: _nhq_status (mnum)
    Returns status of one NHQ channel. "S" command

    _nhq_mod_status
    Usage: _nhq_mod_status (mnum)
    Returns Module Status of one NHQ module. "T" command

    _nhq_id
    Usage: _nhq_id (mnum)
    Returns ID of one NHQ channel.

    tty_cntlred
    Usage: tty_cntlred


    tty_cntlnotred
    Usage: tty_cntlnotred


    __nhq_delete_old_macros
    Usage: __nhq_delete_old_macros()


    __nhq_simu_func
    Usage: __nhq_simu_func


Filename: nhq_mac_hdw.mac
Author: nhq_mac_hdw.MAC HW 9/2010
derived from nhq.mac
Last mod.: 13/02/2020 14:29 by witsch