EPICS: vxWorks IOC: Difference between revisions
Line 172: | Line 172: | ||
iocsy527_SRCS += sy527_test.c | iocsy527_SRCS += sy527_test.c | ||
Compile, reboot - | Compile, reboot - looks good. |
Revision as of 12:15, 3 October 2007
VxWorks IOCs are normally running in VME crate controllers.
standard installation
cd $EPICS_BASE ./bin/solaris-sparc/makeBaseApp.pl -b $EPICS_BASE -t ioc iocsy527 ./bin/solaris-sparc/makeBaseApp.pl -b $EPICS_BASE -i -t ioc iocsy527 The following target architectures are available in base: solaris-sparc vxWorks-ppc604_long solaris-x86 linux-x86 What architecture do you want to use? vxWorks-ppc604_long The following applications are available: caclient caserver ioc ioccamac iocCore1 iocCore iochv iocsy527 ioctest support What application should the IOC(s) boot? The default uses the IOC's name, even if not listed above. Application name? iocsy527
It creates directories iocsy527App and iocBoot/iocsy527.
cd iocsy527App gmake
It compiles both unix and vxWorks versions.
cd ../iocBoot/iocsy527 gmake
It creates useful cdCommands file. File st.cmd' in the same directory contains an example of startup script. Uncommect followibg line
cd "/usr/local/clas/devel/R3.14.8.2/base-3.14.8.2/iocBoot/iocsy527"
and boot. Everything looks good.
Makefile, source files
Original Makefile in /usr/local/clas/devel/R3.14.8.2/base-3.14.8.2/iocsy527App/src:
TOP=../.. include $(TOP)/configure/CONFIG #---------------------------------------- # ADD MACRO DEFINITIONS AFTER THIS LINE #============================= #============================= # build an ioc application PROD_IOC = iocsy527 DBD += iocsy527.dbd # iocsy527.dbd will be made up from these files: iocsy527_DBD += base.dbd #include definitions for any other support applications needed #iocsy527_DBD += xxx.dbd # <name>_registerRecordDeviceDriver.cpp will be created from <name>.dbd iocsy527_SRCS += iocsy527_registerRecordDeviceDriver.cpp iocsy527_SRCS_DEFAULT += iocsy527Main.cpp iocsy527_SRCS_vxWorks += -nil- #The following adds support from base/src/vxWorks iocsy527_OBJS_vxWorks += $(EPICS_BASE_BIN)/vxComLibrary #add a definition for each support application used by this application #iocsy527_LIBS += xxx #NOTES: # 1)It is not possible to build sncExample both as a component of iocsy527 # and standalone. You must choose only one. # 2)To build sncExample SNCSEQ must be defined in <top>/configure/RELEASE #The following builds sncExample as a component of iocsy527 #iocsy527_SRCS += sncExample.stt #iocsy527_LIBS += seq pv iocsy527_LIBS += $(EPICS_BASE_IOC_LIBS) #The following builds sncExample as a standalone application #PROD_HOST += sncExample #sncExample_SNCFLAGS += +m #sncExample_SRCS += sncExample.stt #sncExample_LIBS += seq pv #sncExample_LIBS += $(EPICS_BASE_HOST_LIBS) #=========================== include $(TOP)/configure/RULES #---------------------------------------- # ADD RULES AFTER THIS LINE
Copy following files from 'DriverOld':
sy527.h sy527epics1.h v288.h sy527.c sy527_test.c sy527epics1.c v288.c
Add following to Makefile:
iocsy527_SRCS += v288 iocsy527_SRCS += sy527 iocsy527_SRCS += sy527epics1
Type gmake - everything compiles and linked with new source files.
Copy following files from 'IocshellOld':
command.h sub.c bigsub.c devCAEN.c
Add them to the Makefile the same way, and type 'gmake'. It complains for UNIX on linking, but command
gmake vxWorks-ppc604_long
works fine. Reboot IOC - no undefined symbols.
Add our HV database and 'src' directories into cdCommands:
db = "/usr/local/clas/devel/R3.14.8.2/EPICS/app/hvca/db" src = "/usr/local/clas/devel/R3.14.8.2/base-3.14.8.2/iocsy527App/src"
Add following two lnes to startup script after iocInit() (before - complains):
cd src dbLoadDatabase("support.dbd") cd db dbLoadRecords("caen_04.db")
Reboot ioc again, type 'dbl' - all records printed.
Try to caget one of them - vxWorks printed error: we got through but corresponding function support is missing.
Do following on vxWorks prompt:
registryFunctionAdd("InitChannel",InitChannel) registryFunctionAdd("ScanChannel",ScanChannel)
does not help. Run driver commands in the very end of startup script - does not help:
sy527Init() sy527Start(0,"sy527_0x100000_9") sy527GetMap(0)
trying same, but use type 'example' instead of 'ioc'
cd $EPICS_BASE ./bin/solaris-sparc/makeBaseApp.pl -b $EPICS_BASE -t example iocsy527 ./bin/solaris-sparc/makeBaseApp.pl -b $EPICS_BASE -i -t ioc iocsy527
Everything compiles and boots, 'caget' works.
Now, lets customize it for sy517:
- copy following v288- and sy527-related *.h and *.c files to $EPICS_BASE/iocsy527/src directory:
v288.c v288.h sy527.c sy527.h sy527_test.c sy527epics.c sy527epics.h
(sy527epics1 was renamed to sy527epics in a process). Add follwoing lines to the Makefile:
iocsy527_SRCS += v288.c iocsy527_SRCS += sy527.c iocsy527_SRCS += sy527epics.c iocsy527_SRCS += sy527_test.c
Compile, reboot - looks good.