Added a debug variable to the example mySub routines,
making this settable from the ioc shell.
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
include "base.dbd"
|
||||
include "xxxSupport.dbd"
|
||||
registrar(mySubRegistrar)
|
||||
variable(mySubDebug)
|
||||
|
||||
@@ -5,19 +5,24 @@
|
||||
#include <subRecord.h>
|
||||
#include <epicsExport.h>
|
||||
|
||||
int mySubDebug;
|
||||
epicsExportAddress(int, mySubDebug);
|
||||
|
||||
typedef long (*processMethod)(subRecord *precord);
|
||||
|
||||
static long mySubInit(subRecord *precord,processMethod process)
|
||||
{
|
||||
printf("Record %s called mySubInit(%p, %p)\n",
|
||||
precord->name, (void*) precord, (void*) process);
|
||||
if (mySubDebug)
|
||||
printf("Record %s called mySubInit(%p, %p)\n",
|
||||
precord->name, (void*) precord, (void*) process);
|
||||
return(0);
|
||||
}
|
||||
|
||||
static long mySubProcess(subRecord *precord)
|
||||
{
|
||||
printf("Record %s called mySubProcess(%p)\n",
|
||||
precord->name, (void*) precord);
|
||||
if (mySubDebug)
|
||||
printf("Record %s called mySubProcess(%p)\n",
|
||||
precord->name, (void*) precord);
|
||||
return(0);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,17 +1,23 @@
|
||||
#!../../bin/_ARCH_/_APPNAME_
|
||||
## The names of the binary above and .dbd file below will be incorrect
|
||||
## unless you used the same names for the ioc and the app directory.
|
||||
# create and register all record/device/driver/registrar support
|
||||
|
||||
## You may have to change _APPNAME_ to something else
|
||||
## everywhere it appears in this file
|
||||
|
||||
## Register all support components
|
||||
dbLoadDatabase("../../dbd/_APPNAME_.dbd",0,0)
|
||||
registerRecordDeviceDriver(pdbbase)
|
||||
|
||||
## Load record instances
|
||||
dbLoadRecords("../../db/dbExample1.db","user=_USER_Host")
|
||||
dbLoadRecords("../../db/dbExample2.db","user=_USER_Host,no=1,scan=1 second")
|
||||
dbLoadRecords("../../db/dbExample2.db","user=_USER_Host,no=2,scan=2 second")
|
||||
dbLoadRecords("../../db/dbExample2.db","user=_USER_Host,no=3,scan=5 second")
|
||||
dbLoadRecords("../../db/dbSubExample.db","user=_USER_Host")
|
||||
|
||||
## Set this to see messages from mySub
|
||||
#var mySubDebug 1
|
||||
|
||||
iocInit()
|
||||
|
||||
## Start sequence programs here, if there are any
|
||||
## Start any sequence programs
|
||||
#seq sncExample,"user=_USER_Host"
|
||||
|
||||
@@ -1,13 +1,23 @@
|
||||
# Simple startup script
|
||||
## Example RTEMS startup script
|
||||
|
||||
# You may have to change _APPNAME_ to something else
|
||||
# everywhere it appears in this file
|
||||
## You may have to change _APPNAME_ to something else
|
||||
## everywhere it appears in this file
|
||||
|
||||
## Register all support components
|
||||
dbLoadDatabase("dbd/_APPNAME_.dbd",0,0)
|
||||
registerRecordDeviceDriver(pdbbase)
|
||||
|
||||
## Load record instances
|
||||
dbLoadRecords("db/dbExample1.db","user=_USER_")
|
||||
dbLoadRecords("db/dbExample2.db","user=_USER_,no=1,scan=1 second")
|
||||
dbLoadRecords("db/dbExample2.db","user=_USER_,no=2,scan=2 second")
|
||||
dbLoadRecords("db/dbExample2.db","user=_USER_,no=3,scan=5 second")
|
||||
dbLoadRecords("db/dbSubExample.db","user=_USER_")
|
||||
|
||||
## Set this to see messages from mySub
|
||||
#var mySubDebug 1
|
||||
|
||||
iocInit()
|
||||
|
||||
## Start any sequence programs
|
||||
#seq sncExample,"user=_USER_"
|
||||
|
||||
@@ -1,30 +1,38 @@
|
||||
# Example vxWorks startup file
|
||||
## Example vxWorks startup file
|
||||
|
||||
# Following will be needed for many board support packages
|
||||
## The following is needed if your board support package doesn't at boot time
|
||||
## automatically cd to the directory containing its startup script
|
||||
#cd "_TOP_/iocBoot/_IOC_"
|
||||
|
||||
< cdCommands
|
||||
|
||||
#< ../nfsCommands
|
||||
|
||||
cd topbin
|
||||
# You may have to change _APPNAME_ to something else
|
||||
# everywhere it appears in this file
|
||||
## You may have to change _APPNAME_ to something else
|
||||
## everywhere it appears in this file
|
||||
|
||||
ld < _APPNAME_.munch
|
||||
|
||||
#The following uses drvTS for vxWorks. May be needed for hardware event systems
|
||||
## This drvTS initializer is needed if the IOC has a hardware event system
|
||||
#TSinit
|
||||
|
||||
## Register all support components
|
||||
cd top
|
||||
dbLoadDatabase("dbd/_APPNAME_.dbd",0,0)
|
||||
registerRecordDeviceDriver(pdbbase)
|
||||
|
||||
## Load record instances
|
||||
dbLoadRecords("db/dbExample1.db","user=_USER_")
|
||||
dbLoadRecords("db/dbExample2.db","user=_USER_,no=1,scan=1 second")
|
||||
dbLoadRecords("db/dbExample2.db","user=_USER_,no=2,scan=2 second")
|
||||
dbLoadRecords("db/dbExample2.db","user=_USER_,no=3,scan=5 second")
|
||||
dbLoadRecords("db/dbSubExample.db","user=_USER_")
|
||||
|
||||
## Set this to see messages from mySub
|
||||
#mySubDebug = 1
|
||||
|
||||
cd startup
|
||||
iocInit
|
||||
iocInit()
|
||||
|
||||
## Start any sequence programs
|
||||
#seq &sncExample,"user=_USER_"
|
||||
|
||||
Reference in New Issue
Block a user