EPICS Controls Argonne National Laboratory

Experimental Physics and
Industrial Control System

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  <20192020  2021  2022  2023  2024  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  <20192020  2021  2022  2023  2024 
<== Date ==> <== Thread ==>

Subject: StreamDevice: termination in binary communication
From: Christian Pauly via Tech-talk <[email protected]>
To: EPICS Tech Talk <[email protected]>
Date: Tue, 18 Jun 2019 12:16:38 +0200
Hi folks

I am struggling with a problem using StreamDevice to control a Monochromator, which has a binary byte-based communication. Each (multibyte) message from the device is terminated by a CANCEL byte.


My first try was to specify the CANCEL byte as Termninator or InTerminator in the protocol file:
Terminator = 24

However: Sometimes the Monochromator transmits the wavelength, and it does it as High+Lowbyte raw LONG. For certain wavelengths one of the two bytes is a 24, and this is interpreted then as termination character, and i get a protocol error.

So i tried without Termination character
(either Terminator = "", or skipping the line completely),
using eg the following IN-statement in the protocol:

goto {
      out 16,"%0.2r";
      in "%(Monochromator:LastStatus)1r",CAN;
}

This works fine, as long as the monochromator does not have to turn far:
The device first sends the status byte, then it turns, and only then sends the CAN byte to signal end of operation.
This can take up to few seconds, and then i get a timeout error.

So i tried to set the ReadTimeout in the protocol to 10 seconds.
Now it works, but now EVERY IN-command waits for 10 seconds, even if the transmission was already complete (and terminated with CAN).

Is there no way to define the input such, that StreamDevice only waits the whole Timeout period if the transmission was not yet complete ???


I also tried to use the ! flag:
in "%!(Monochromator:LastStatus)1r",CAN;

to tell to expect EXACTLY one byte. But despite updating to the newest StreamDevice2 version, i always get a protocol error > 2019/06/18 12:04:58.809859 _main_ No converter registered for format '%!' when using the ! flag.



Any helpful ideas ????


Thanks a lot,
Cheers,
Christian



Replies:
RE: StreamDevice: termination in binary communication Mark Rivers via Tech-talk

Navigate by Date:
Prev: Re: PVA Client in python Florian Feldbauer via Tech-talk
Next: Animatics SmartMotor setup Davis, Mark via Tech-talk
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  <20192020  2021  2022  2023  2024 
Navigate by Thread:
Prev: Re: PVA Client in python Florian Feldbauer via Tech-talk
Next: RE: StreamDevice: termination in binary communication Mark Rivers via Tech-talk
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  <20192020  2021  2022  2023  2024 
ANJ, 18 Jun 2019 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·