diff --git a/src/makeBaseApp/top/exampleApp/src/_APPNAME_Include.dbd b/src/makeBaseApp/top/exampleApp/src/_APPNAME_Include.dbd index e04befcbb..0a28c34c0 100644 --- a/src/makeBaseApp/top/exampleApp/src/_APPNAME_Include.dbd +++ b/src/makeBaseApp/top/exampleApp/src/_APPNAME_Include.dbd @@ -1,3 +1,4 @@ include "base.dbd" include "xxxSupport.dbd" registrar(mySubRegistrar) +variable(mySubDebug) diff --git a/src/makeBaseApp/top/exampleApp/src/dbSubExample.c b/src/makeBaseApp/top/exampleApp/src/dbSubExample.c index 80b3a9d1e..3a88dbd97 100644 --- a/src/makeBaseApp/top/exampleApp/src/dbSubExample.c +++ b/src/makeBaseApp/top/exampleApp/src/dbSubExample.c @@ -5,19 +5,24 @@ #include #include +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); } diff --git a/src/makeBaseApp/top/exampleBoot/ioc/st.cmd@Common b/src/makeBaseApp/top/exampleBoot/ioc/st.cmd@Common index 372954416..821a24780 100644 --- a/src/makeBaseApp/top/exampleBoot/ioc/st.cmd@Common +++ b/src/makeBaseApp/top/exampleBoot/ioc/st.cmd@Common @@ -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" diff --git a/src/makeBaseApp/top/exampleBoot/ioc/st.cmd@RTEMS b/src/makeBaseApp/top/exampleBoot/ioc/st.cmd@RTEMS index 6188f1d20..7381875ce 100644 --- a/src/makeBaseApp/top/exampleBoot/ioc/st.cmd@RTEMS +++ b/src/makeBaseApp/top/exampleBoot/ioc/st.cmd@RTEMS @@ -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_" diff --git a/src/makeBaseApp/top/exampleBoot/ioc/st.cmd@vxWorks b/src/makeBaseApp/top/exampleBoot/ioc/st.cmd@vxWorks index 45bf7fe19..3d63d48d7 100644 --- a/src/makeBaseApp/top/exampleBoot/ioc/st.cmd@vxWorks +++ b/src/makeBaseApp/top/exampleBoot/ioc/st.cmd@vxWorks @@ -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_"