Hi Dirk,
Since there isn't a function prototype for streamReload, do you recommend that I manually add it into devStream.h? gcc isn't liking the fact that I am calling to streamReload, because there is no prototype.
Thanks,
Andy
-----Original Message-----
From: Zimoch Dirk (PSI) <dirk.zimoch at psi.ch>
Sent: Saturday, January 22, 2022 3:04 AM
To: EPICS tech-talk <tech-talk at aps.anl.gov>; Wang, Andrew <wang126 at llnl.gov>
Cc: Michael Davidsaver <mdavidsaver at gmail.com>
Subject: Re: Calling the streamReload IOC Shell function within C
Hi Andy
You can call extern „C“ long streamReload(const char* recordname) directly from C/C++. If NULL is passed for recordname, then all StreamDevice records reload. If a record is in the middle of processing, the running protocol is aborted and the record goes to INVALID alarm until the next processing.
It seems I have forgotten to put the function prototype into devStream.h. Will be done in the next release.
Dirk
> Am 22.01.2022 um 06:08 schrieb Michael Davidsaver via Tech-talk <tech-talk at aps.anl.gov>:
> On 1/21/22 19:39, Wang, Andrew via Tech-talk wrote:
>> This is a far-fetched question, but I was wondering whether there is a possibility of executing streamReload, or a similar functionality, within a C function. The reason why I ask is because I saw within this Github link (https://urldefense.us/v3/__https://github.com/epics-modules/ioczed/blob/master/zzzApp/Db/streamExample.db__;!!G2kpM7uM-TzIFchu!gjnSZo93VcnoDkmziao7QLSXtfmZDUg0hZ5hqdkj-M2oKQch9GQRdAvkPjUS4spw6a4$ <https://urldefense.us/v3/__https://github.com/epics-modules/ioczed/blob/master/zzzApp/Db/streamExample.db__;!!G2kpM7uM-TzIFchu!gjnSZo93VcnoDkmziao7QLSXtfmZDUg0hZ5hqdkj-M2oKQch9GQRdAvkPjUS4spw6a4$ >) that the SUB record calls streamReload. However, I couldn’t locate the source code for that, so I am not entirely sure how it is used and what its arguments are. Thoughts?
>
> The registrar code adding both the function callable from subRecord as
> well as iocsh.
>
> https://urldefense.us/v3/__https://github.com/paulscherrerinstitute/St
> reamDevice/blob/dfbd308d4602e7cb99d7f60ddf35909a70f41c4f/src/StreamEpi
> cs.cc*L297-L307__;Iw!!G2kpM7uM-TzIFchu!gjnSZo93VcnoDkmziao7QLSXtfmZDUg
> 0hZ5hqdkj-M2oKQch9GQRdAvkPjUS5UlYp3c$
>
> So you could do something like
>
>> iocshCmd("streamReload");
>
> cf. iocsh.h from Base.
>
> Since it is already callable from a subRecord I assume it is
> thread-safe.
- Replies:
- AW: Calling the streamReload IOC Shell function within C Zimoch Dirk (PSI) via Tech-talk
- References:
- Calling the streamReload IOC Shell function within C Wang, Andrew via Tech-talk
- Re: Calling the streamReload IOC Shell function within C Michael Davidsaver via Tech-talk
- Re: Calling the streamReload IOC Shell function within C Zimoch Dirk (PSI) via Tech-talk
- Navigate by Date:
- Prev:
Re: mrfioc2-PCI device Configuration Michael Davidsaver via Tech-talk
- Next:
AW: Calling the streamReload IOC Shell function within C Zimoch Dirk (PSI) 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>
2023
2024
- Navigate by Thread:
- Prev:
Re: Calling the streamReload IOC Shell function within C Zimoch Dirk (PSI) via Tech-talk
- Next:
AW: Calling the streamReload IOC Shell function within C Zimoch Dirk (PSI) 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>
2023
2024
|