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  <20082009  2010  2011  2012  2013  2014  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  <20082009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
<== Date ==> <== Thread ==>

Subject: Re: registering IOC shell functions
From: Eric Norum <[email protected]>
To: [email protected]
Cc: [email protected]
Date: Wed, 11 Jun 2008 08:42:52 -0500
On Jun 11, 2008, at 6:30 AM, Matthew Pearson wrote:


Hi,


In the IOC applications developers guide, chapter 21, there are two ways
described for registering IOC shell functions. I'm having trouble
getting one of them working on Linux...


In the source file, I have:
epicsRegisterFunction(directoryWaitDef);

and in the included dbd file, I have:
function(directoryWaitDef)

The above mechanism is for registering the function name so that it can be used for things like subroutine record INAM or SNAM fields.
It does not register the function as an iocsh command.




I then build a static library containing the function.

When I build the IOC, the function seems to be built OK into the
executable. If I look inside it, I see:
nm -S bin/linux-x86/BL19I-MO-SIM-01 | grep directory
0804c44c 0000009f T directoryWaitDef
0804e74c 00000004 D pvar_func_register_func_directoryWaitDef
0804c4ec 0000002a t register_func_directoryWaitDef

However, when I start the IOC, the function isn't found.

I'm using EPICS 3.14.8.2.

The same procedure works fine when I build the same IOC for VxWorks.

It isn't a huge problem, because the other method described in the
manual works for my Linux IOC (using the registrar() function in the dbd
file). But the method above is significantly simpler in the source code.

The long-winded approach is the only way to register a function with the IOC shell. The payback for the extra work is that:
1) the iocsh help command can provide a little information about the arguments.
2) you don't need to be so careful quoting string arguments.
3) you can have floating-point arguments and not have to worry about including a decimal point.




Any ideas?

The CEXP library provides the ability to invoke arbitrary functions. No registration necessary. If you're familiar with the vxWorks shell environment you'll find CEXP provides much of the same experience.


--
Eric Norum <[email protected]>
Advanced Photon Source
Argonne National Laboratory
(630) 252-4793



References:
uC5282 based RTEMS FlashSize error K.M Ha
80 MHz version of uCDIMM ColdFire 5282 Eric Norum
RE: 80 MHz version of uCDIMM ColdFire 5282 K.M Ha
RE: 80 MHz version of uCDIMM ColdFire 5282 K.M Ha
registering IOC shell functions Matthew Pearson

Navigate by Date:
Prev: registering IOC shell functions Matthew Pearson
Next: Longout Record ? Szalata, Zenon M.
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  <20082009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
Navigate by Thread:
Prev: registering IOC shell functions Matthew Pearson
Next: USB barcode reader and camera Gibbons, P (Paul)
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  <20082009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
ANJ, 02 Sep 2010 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·