Emmanuel Mayssat wrote:
On Thu, 2007-12-06 at 10:02 +0100, Dirk Zimoch wrote:
readSomething { maxInput=10; out "..."; in "..."; }
writeSomething {
maxInput=25;
out "...";
@init {readSomething;}
}
The @init handler uses the setting maxInput=25.
Obviously there is something wrong with the above.
It is actually the situation I am facing where my protocol has no
terminator and read and write protocols are fundamentally different.
Some of the protocols I have to program are also a bit more complex than
write-once and read-once. They are acknowledgments and some other
features involved.
What exactly do you need to do? Please describe the desired protocol.
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.
That would be a nice addition and would be more intuitive.
As I mentioned earlier I was able to find work-arounds for the issues I
have. BTW, I found streamDevice to work intuitively and as-is for 95% of
my drivers. I love it!
2/ Parameter passing
I am able to refer to another protocol entry in the exception handler
Example:
writeRegister {
...
@init {
readRegister;
}
}
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.
In the @init
readRegister($1);
readRegister $1;
did not work for me. Are you saying I should try again? Ok ...
No. Just use @init {readRegister;}
Example:
readRegister { out "\$1"; in "%i";}
writeRegister { ... @init {readRegister;} }
This is the same as:
writeRegister { ... @init {out "\$1"; in "%i";} }
The word readRegister is replaced by the commands of the referenced protocol.
field (OUT, "@file writeRegister(XXX) bus")
Now "\$1" is replaced with "XXX", resulting to
writeRegister { ... @init {out "XXX"; in "%i";} }
Thus, at initialization, the protocol will do: {out "XXX"; in "%i"; }.
Thanks,
--
Emmanuel
--
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
- Re: Stream protocol configuration Dirk Zimoch
- Re: Stream protocol configuration Emmanuel Mayssat
- Navigate by Date:
- Prev:
Re: EPICS in Debian 4.0 Linux Umashankar Panda
- Next:
problem about cross-compiling vxworks for vxWorks-pentium under windows xp marco_hair
- Index:
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
<2007>
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
- Navigate by Thread:
- Prev:
Re: 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
<2007>
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
|