EPICS Home

Experimental Physics and Industrial Control System


 
1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  <20072008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024  Index 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  <20072008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
<== Date ==> <== Thread ==>

Subject: Re: Stream protocol configuration
From: Dirk Zimoch <[email protected]>
To: Emmanuel Mayssat <[email protected]>
Cc: [email protected]
Date: Thu, 06 Dec 2007 10:02:04 +0100
Emmanuel Mayssat wrote:
Dirk,

I am having issues with the protocol configuration.
For most of them I have found work-arounds, but let's see what other
people do/did/suggest.

1/ MaxInput
I noticed that the maxInput (and probable most other directives) do not
work in the @init or other exception handler. The maxInput for a
particular protocol can be set globally, locally, but not in exception
handlers. Am I missing something?

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.



2/ Parameter passing I am able to refer to another protocol entry in the exception handler Example: writeRegister { ... @init { readRegister; } }

But I can pass parameters to the writeRegister protocol.
But how can I pass those parameters to the readRegister in the @init ?


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.


-- Dr. Dirk Zimoch Paul Scherrer Institut, WBGB/006 5232 Villigen PSI, Switzerland Phone +41 56 310 5182

Replies:
Re: Stream protocol configuration Emmanuel Mayssat
References:
writing your own stream cronverter Emmanuel Mayssat
Re: writing your own stream cronverter Emmanuel Mayssat
Re: writing your own stream converter Emmanuel Mayssat
Stream protocol configuration Emmanuel Mayssat

Navigate by Date:
Prev: Stream protocol configuration Emmanuel Mayssat
Next: A patch for medm Kate Feng
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  <20072008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
Navigate by Thread:
Prev: Stream protocol configuration Emmanuel Mayssat
Next: Re: Stream protocol configuration Emmanuel Mayssat
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  <20072008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024