EPICS: Software IOC: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
Line 71: | Line 71: | ||
It will create ioctest1/envPaths | It will create ioctest1/envPaths | ||
To start IOC: | |||
cd ioctest1/ | |||
chmod 755 st.cmd | |||
./st.cmd | |||
Following output: | |||
#!../../bin/linux-x86/test1 | |||
## You may have to change test1 to something else | |||
## everywhere it appears in this file | |||
< envPaths | |||
epicsEnvSet(ARCH,"linux-x86") | |||
epicsEnvSet(IOC,"ioctest1") | |||
epicsEnvSet(TOP,"/usr/local/clas/devel/R3.14.8.2/EPICS/baseB") | |||
cd /usr/local/clas/devel/R3.14.8.2/EPICS/baseB | |||
## Register all support components | |||
dbLoadDatabase("dbd/test1.dbd") | |||
test1_registerRecordDeviceDriver(pdbbase) | |||
## Load record instances | |||
dbLoadRecords("db/dbExample1.db","user=boiarinoHost") | |||
dbLoadRecords("db/dbExample2.db","user=boiarinoHost,no=1,scan=1 second") | |||
dbLoadRecords("db/dbExample2.db","user=boiarinoHost,no=2,scan=2 second") | |||
dbLoadRecords("db/dbExample2.db","user=boiarinoHost,no=3,scan=5 second") | |||
dbLoadRecords("db/dbSubExample.db","user=boiarinoHost") | |||
## Set this to see messages from mySub | |||
#var mySubDebug 1 | |||
cd /usr/local/clas/devel/R3.14.8.2/EPICS/baseB/iocBoot/ioctest1 | |||
iocInit() | |||
Starting iocInit | |||
############################################################################ | |||
### EPICS IOC CORE built on Sep 21 2006 | |||
### EPICS R3.14.8.2 $R3-14-8-2$ $2006/01/06 15:55:13$ | |||
############################################################################ | |||
iocInit: All initialization complete | |||
## Start any sequence programs | |||
#seq sncExample,"user=boiarinoHost" | |||
epics> |
Revision as of 14:55, 5 January 2007
Software IOC is the process running on Linux or Solaris. For initial setting do following:
ssh boiarino@clonpc1 cd $CLAS/R3.14.8.2 source .setup (usually done by $CLAS/.setup) cd $CLAS/R3.14.8.2/EPICS source .setup cd baseB (or 'cd $BASEB')
New application can be done using 'makeBaseApp.pl' script. To see possible application types use following:
makeBaseApp.pl -l
It will show:
Valid application types are: support ioc example caClient caServer Valid iocBoot types are: example ioc
Following command will create new type 'example' application named 'test1' (it will NOT create new Makefile and configure/ directory if they exists already, otherwise it will !):
makeBaseApp.pl -b $EPICS_BASE -t example test1
It will create subdirectory test1App with appropriate contents; do following:
cd test1App make
To make boot script do following:
makeBaseApp.pl -b $EPICS_BASE -i -t example test1
Following dialog:
The following target architectures are available in base: solaris-sparc vxWorks-ppc604_long solaris-x86 linux-x86 What architecture do you want to use? linux-x86 The following applications are available: test1 What application should the IOC(s) boot? The default uses the IOC's name, even if not listed above. Application name? test1
It will do following:
create iocBoot/ and iocBoot/Makefile if do not exists already create iocBoot/iostest1 with appropriate contents creade db/ if does not exist already (?) copy *.db files from test1App/Db/ to db/ create dbd/ if does not exist already (?) copy some (?) *.dbd files from test1App/ to dbd/ (xxxRecord.dbd, xxxSupport.dbd) create dbd/test1.dbd (copies some templete from base ???) create include/ if does not exist (?) copy xxxRecord.h file to include/ (from some templete ?) (corresponds to some dbd file ?) copy libxxxSupport.a and libxxxSupport.so to lib/linux-x86/ (or whatever platform is)
To create environment envPaths:
cd iocBoot make
It will create ioctest1/envPaths
To start IOC:
cd ioctest1/ chmod 755 st.cmd ./st.cmd
Following output:
#!../../bin/linux-x86/test1 ## You may have to change test1 to something else ## everywhere it appears in this file < envPaths epicsEnvSet(ARCH,"linux-x86") epicsEnvSet(IOC,"ioctest1") epicsEnvSet(TOP,"/usr/local/clas/devel/R3.14.8.2/EPICS/baseB") cd /usr/local/clas/devel/R3.14.8.2/EPICS/baseB ## Register all support components dbLoadDatabase("dbd/test1.dbd") test1_registerRecordDeviceDriver(pdbbase) ## Load record instances dbLoadRecords("db/dbExample1.db","user=boiarinoHost") dbLoadRecords("db/dbExample2.db","user=boiarinoHost,no=1,scan=1 second") dbLoadRecords("db/dbExample2.db","user=boiarinoHost,no=2,scan=2 second") dbLoadRecords("db/dbExample2.db","user=boiarinoHost,no=3,scan=5 second") dbLoadRecords("db/dbSubExample.db","user=boiarinoHost") ## Set this to see messages from mySub #var mySubDebug 1 cd /usr/local/clas/devel/R3.14.8.2/EPICS/baseB/iocBoot/ioctest1 iocInit() Starting iocInit ############################################################################ ### EPICS IOC CORE built on Sep 21 2006 ### EPICS R3.14.8.2 $R3-14-8-2$ $2006/01/06 15:55:13$ ############################################################################ iocInit: All initialization complete ## Start any sequence programs #seq sncExample,"user=boiarinoHost" epics>