Beamline Instrument Software Support |
|
SPEC Macro documentation:
[ Macro Index |
BCU Home ]
|
NATT.MAC | ||||||
[ source code | installed at | configured at ] | ||||||
See other macros in category: Positioning | ||||||
Description:
| ||||||
Documentation:
This macros control the standard ESRF filters. This attenuator consists of a motor controlled directly from SPEC, associated limit switches, and a home switch for every filter position. All the home switches are connected together to use the single home switch entry on the motor controller card. The macros attmv, attref, and attshow are the macros to operate these attenuators: | ||||||
Macros:
Usage: _attinittable Initialise the table of parameters for the existing attenuator types. attsetup Usage: attsetup [filename] Initialise the attenuator motor, answering questions or get the information from filename. attsavesetup Usage: attsavesetup [filename] Write current attenuator configuration (all axis) in a file. attref Usage: attref <motor_mnemonic [calibration_step [sign]]> Find the "second filter". Set it as reference position (2) and step on it. The motor will move to a hardware limit switch and then try to find the second filter position with the help of the home switches. The direction of the movement sign is defined as 1 (from negative limit in positive direction) or -1 (positive limit in negative direction). The precision for the home switch search calibration_step [mm] could be defined - default value is 0.004 mm. attlimits Usage: attlimits <motor_mnemonic> Find both limit switches position and set them as software limits for the motor attref has to be called already. Otherwise the hardware limit position will not be correct. attmv Usage: attmv [<motor_mnemonic>] [<filter position>/<filter name>] ..... Move the axis <motor_mnemonic> to the given position <filter_number> Move to an intermediate position, check the switch, move to the final position and check again that the switch is on. attsetpos Usage: attsetpos <axis mnemonic> <filter num> <pos> Set the position for filter #n of attenuator axis. attwa Usage: attwa Show selected filters on every axis. att_getxml Usage: att_getxml Get the filter names and corresponding motor positions for the current axe from the default hardware object - xml file. att_writexml Usage: att_writexml Write the filter names and corresponding motor positions for the current axe from the default hardware object - xml file. The information to write is taken from the ATTFILTERS arary. attrefall Usage: attrefall <motor_mnemonic [calibration_step [sign]]> Scan the blade motor_mnemonic. The direction of the movement sign is defined as 1 (from negative limit in positive direction) or -1 (positive limit in negative direction) - default value is 1. The algorithm is based on the home switch signal being active or not, moving in fine steps, which absolute [mm] value calibration_step could be set - default value is 0.004 mm. | ||||||
Internal Macros: | ||||||
Usage: _att_find_key (filename, key) Find a keyword key in the attenuator config file filename. _attref Usage: _attref (mnum) Internal function to find the "zero reference filter". The algorithm is based on the fact that the first home switch is passed when we move 0.5 filter distances (i.e.33mm/2 = 16mm) from the limit. The mnum is the axis ordinal number in the motors list. _att_gotolim Usage: _att_gotolim (mnum, sign) Go to positive or negative limit (positive means same sign as the step_size (positive motor movement). Show some animation during the move. Return the current motor position. _show_waitf Usage: _show_waitf () Draw a bar while action goin on _attswitchf Usage: _attswitchf (motor_mnemonic, motor_steps, parameter) If par=99, return the home switch status (0-active, 4-nonactive). Otherwise check if home switch signal is active (par=0) or not (par=4) and move the motor untill the desired status reached. Retunt the current motor position. _attlimitswitchf Usage: _attlimitswitchf (motor_number, sign) Return the limit switch status (0-nonactive, 1=-active). Check low or high limit switch according to the sign. position. _attswitchicepap Usage: _attswitchicepap (motor_number, motor_steps, parameter) If par=99, return the home switch status (0-active, 4-nonactive). Otherwise check if home switch signal is active (par=0) or not (par=4) and move the motor motor_steps untill the desired status reached. Retunt the current motor position. _attswitchmaxe Usage: _attswitchmaxe (motor_number, motor_steps, parameter) If par=99, return the home switch status (0-active, 4-nonactive). Otherwise check if home switch signal is active (par=0) or not (par=4) and move the motor motor_steps untill the desired status reached. Retunt the current motor position. _check_mne Usage: _check_mne (motor_mnemonic) Check if the motor exists in the configuration. _att_checkhomef Usage: _att_checkhomef (mnum) Return the home switch signal value - activ (0) or not (4). _attmv Usage: _attmv (<nb. motor>, <motor num array>, <motor pos array>) Function to test the limits, correct the position, send to intermediate and then to final postion the motors specified in the second parameter (an associative array). The first parameter is the number of motors to move. The third parameter is an associative array containing the final positions for the motors to move. _attwm_f Usage: _attwm_f (motmne) Return the selected filter for motor motmne. attshow Usage: attshow attshow_ascii Usage: attshow_ascii Start the interactive ASCII menu. _getval_timeout Usage: _getval_timeout(msg, default, tout) _attshowmenu Usage: _attshowmenu Prepare and show the menu on the screen. attdiag Usage: attdiag <motor_mnemonic> Calculate [steps] the size between the filters as well as the backlash. The procedure is: send the motor to a hardware limit, start moving (in fine steps) in the other direction to find all the home switches and store their positions. Repete the procedure in the oposite direction to estimate the backlash. _attdiagprint Usage: _attdiagprint (mnum, way, course, nbfilt) Print the information gathered during the diagnostic scan. _attdiag Usage: _attdiag (mnum, way, course) Internal function to scan the blade mnum in the direction of the scan way defined in advance as 1 (from negative to positive limit) or -1 (positive to negative limit). The algorithm is based on the home switchsignal being active or not moving in fine steps for at most course position. Returns the number of filters (home switches) found. _attrefallinit Usage: _attrefallinit (mnum) Internal function to scan the blade mnum. The direction of the scan (_SIGN) could be defined in advance as 1 (from negative to positive limit) or -1 (positive to negative limit). The algorithm is based on the home switch signal being active or not moving in fine steps, which absolute value (_CALIB_STEP) could be set as well. This is the procedure used with icepep controller. Returns the number of filters (home switches) found. _att_locked Usage: _att_locked () Define a user macro to lock the attenuators. _att_getxml Usage: _att_getxml (ho, motmne, keys_root, keys) Get the filter names and corresponding motor positions for the motnum axis from the ho hardware object - xml file. _att_writexml Usage: _att_writexml (ho, motmne, keys_root, keys) Write the filter names and corresponding motor positions for the motnum axis in the ho hardware object - xml file. The information to write is taken from the ATTFILTERS arary. _attrefall Usage: _attrefall (mnum) Internal function to scan the blade mnum. The direction of the scan (_SIGN) should be defined in advance as 1 (from negative to positive limit) or -1 (positive to negative limit). The algorithm is based on the home switchsignal being active or not moving in fine steps, which absolute value (_CALIB_STEP) should be set. Returns the number of filters (home switches) found. _attrefhome Usage: _attrefhome (mnum) Internal function to find the "zero reference filter". The algorithm is based on the spec home mechanism. The direction of the movement (_SIGN) should be defined in advance as 1 (from negative limit in positive direction) or -1 (positive limit in negative direction). The absolute value of the step for the fine move when the home switch is active (_CALIB_STEP) should be set. At the end move to the centre of the filter and set it as position 2. _attrefhomeall Usage: _attrefhomeall (mnum) Internal function to scan the blade mnum. The direction of the scan (_SIGN) should be defined in advance as 1 (from negative to positive limit) or -1 (positive to negative limit). The algorithm is based on the home switch being hardware configured the same way for all the filters and uses the spec home mechanism. The absolute value of the step for the fine move when the home switch is active (_CALIB_STEP) should be set. Returns the number of filters (home switches) found. attshow_old Usage: attshow_old [<where to see atenuators (gui/ascii)] Starts the interactive menu. If no parameter is set, choose gui if SpecGUI is running 0n the SPEC version. Otherewise take the parameter. attshow_gui Usage: attshow_gui Starts the interactive ASCII menu. Xattsetup Usage: Xattsetup setup GUI use of attenuator, chains Xattwa with user_getpangles Xattwa Usage: Xattwa update GUI att filter. GUI outputfield name must be "att-mnemonic"_name, e.g. att1 -> att1_name This macro can be chained with user_getpangles. Xattconfig Usage: Xattconfig Send configuration to graphical application | ||||||
|