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  2019  2020  2021  2022  <20232024  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  <20232024 
<== Date ==> <== Thread ==>

Subject: Re: Strangeness in ai/mbbiDirect with StreamDevice on PINI
From: Michael Davidsaver via Tech-talk <tech-talk at aps.anl.gov>
To: "Leblanc, Gregory" <leblanc at ohio.edu>
Cc: "tech-talk at aps.anl.gov" <tech-talk at aps.anl.gov>
Date: Mon, 26 Jun 2023 14:02:12 -0700
On 6/26/23 12:34, Leblanc, Gregory via Tech-talk wrote:
Hi folks,

I'm still working on getting these Heinzinger PCU 50-300 supplies doing everything I want using EPICS.  Today I thought I'd try reading the status word from the supply, so I added an mbbiDirect record.  The custom sections of my .db file now read:

record(ai, "$(P)$(R)GetCurrent") {
     field(DESC, "Read output current")
     field(DTYP, "stream")
     field(INP, "@devPCU50_300.proto getCurrent $(PORT) $(A)")
     # field(SCAN, "1 second")
     field(SCAN, "Passive")
     # field(PINI, "YES")
     field(EGU, "Amps")
     field(ESLO, "0.001")
     field(LINR, "SLOPE")
}

record(ao, "$(P)$(R)SetCurrent") {
     field(DESC, "Write output current")
     field(DTYP, "stream")
     # field(SCAN, "1 second")
     field(SCAN, "Passive")
     field(OUT, "@devPCU50_300.proto setCurrent(%d) $(PORT) $(A)")
     field(PINI, "YES")
     field(VAL, "0")
     # field(FLNK, "$(P)$(R)GetCurrent")
     field(EGU, "Amps")
     field(ESLO, "0.001")
     field(LINR, "SLOPE")
}

record(mbbiDirect, "$(P)$(R)StatusRegister") {
     field(DESC, "Status Register")
     field(NOBT, "24")
     field(DTYP, "stream")
     field(INP,  "@devPCU50_300.proto getStatus $(PORT) $(A)")
     field(PINI, "YES")
     field(SCAN, "Passive")
}

But I'm seeing some unexpected behavior, somehow related to my other records.  Above, the PINI field for the GetCurrent record is commented out.  When I start the IOC in this state, the StatusRegister record is properly populated.  If I set PINI to YES and start the IOC, the StatusRegister record is not properly populated.  Running the command 'dbtr PCU50_300testStatusRegister' on the "broken" startup will update it so that it has the correct status.  I've watched the console output when launching st.cmd, and browsed the logfiles that I generated, but I can't spot what I'm doing wrong.  I've attached a logfile where I have the problem, and another where I don't.  My .db, .proto, and st.cmd are at: https://github.com/leblancOUAL/PCU_50-300/

I feel like the root cause is that somehow the replies to the different serial commands are getting mixed up, but I can't see how that's possible.  It is more likely that I've done something silly along the way.  Any hints for troubleshooting are greatly appreciated!

I suspect what you are seeing results from the asyn port not being
connected at the time of the IOC's initial scan.

Firstly, the name "StatusRegister" suggests to me that this value
should be read more than once on IOC startup.

imo. for robust operation some care should be taken anytime when
IOC and device don't share a power switch.

I try to avoid PINI with such devices, and instead use SCAN="10 second"
as a starting point for values which change slowly or only on device
power cycle.


Replies:
Re: Strangeness in ai/mbbiDirect with StreamDevice on PINI Ralph Lange via Tech-talk
References:
Strangeness in ai/mbbiDirect with StreamDevice on PINI Leblanc, Gregory via Tech-talk

Navigate by Date:
Prev: Strangeness in ai/mbbiDirect with StreamDevice on PINI Leblanc, Gregory via Tech-talk
Next: Display custom TCP data in CS-Studio Vishnu Patel 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  2019  2020  2021  2022  <20232024 
Navigate by Thread:
Prev: Strangeness in ai/mbbiDirect with StreamDevice on PINI Leblanc, Gregory via Tech-talk
Next: Re: Strangeness in ai/mbbiDirect with StreamDevice on PINI Ralph Lange 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  2019  2020  2021  2022  <20232024 
ANJ, 27 Jun 2023 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·