Beamline Instrument Software Support |
|
SPEC Macro documentation:
[ Macro Index |
BCU Home ]
|
SLITSET.MAC | ||||||
[ source code | installed at | configured at ] | ||||||
See other macros in category: All | ||||||
Description:
| ||||||
Documentation:
These macros implement pseudomotors for slitsets with independent blades. Each set is composed by one or two slits (two or four blades). You will be able to use offset and gap motors that will move the corresponding blades. The main features are: EXAMPLE MCD 02/05/11: add a scale factor on the gap or offset, so that the resulting gap or offset original value is multiplied by this scale factor. This is implemented when the MOTPAR:scale = <a value> is added to the macromotor This is useful in particular when moving the gap executes a rotational movement on the plate and we want the gap to reflect the angular rotation. SETUP The slitsetup macro has to be executed with the proper parameters and the logical motors must be defined in the configuration file (controller set to `NONE'). In order to use slithome the `generic parameters' 1 and 2 must be properly set up in the configuration file for the blade motors. Generic parameter 1 must be set to `1' or `-1' to indicate if the mechanical reference is `lim+' or `lim-' respectively. Generic parameter 2 must be set to the desired dial value at the position of the limit switch. To use slitzero the Generic parameter 3 of the blade motors must be set to the dial value at the zero position. BUGS In the present version if a pseudomotor (gap or offset) is moved too close of the software limit, it might occur that when the movement is finished and due to small inaccuracies (encoder discrepancies, etc..) the recalculated position of the pseudomotor is slightly out of limits. If this happens and one tries to move a different motor an error message is issued and the movement is cancelled. Is this happens one should move first the pseudomotor to a valid position (in between the software limits) and then all the other movements will be allowed. There are two ways to avoid the previous problem. The first and obvious one is not to move a pseudomotor to the limit position. The second one is to set the software limits of the real motors (the blades) to values such that the limits of the pseudomotors will never be reached. This last solution is the best but it is not always possible or convenient. If someone thinks that there should be possible to get rid of this annoying behaviour by a third solution consisting on modifying the code, I must say that all the possible solutions I can imagine would weaken or break some other important features of these macros or would complicate excessively the code. What I want to state is that this problem is not simply the result of the laziness of the programmer (what does not necessarily mean that the programmer is no lazy or incompetent). | ||||||
Macros:
Usage: slitsetup <name> <offs> <gap> <bld1> <bld2> [<offsV> <gapV> <bldV1> <bldV2>] Configures a slitset with one or two slits. Each slit consists of two real motors (<bld1>, <bld2>) that move the independent blades and two logical motors <offs> and <gap> associated respectively to the position (offset) and aperture (gap) of the resulting slit. The setup of <bld1> and <bld2> must be such that moving both blades in the positive direction the slit opens. The sign of <offs> is that of the first blade (<bld1>). More than one slitset can be defined by using different names. A macro called `w<name>' is internally defined for each slitset. This macro displays the current position of the slitset. If a slitset includes two slits, it is assumed that the first one is the horizontal and the second one the vertical. All the motors must be defined in the configuration file, the logical motors having their controllers selected to `NONE'. slitshow Usage: slitshow Shows the current position of the configured slitsets. slitzero Usage: slitzero <slitset_name> Moves the blades to the zero position defined in the configuration file. The slitset is at `zero position' when the dials of the blades are at the values defined in the configuration file as Generic parameter 3. This macro moves the blades but does not modify their `user' position. To change the user positions to zero or other desired value, one has to explicitely use the set macro. slithome Usage: slithome <slitset_name> Moves the physical motors in the slitset to a mechanical reference and sets the dial positions. This macro needs special parameters in the configuration file as explained in the %{%<A HREF=#SETUP>%}%SETUP%{%</A>%}% section. | ||||||
Internal Macros: | ||||||
Usage: slit_config(mne,type,unit,module,chan) slit_calc Usage: slit_calc(mne,mode,master0) slit_checkmove Usage: slit_checkmove(master) slit Usage: slit slitunsetup Usage: slitunsetup "slit<name>" "w<name>" Undoes the configuration of a slitset. slitset_config Usage: slitset_config <name> <offs> <gap> <bld1> <bld2> [<offsV> <gapV> <bldV1> <bldV2>] Checks the validity of the motor mnemonics and enable or disable the whole slitset. slit_move Usage: slit_move <name> <offs> <gap> <bld1> <bld2> [<offsV> <gapV> <bldV1> <bldV2>] slit_getangles Usage: slit_getangles <name> <offs> <gap> <bld1> <bld2> [<offsV> <gapV> <bldV1> <bldV2>] slit_setuser Usage: slit_setuser <name> <offs> <gap> <bld1> <bld2> [<offsV> <gapV> <bldV1> <bldV2>] <motor> <position> slitset_chgoff Usage: slitset_chgoff <offs> <gap> <bld1> <bld2> slitset_move Usage: slitset_move (<offs>, <gap>, <bld1>, <bld2>) slitset_getangles Usage: slitset_getangles (<offs>, <gap>, <bld1>, <bld2>) slit_where Usage: slit_where 0|1 <name> <offs> <gap> <bld1> <bld2> [<offsV> <gapV> <bldV1> <bldV2>] Displays the current position of a slitset. If the first parameter is 1 more detailed information is presented. slit_disp Usage: slit_disp (<format>, <label>, <offs>, <gap>, <bld1>, <bld2>) slit_params Usage: slit_params (<slitset_name>, <param_array>) Loads the parameters of the slitset into an array. slitlist Usage: slitlist Lists the slitsets currently configured. _chg_slt_dial Usage: _chg_slt_dial (<motor>, <new_dial>) _chk_slt_home Usage: _chk_slt_home <motor> <lim> <position> mot_prot Usage: mot_prot (<motor>) Returns true if <motor> is protected. | ||||||
|