Experimental Physics and Industrial Control System
On Monday, August 19, 2002, at 08:52 AM, S. Joshua Stein wrote:
I would like to set a (global) debugging variable which is part of my
device
support running on a solaris IOC (3.14b2). In the vxWorks world, I
would just
type:
deviceDebugVar=1
This, however, won't work with iocsh. Does anyone know if/how I can
gain access
to these variables?
Non-vxWorks IOCs don't have access to the executable symbol table (at
the moment) so this trick of assigning to variables doesn't work. About
the only thing I can suggest for now is to register a command to set the
variable:
/* setDebug */
static const iocshArg setDebugArg0 = { "level",iocshArgInt};
static const iocshArg * const setDebugArgs[1] = {&setDebugArg0};
static const iocshFuncDef setDebugFuncDef = {"setDebug",1,setDebugArgs};
static void setDebugCallFunc(const iocshArgBuf *args)
{
deviceDebugVar( args[0].ival);
}
Then, somewhere in your device initialization, register the command:
iocshRegister(&setDebugFuncDef,setDebugCallFunc);
Or, you can use a C++ static constructor to register the command for you
when the application starts. For example,
class SetDebugRegister {
public:
SetDebugRegister()
{ iocshRegister(&setDebugFuncDef,setDebugCallFunc); }
};
static SetDebugRegister setDebugRegisterObj;
--
Eric Norum <[email protected]>
Department of Electrical Engineering
University of Saskatchewan
Saskatoon, Canada.
Phone: (306) 966-5394 FAX: (306) 966-5407
- Replies:
- Re: Access to device support debugging vars via iocsh (3.14b2) Eric Norum
- References:
- Access to device support debugging vars via iocsh (3.14b2) S. Joshua Stein
- Navigate by Date:
- Prev:
Re: Capfast Symbol for Motor Record Benjamin Franksen
- Next:
Re: Access to device support debugging vars via iocsh (3.14b2) Eric Norum
- 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
2025
- Navigate by Thread:
- Prev:
Access to device support debugging vars via iocsh (3.14b2) S. Joshua Stein
- Next:
Re: Access to device support debugging vars via iocsh (3.14b2) Eric Norum
- 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
2025