Beamline Instrument Software Support |
|
SPEC Macro documentation:
[ Macro Index |
BCU Home ]
|
PSEUDO.MAC | ||||||
[ source code | installed at | configured at ] | ||||||
See other macros in category: All | ||||||
Description:
| ||||||
Documentation:
Pseudo motors are a commonly used feature to implement motors in spec, which do not have actual hardware connected. An example could be the gap and offset motors for slits. In some cases, where you would like to use real hardware without writing c-code, you could also use the concept of pseudo motors. With the feature of Macro Hardware (type help mac_hdw at the spec prompt), there is no need to create new pseudo motors/counters. Please use the macro hardware feature for new implementations. EXAMPLE INTERNALS As updated moves and counting used the c-function wait directly, these waits had to be replaced by the new waitcheckcount ,... macros. These changes have been made: ATTENTION This version of pseudo.mac is to be used with SPEC version 6.00.07 and later! Many ESRF specific macros like mv, ct have been eliminated by improvements made to the standard macros in standard.mac. The effort to keep all ESRF functionality was quite big, but we need to be vigilant to eliminate errors. All old code has been kept in this file as comments, which should allow tracking errors. ATTENTION DEPENDENCIES The file pseudo.mac has to be loaded. ! This is done in startup | ||||||
Macros:
Usage: pseudodef <motormne> <checkmacro> <movemacro> <getanglemacro> <cleanupmacro> < config> <setdial> <finished> <userdata1> <userdata2> This macro defines a new pseudo-motor. The motor has to be configured and the controller set to NONE. Whenever a move_all is called the userdefined macro <checkmacro> will be called before and the <movemacro> afterwards. These macros will get three parameters. The first parameter will be the motor mnemonic, the second the string userdata1 and the third the string userdata2. The macro is responsible to move the motor to the position given in the global variable A[motornumber]. The userdata can be used to give some information to the macro (for example the device server name). In the same way the <getanglemacro> will have to fill the A[] array with the actual position of the motor. The <cleanup macro> will be called if the user hits ^c or some error condition occures (A limit is hit for example). The <config> macro will be called after the user called config. The <setdial> and <finished> macros are not yet fully implemented and will server future additions. If you do not want to wait in your macros until your move has finished (and then allow updated move commands), you can hook code in user_motorsrun that executes `return(1)' in case your move is not yet finished. While waiting your getangles macro will be called. pseudosdef Usage: pseudosdef <var-name> same as pseudodef , the input parameter is just a variable name pseudodel Usage: pseudodel [motormne] : A pseudomotor can be deleted with this macro pseudomotformula Usage: pseudomotformula <formula> <mot-to-calc> <depend-mot1> <depend-mot2> ... This macro can be used to define simple pseudo motors very easily. A pseudomotor like tlaue := piezo/38 could be implemented by pseudomotformula "A[piezo]/38" laue piezo and pseudomotformula "A[tlaue]*38" piezo laue cpseudodef Usage: cpseudodef <counter_mne> <precount> <postcount> <getcounts> <cleanup> <config> <userdata1> <userdata2> This macro defines a new pseudo-counter. The counter has to be configured and the controller set to NONE. Whenever a count_em macro is used (all the time spec wants to start a counter/timer) <precount> is called before starting the timer and <postcount> after. These macros will get three parameters. The first parameter will be the counter number, the second the string userdata1 and the third the string userdata2. Normally the <precount> or <postcount> macro will start your timer. In <getcounts> you have to fill the S[] array with the counts read from the counter/timer. S[sec := 0] should be the time in seconds. The userdata can be used to give some information to the macro (for example the device server name). The <cleanup> macro will be called if the user hits ^c or some error condition occures (A limit is hit for example). The <config> macro will be called after the user called config. If you do not want to wait in your macros until counting has finished (and in this allow updated count commands), you can hook code in user_countersrun that executes `return(1)' in case your count is not yet finished. While waiting your <pollcounts> macro will be called. cpseudosdef Usage: cpseudosdef <var-name> same as cpseudodef , the input parameter is just a variable name cpseudodel Usage: cpseudodel [countermne] A pseudomotor/counter can be deleted with this macro | ||||||
Internal Macros: | ||||||
Usage: chk_count chk_move Usage: chk_move user_counters_run Usage: user_counters_run() user_motors_run Usage: user_motors_run() chk_beam Usage: chk_beam chk_beamf Usage: chk_beamf() _chk_beamc Usage: _chk_beamc user_setpos Usage: user_setpos user_waitall Usage: user_waitall user_waitmove Usage: user_waitmove user_waitcount Usage: user_waitcount move_poll Usage: move_poll _pseudodef Usage: _pseudodef pseudo_hook Usage: pseudo_hook pseudosdel Usage: pseudosdel pseudoshow Usage: pseudoshow pseudohack Usage: pseudohack _cpseudodef Usage: _cpseudodef cpseudosdel Usage: cpseudosdel cpseudoshow Usage: cpseudoshow pseudo_define_empty_stubs Usage: pseudo_define_empty_stubs | ||||||
|