14
1 1999/Ph 514: IOC Development Environment EPICS IOC Development Environment Marty Kraimer APS

1 1999/Ph 514: IOC Development Environment EPICS IOC Development Environment Marty Kraimer APS

Embed Size (px)

Citation preview

Page 1: 1 1999/Ph 514: IOC Development Environment EPICS IOC Development Environment Marty Kraimer APS

11999/Ph 514: IOC Development Environment

EPICS

IOC Development Environment

Marty KraimerAPS

Page 2: 1 1999/Ph 514: IOC Development Environment EPICS IOC Development Environment Marty Kraimer APS

21999/Ph 514: IOC Development Environment

EPICSReference

EPICS IOC ApplicationsBuilding

andSource Release Control

Marty Kraimer,Janet Anderson,Ralph Lange

June 15, 1998

Page 3: 1 1999/Ph 514: IOC Development Environment EPICS IOC Development Environment Marty Kraimer APS

31999/Ph 514: IOC Development Environment

EPICSOverview

Create and build IOC applications databases vxWorks startup files SNL programs New record, device, driver support Access security configuration files Other IOC code Special Host code

Source management features CVS can be used IOC software is divided into <top> areas

Each <top> is separately managed gnumake + rules builds all components

User prerequisites Understands C Knows how to use a text editor Has superficial knowledge of make

Page 4: 1 1999/Ph 514: IOC Development Environment EPICS IOC Development Environment Marty Kraimer APS

41999/Ph 514: IOC Development Environment

EPICS<top> Directory Structure

<top>/

config/ Configuration + Rules

xxxApp/ All source files except startup

src/ Code

xxxSrc/ Arbitrary number of xxxSrc

Db/ Databases

xxxDb Arbitrary number of xxxDb

... May have others: adl, etc

xxxApp/ Arbitrary number of xxxAppiocBoot/ Only one iocBoot

iocxxx Directory for each ioc

bin/ install directory

<host_arch>/

<target_arch>/

<other install directories>

Page 5: 1 1999/Ph 514: IOC Development Environment EPICS IOC Development Environment Marty Kraimer APS

51999/Ph 514: IOC Development Environment

EPICSInstall directories

By default installed into <top>/<xxx>

<top>bin/ Object and executables

solaris/mv167/

lib/ Object libraries<arch>

include/ e.g. xxxRecord.hdbd/ menu, recordtype, device, driver,etcdb/ record instances, templates, etc...

Page 6: 1 1999/Ph 514: IOC Development Environment EPICS IOC Development Environment Marty Kraimer APS

61999/Ph 514: IOC Development Environment

EPICSgnumake

make (gnumake) at any level <top>

gnumake clean uninstall gnumake

Builds and installs everything that is not up to date xxxApp

gnumake <arguments>Same as issuing command in each subdirectory

xxxApp/xxxSrc Builds in O.<arch>; Installs in <top>/<something> gnumake

Builds and installs all out of date components <args>

<arch>Build only for specified architecturegnumake mv167

cleanRemove all O.<arch> directories

xxxApp/xxxDbgenerates and installs database instance files + more

iocBoot/iocxxxCreates the cdCommands file

Page 7: 1 1999/Ph 514: IOC Development Environment EPICS IOC Development Environment Marty Kraimer APS

71999/Ph 514: IOC Development Environment

EPICSconfig files

Files meant to be modified CONFIG - Can override make variables

CROSS_COMPILER_TARGET_ARCHS = mv167

CONFIG_APPDefinitions for <top>s referenced in RELEASE

RELEASELocation of other <top> areasEPICS_BASE=/usr/local/epics/baseR3.13.1

Other files RULES.xxx

Files containing make rules *.pl

Perl scripts used by make rules Structure of shared <top> areas

Just another <top> Everything intended for use by other

<top>s is installed.

Page 8: 1 1999/Ph 514: IOC Development Environment EPICS IOC Development Environment Marty Kraimer APS

81999/Ph 514: IOC Development Environment

EPICSxxxApp/src files

base.dbd - definitions supplied by base get from base or other <top> and edit menu, recordtype, device, driver taken

from base much support commented out

include “menuGlobal.dbd”...#include “egRecord.dbd”...#device(ai,VME_IO,devAiXy566Se,”XYCOM-566 SE Scanned”)

baseLIBOBJS - objects supplied by base get from base or other <top> and edit object modules for record, device, driver

support Like base.dbd much support commented

out changes made to this must match

base.dbd

Page 9: 1 1999/Ph 514: IOC Development Environment EPICS IOC Development Environment Marty Kraimer APS

91999/Ph 514: IOC Development Environment

EPICSbase.dbd and baseLIBOBJS

include "menuGlobal.dbd"include "menuConvert.dbd"include "aiRecord.dbd"#include "aaiRecord.dbd"include "aoRecord.dbd"#include "aaoRecord.dbd"

device(ai,CONSTANT,devAiSoft,"Soft Channel")device(ai,CONSTANT,devAiSoftRaw,"Raw Soft Channel")#device(ai,VME_IO,devAiXy566Se,"XYCOM-566 SE Scanned")

#driver(drvGpib)driver(drvBitBus)#driver(drvBb910)

#LIBOBJS += $(EPICS_BASE_BIN)/aaiRecord.o#LIBOBJS += $(EPICS_BASE_BIN)/aaoRecord.oLIBOBJS += $(EPICS_BASE_BIN)/aiRecord.oLIBOBJS += $(EPICS_BASE_BIN)/aoRecord.o

LIBOBJS += $(EPICS_BASE_BIN)/devAiSoft.oLIBOBJS += $(EPICS_BASE_BIN)/devAiSoftRaw.o#LIBOBJS += $(EPICS_BASE_BIN)/devAiXy566Se.o

#LIBOBJS += $(EPICS_BASE_BIN)/drvBb910.oLIBOBJS += $(EPICS_BASE_BIN)/drvBitBus.o#LIBOBJS += $(EPICS_BASE_BIN)/drvGpib.o

base.dbd

baseLIBOBJS

Page 10: 1 1999/Ph 514: IOC Development Environment EPICS IOC Development Environment Marty Kraimer APS

101999/Ph 514: IOC Development Environment

EPICSxxxApp/src continued

Makefile.HostRECTYPES += xxxRecord.h

DBDEXPAND += xxxInclude.dbd

DBDNAME = xxxApp.dbd

xxxInclude.dbdinclude “base.dbd”

include “xxxRecord.dbd”

device(xxx,CONSTANT,devXxxSoft,”Softchannel”)

Makefile.VxLIBOBJS += xxxRecord.o

LIBOBJS += sncExample.o

include ../baseLIBOBJS

LIBNAME = xxxLib

INSTALLS += iocCore seq

PROD += xxx.o

Page 11: 1 1999/Ph 514: IOC Development Environment EPICS IOC Development Environment Marty Kraimer APS

111999/Ph 514: IOC Development Environment

EPICSxxxApp/xxxDb/Makefile.Host

databases installed into <top>/dbDB += xxx.db

Template files expanded on host yyy.template has the format

record(ai,”$(USER):aiExample$(NO)”){… }

yyy.substitutionsfile yyy.template {{USER=“mrk”,NO=“1”}{USER=“mrk”,NO=“2”}

}

DB += yyy.db

USES_TEMPLATE += yyy.template

Template files to be expanded at boot time via dbLoadTemplate()DB += zzz.template zzz.substitutions

Support for capfast generated files Can also expand .dbd files

Page 12: 1 1999/Ph 514: IOC Development Environment EPICS IOC Development Environment Marty Kraimer APS

121999/Ph 514: IOC Development Environment

EPICSiocBoot

iocBoot/MakefileExecutes make in each subdirectory

iocBoot/iocxxx/MakefileCreates cdCommands. Make sure thatARCH = <arch>

is defined correctly cdCommands looks like

startup=“<full path to iocxxx>“appbin=“<full path to top/bin/arch>“…

st.cmd looks like< cdCommandscd appbinld < iocCoreld < xxxLibcd startupdbLoadDatabase(“../../dbd/xxxApp.dbd”)dbLoadRecords(“../../db/xxx.db”,”user=mrk”)iocInit

Page 13: 1 1999/Ph 514: IOC Development Environment EPICS IOC Development Environment Marty Kraimer APS

131999/Ph 514: IOC Development Environment

EPICSmakeBaseApp

Execute the commandscd ~/iocmkdir examplecd example<path>/makeBaseApp.pl -t example example<path>/makeBaseApp.pl -i -t example example

The first command creates:<top>/

Makefileconfig/

...exampleApp

src/...

Db/...

The second command creates:<top>/iocBoot

Makefileiocexample/

Each command can be issued multiple times Look at example!!!

Page 14: 1 1999/Ph 514: IOC Development Environment EPICS IOC Development Environment Marty Kraimer APS

141999/Ph 514: IOC Development Environment

EPICSApplication Templates

makeBaseApp uses templates base supplies the following

<base>/templates/makeBaseApp/top/MakefileconfigexampleAppexampleBootsimpleAppsimpleBoot

Application templates can be created.

<top>/config/RELEASE containsTEMPLATE_TOP = <full path to template top>

Templates are just like another <top>