esrf

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

#$Log:	pseudoE.mac,v $
#Revision 1.1  2002/05/24  12:41:34  12:41:34  beteva (Antonia Beteva)
#replaced the 12.39852 by hc_over_e
#
#%TITLE% PSEUDOE.MAC
#%NAME% 
#    Mono energy as a pseudo motor (Add-On for spec internals)
#
#%DESCRIPTION% 
#    Defines an energy pseudomotor to move, read and scan the
#    monochromator. See help mono for Specs built in support.
#

#%UU% [Energy-mnemonic]
#%MDESC% Define the pseudo motor.
def pseudoEsetup '
   global PSE_MNE PSE_OLD
   global OLD_MONO

   if ($#) {
        PSE_MNE="$1"
   } else {
        PSE_MNE=getval("Enter the mnemonic for the energy pseudo motor",PSE_MNE)
   }
   cdef ("user_getpangles",sprintf("pseudoEget %s\n",PSE_MNE),PSE_MNE,0x01)
   cdef ("user_checkall",sprintf("pseudoEmove %s\n",PSE_MNE),PSE_MNE,0x01)
'

#%IU%
#%MDESC% Calculate the energy and update the pseudomotor.
def pseudoEget '{
     local motnum
     motnum = motor_num("$1")

     calcE
     if (LAMBDA != 0) {
         A[motnum] = hc_over_e/LAMBDA
     } 
     PSE_OLD = A[motnum]
}'

#%IU%
#%MDESC% Move the energy pseudomotor.
def pseudoEmove '{
     local motnum

     motnum = motor_num("$1")

     _bad_lim=0
     _chk_lim motnum A[motnum]

     if (!_bad_lim) {
         if (A[motnum] != PSE_OLD) { 
	     OLD_MONO=A[mono]; calcM (A[motnum]) 
         }
     } else {
         A[motnum] = PSE_OLD
     }
}'

#%MACROS%
#%IMACROS%
#%AUTHOR% ESRF/BLISS
#$Revision: 1.1 $ $Date: 2002/05/24 12:41:34 $
#%TOC%