For fixed-length input you can use maxInput=number_of_byes; instead of a
terminator.
I tried bracketing my read of 'ACK' with 'MaxInput=1' and 'MaxInput=0',
but it didn't help - still nothing in my PV.
At them moment, you cannot change variables at run-time. The protocol
starts and runs with the last setting. Thus this:
MaxInput=1;
in ACK;
MaxInput=0;
in "...";
Actually executes:
MaxInput=0;
in ACK;
in "...";
This is because setting variable like MaxInput is evaluated when the
protocol is loaded, not at run-time like the 'in' command. I plan to
change that in the future.
Wahat I meant was:
read_version {
MaxInput=...;
out STX, "001?f" ETX, "%<xor8ff>";
in ACK, STX, "001 f%[^\003]", ETX, "%1<xor8ff>";
}
Read everything including ACK as one fixed length line.
In cases you have no terminator string but constant length input, using
MaxInput saves you from using readTimeout as the line terminator. Thus
you have no delay at the end of the input and no danger that two lines
join to one in case readTimeout is too long.
Dirk
- Replies:
- Re: Parsing problem with stream Lucock, Richard M
- References:
- Parsing problem with stream Lucock, Richard M
- Re: Parsing problem with stream Dirk Zimoch
- Re: Parsing problem with stream Lucock, Richard M
- Navigate by Date:
- Prev:
Re: Parsing problem with stream Lucock, Richard M
- Next:
Re: Parsing problem with stream Lucock, Richard M
- 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: Parsing problem with stream Lucock, Richard M
- Next:
Re: Parsing problem with stream Lucock, Richard M
- 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
|