EPICS: Software IOC: Difference between revisions
mNo edit summary |
No edit summary |
||
(5 intermediate revisions by 2 users not shown) | |||
Line 9: | Line 9: | ||
cd baseB (or 'cd $BASEB') | cd baseB (or 'cd $BASEB') | ||
New application can be done using 'makeBaseApp.pl' script (More detailed explained [http://www-hades.gsi.de/scs/appl_hints.html here]). To see possible application types use following: | New application can be done using 'makeBaseApp.pl' script (More detailed explained [http://www.aps.anl.gov/asd/controls/epics/EpicsDocumentation/AppDevManuals/iocScm-3.13.2/creatingTops.html here] and nicer [http://www-hades.gsi.de/scs/appl_hints.html here]). To see possible application types use following: | ||
makeBaseApp.pl -l | makeBaseApp.pl -l | ||
Line 28: | Line 28: | ||
makeBaseApp.pl -b $EPICS_BASE -t example test1 | makeBaseApp.pl -b $EPICS_BASE -t example test1 | ||
to make 'default' ioc: makeBaseApp.pl -b $EPICS_BASE -t ioc iocCore | |||
It will create subdirectory test1App with appropriate contents; do following: | It will create subdirectory test1App with appropriate contents; do following: | ||
Line 137: | Line 138: | ||
Existing IOCs have different structure, they can be found in baseB/src/, for example see inside CAEN_HV/. | Existing IOCs have different structure, they can be found in baseB/src/, for example see inside CAEN_HV/. | ||
To make it realy useful *.db files and medm GUI must be generated - see corresponding sections. For example: [[EPICS: generation of DBs and GUIs for HV]] | To make it realy useful *.db files and medm GUI must be generated - see corresponding sections. For example: [[EPICS: generation of DBs and GUIs for HV]] | ||
To run IOC as service on Linux '/etc/init.d/softioc' script must be provided. An example of such script for gamma profiler can be found on clonpc1. Copy it and change ''clonpc1'' to your machine name. | |||
That script calls startup scripts from directory ''$EPICSB/ioc/clonpc1'' or whatever your computer name is (if directory does not exist, create it, copy examples from another directory and modify). You can call startup script from another location but it is better to keep everything in one place (with one exception: ''clonpc3'' is running test versions so corresponding line in ''/etc/init.d/softioc'' looks as following: | |||
###SoftIocBin="cd $EPICSB/ioc/clonpc1; sleep 1000d | $BASEB/bin/linux-x86/iocCore ./softIoc" | |||
SoftIocBin="cd $BASEB/src/CAEN_HV/IocShell; sleep 1000d | $BASEB/bin/linux-x86/ioccaen ./startup.all" | |||
Following commands can be used to start and stop softioc: | |||
/etc/init.d/softioc start | |||
/etc/init.d/softioc stop | |||
To start softioc at boot time do following: | |||
/sbin/chkconfig --add softioc | |||
/sbin/chkconfig --list softioc |
Latest revision as of 18:52, 13 February 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 (this is the 'epicsB' directory) source .setup (usually done by $CLAS/R3.14.8.2/.setup above) cd baseB (or 'cd $BASEB')
New application can be done using 'makeBaseApp.pl' script (More detailed explained here and nicer here). 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 to make 'default' ioc: makeBaseApp.pl -b $EPICS_BASE -t ioc iocCore
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>
To list all available channels:
epics> dbl boiarinoHost:aiExample boiarinoHost:aiExample1 boiarinoHost:aiExample2 boiarinoHost:aiExample3 boiarinoHost:calcExample boiarinoHost:calcExample1 boiarinoHost:calcExample2 boiarinoHost:calcExample3 boiarinoHost:compressExample boiarinoHost:subExample boiarinoHost:xxxExample epics>
Use 'help' on 'epics>' prompt to get full list of commands.
Channels can be accessed now, for example type on another machine:
caget boiarinoHost:aiExample
It will return digit from 0 to 9 every time it called.
Existing IOCs have different structure, they can be found in baseB/src/, for example see inside CAEN_HV/. To make it realy useful *.db files and medm GUI must be generated - see corresponding sections. For example: EPICS: generation of DBs and GUIs for HV
To run IOC as service on Linux '/etc/init.d/softioc' script must be provided. An example of such script for gamma profiler can be found on clonpc1. Copy it and change clonpc1 to your machine name.
That script calls startup scripts from directory $EPICSB/ioc/clonpc1 or whatever your computer name is (if directory does not exist, create it, copy examples from another directory and modify). You can call startup script from another location but it is better to keep everything in one place (with one exception: clonpc3 is running test versions so corresponding line in /etc/init.d/softioc looks as following:
###SoftIocBin="cd $EPICSB/ioc/clonpc1; sleep 1000d | $BASEB/bin/linux-x86/iocCore ./softIoc" SoftIocBin="cd $BASEB/src/CAEN_HV/IocShell; sleep 1000d | $BASEB/bin/linux-x86/ioccaen ./startup.all"
Following commands can be used to start and stop softioc:
/etc/init.d/softioc start /etc/init.d/softioc stop
To start softioc at boot time do following:
/sbin/chkconfig --add softioc /sbin/chkconfig --list softioc