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  <20202021  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  2019  <20202021  2022  2023  2024 
<== Date ==> <== Thread ==>

Subject: RE: aSub debug output
From: "Daykin, Evan via Tech-talk" <tech-talk at aps.anl.gov>
To: "Johnson, Andrew N." <anj at anl.gov>
Cc: EPICS tech-talk <tech-talk at aps.anl.gov>
Date: Wed, 2 Dec 2020 19:42:17 +0000

Hi again and thank you all for your suggestions.

 

I spent some time creating a minimal example, and it behaves, of course, as you all said it does – a simple printf works. The problem is that one of my input links was not resolved, so it did not call the subroutine. I didn’t think of this possibility since TPRO showed the record processing, but Martin pointed me to the documentation where it says:

·         If all input-link fetches succeeded, call the routine specified by SNAM.

Now my question becomes: is there a field that can be set such that this failure is not silent, e.g. raise LINK alarm or output some error message indicating which fetch failed?

 

Thanks again,

-Evan

 

From: Johnson, Andrew N. <anj at anl.gov>
Sent: Monday, November 30, 2020 12:36 PM
To: Daykin, Evan <daykin at frib.msu.edu>
Cc: EPICS tech-talk <tech-talk at aps.anl.gov>
Subject: Re: aSub debug output

 

[EXTERNAL] This email originated from outside of FRIB

Hi Evan,

 

On Nov 30, 2020, at 10:54 AM, Daykin, Evan via Tech-talk <tech-talk at aps.anl.gov> wrote:

 

What is the correct method of outputting debug information to the IOC shell from an aSub Record? We have tried errlogprintf(), printf(), and std::cout after setting eltc(1) and errLogInit in the IOC shell, but nothing seems to work. Am I missing a step?

 

Unless your startup script or some other software is redirecting the IOC’s stdout and/or stderr streams elsewhere a regular printf() or fprintf(stderr) should send output to the console without doing anything special.

 

All recent versions of Base provide a header file epicsStdio.h which redefines the keywords stdin, stdout and stderr and the routines printf(), puts() and putchar() so the iocsh stream redirection works with any code that includes this header; the redirection streams are thread-specific though, each thread has its own set of FILE* pointers and unless some code running in a thread has explicitly called say epicsSetThreadStdout() the output from printf() will still go to the main process stdout stream. If your code doesn’t explicitly include epicsStdio.h this will not affect you (no other EPICS Base headers pull in that file).

 

It sounds like there may be something else going on in your case, you’ll have to provide more information if you want help. Are you sure your aSub is actually being processed? Have you tried setting TPRO to confirm that?

 

- Andrew

 

-- 

Complexity comes for free, simplicity you have to work for.

 


Replies:
Re: aSub debug output Michael Davidsaver via Tech-talk
References:
aSub debug output Daykin, Evan via Tech-talk
Re: aSub debug output Johnson, Andrew N. via Tech-talk

Navigate by Date:
Prev: Re: Epics Archiver not pushing to STS? Ralph Lange via Tech-talk
Next: Re: aSub debug output Michael Davidsaver 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  <20202021  2022  2023  2024 
Navigate by Thread:
Prev: Re: aSub debug output Johnson, Andrew N. via Tech-talk
Next: Re: aSub debug output Michael Davidsaver 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  <20202021  2022  2023  2024 
ANJ, 02 Dec 2020 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·