Beamline Instrument Software Support |
|
SPEC Macro documentation:
[ Macro Index |
BCU Home ]
|
followmot.mac | ||||||
[ source code | installed at | configured at ] | ||||||
See other macros in category: | ||||||
Description:
| ||||||
Documentation:
This macro set implement the structure for SPEC motors (followers) which should change their position according to the position of a master SPEC motor. 3 types of behavior are implemented for a follower and can be changed dynamically. 1 - single: when the master is moving, position of the follower is calculated and set in the A[] SPEC array in order the follower will start its movement with the Master 2 - sync: the movement of the follower have to be done in the same time of the master movment (synchronized start and stop of the movement). This case is mainly used during zapenergy scan in which followers must be at their optimum value during all the mOvement of the master motor. 3 - sbs (Step By Step): During the Master movement, the follower will calclculate and move according to the changing Master position as fast as possible. The reading loop of the master position is not implement in this macro set. This case is mainly used during zapenergy scan when the speed of followers and the master cannot fit. Case 1 is validated using the "followmot_add" macro Case 2 is validated using the "followmot_sync" macro Case 3 is validated using the "followmot_sbs" maccro In each case, specifi macros for each followers should be provided. Needed values to calculate parameters and positions of the followers will be set in the FOLLOWMOT_PAR[] SPEC associative array. The resulting followers positions will be stored in the FOLLOWMOT_LIST manage bi stlist.mac macro set Message, Debug and Error macros are generated using hg.mac macro set EXAMPLE | ||||||
Macros:
Usage: followmot_add (<mot_mne>, <desc>, <func>) add a followers. <mot_mne> must refers to SPEC configured motor <func> must be defined followmot_sync Usage: followmot_sync (<mot_mne>, <set_param_func>, <restore_param_func>) Allow follower <mot_mne> to adapt its movement to fit the master movement <mot_mne> must refer to a valid follower <set_param_func> will set the necessary follower parameters <restore_param_func> will restore the follower changed parameters followmot_sbs Usage: followmot_sbs (<mot_mne>, <sbs_func>, <register_func>) Followers will move outside to the value calculated from the master position stored in FOLLOWMOT_PAR["master_pos"]. A <register_func> may be provided to register in ZAP arrays the position of each movement followmot_show Usage: followmot_show Display all configured followers followmot_del Usage: followmot_del (<mot_mne>) Remove item <mot_mne> from the followers list followmot_enable Usage: followmot_enable (<motmne>) Enable follower <motmne> if configured followmot_disable Usage: followmot_disable (<motmne>) Disable follower <motmne> if configured followmot_enable_all Usage: followmot_enable_all () Enable all followers followmot_disable_all Usage: followmot_disable_all () Disable all followers followmot_setmode Usage: followmot_setmode (<motmne>, <follow_mode>) Set movement mode for followers. mode are "single" or "sbs" In mode "single", the follower will move to the calculated position one time starting with the master motor In mode "sbs", during Master movement, follower position wil be constantly recalculted and follower will move ecah time to its new position. followmot_getmode Usage: followmot_getmode (<motmne>) return movement mode for followers. mode are "single" or "sbs" | ||||||
Internal Macros: | ||||||
Usage: followmot_setup Definition of global variables followmot_move Usage: followmot_move (new_master_pos) Set A[] array of all the active follower's according to new master position This macro is call in the Master Macro motor followmot_master_setpos Usage: followmot_master_setpos (new_master_pos) Set the new master position and call all follower's calculation macros. For each follower, the parameter "position" in the FOLLOWMOT_LIST will be set followmot_getpos Usage: followmot_getpos (mot_mne) return the "position" parameter of the FOLLOWMOT_LIST for <mot_mne> follower -999999 if the <mot_mne> is not a valid follower followmot_getminspeed Usage: followmot_getminspeed() followmot_checkspeed Usage: followmot_checkspeed(en_from, en_to, en_time) followmot_isactive Usage: followmot_isactive (mot_mne) return the active state of the <mot_mne> follower followmot_getdependant Usage: followmot_getdependant (mot_mne) return the list of followers mnemonic followmot_getname Usage: followmot_getname (ind) return the motor name of the follower's at index <ind> in the FOLLOWMOT_LIST list | ||||||
|