Experimental Physics and
| |||||||||||||||||
|
Dirk, All handlers (including @init) inherit the settings from the protocol in which they are used. Example: writeSomething { maxInput=25; out "..."; @init { out "..."; in "..."; } } Here, maxInput=25 is for both, the "main" protocol and the @init handler. The same is true even if you define the @init outside the protocol: @init { out "..."; in "..."; } writeSomething { maxInput=25; out "..."; } Even when another protocol is referenced in the handler, the handler uses the settings of its own protocol. readSomething { maxInput=10; out "..."; in "..."; } writeSomething { maxInput=25; out "..."; @init {readSomething;} } The @init handler uses the setting maxInput=25. This is for all settings (including terminators, timeouts, etc) and all handlers. Handlers have no individual settings. They always use the settings of the protocol in which they are used. In the current implementation, a protocol (including all its handlers) has only one set of settings. It is not possible to change settings at run time. As a result, you may define the settings anywhere in the protocol, even at the end: readSomething { out "..."; in "..."; maxInput=10; } But this is discouraged because I may change the behavior in future versions to allow to modify settings in the middle of a protocol.
As with the settings, the handler sees the parameters of the main protocol. Thus using "\$1" in readRegister is replaced by the 1st parameter to writeRegister when it is used in the @init handler. You can consider this a two-stage macro substitution. First readRegister in the @init handler is replaced with all the commands (but NOT the settings) of the readRegister protocol. Then all parameters in the writeRegister protocol and all its handlers are replaced with the values passed in the link, including those parameters which came originally from the readRegister protocol.
| ||||||||||||||||
ANJ, 10 Nov 2011 |
·
Home
·
News
·
About
·
Base
·
Modules
·
Extensions
·
Distributions
·
Download
·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing · |