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  <20132014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024  Index 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  <20132014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
<== Date ==> <== Thread ==>

Subject: Stream Device errors and record initialization
From: Christian Roehrig <[email protected]>
To: [email protected]
Date: Mon, 1 Apr 2013 12:00:24 -0500 (CDT)
Hello,

   I have a temperature controller that can run an 8 segment program.  Each segment can have the type ramp, dwell, or end.  Depending on the segment type querying the ramp rate, dwell duration, or end action may return a valid response or it may return just a EOT character.  When the ioc boots, I want the records to rea in the current parameter values, so I use the @INIT protocol.  However, when the parameter is not currently valid because of the segment type, the record fails to initialize properly.  Here is an example of on of the protocols I use.

readSegDuration {
  out 0x04 0x30 0x30 0x31 0x31 0x64, "\$1", 0x05;
  in "%*c%*c%*c%f%*c%1.0<xor>";
  @init {
    out 0x04 0x30 0x30 0x31 0x31 0x64, "\$1", 0x05;
    in "%*c%*c%*c%f%*c%1.0<xor>";
  }
  @mismatch {
    out 0x04 0x30 0x30 0x31 0x31 0x64, "\$1", 0x05;
    in 0x04;
  }
}

Here is the output at the ioc prompt.

2013/04/01 11:37:31.170 /dev/ttyS0 write 8                                                                                                                                     
0011d8                                                                                                                                                                         

04 30 30 31 31 64 38 05 
2013/04/01 11:37:31.195 /dev/ttyS0 read 1


04 
2013/04/01 11:37:31.495 L0 2dev:ET2k:1:ReadSeg8Dur: Input "" does not match format %f
2013/04/01 11:37:31.495 /dev/ttyS0 write 8                                                                                                                                     
0011d8                                                                                                                                                                         

04 30 30 31 31 64 38 05 
2013/04/01 11:37:31.520 /dev/ttyS0 read 1


04 
2013/04/01 11:37:31.820 _main_ 2dev:ET2k:1:ReadSeg8Dur: @init handler failed
2013/04/01 11:37:31.820 _main_ 2dev:ET2k:1:ReadSeg8Dur: Record initialization failed                                                                                           
2013/04/01 11:37:31.820 /dev/ttyS0 write 8                                                                                                                                     
0011d8                                                                                                                                                                         

04 30 30 31 31 64 38 05 
2013/04/01 11:37:31.838 /dev/ttyS0 read 1


04

So it looks like it sends out the command to read the duration parameter (0011d8) and reads back the EOT character, which fails to match the expected input.  It then sends the command again and gets the same response, which causes record initialization to fail.   Then for some reason, the command is sent a third time.

My question is, can Stream Device handle a situation like this?  If so, how should I change my protocol?  Would it be better to remove the @INIT section and included a manual "Init" PV with a sequence record that could cause all of the other records to process once after iocInit completes?

Chris Roehrig

Replies:
Re: Stream Device errors and record initialization Dirk Zimoch

Navigate by Date:
Prev: Re: AW: SIS3820 scaler limits Mark Davis
Next: EPICS device driver support for Tektronix AFG3000C Tang, Johnny Y.
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  <20132014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
Navigate by Thread:
Prev: RE: SIS3820 scaler limits Mark Rivers
Next: Re: Stream Device errors and record initialization Dirk Zimoch
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  <20132014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
ANJ, 20 Apr 2015 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·