EPICS IOC Development Environment Marty Kraimer APS 1999Ph

  • Slides: 14
Download presentation
EPICS IOC Development Environment Marty Kraimer APS 1999/Ph 514: IOC Development Environment 1

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

Reference EPICS IOC Applications Building and Source Release Control Marty Kraimer, Janet Anderson, Ralph

Reference EPICS IOC Applications Building and Source Release Control Marty Kraimer, Janet Anderson, Ralph Lange June 15, 1998 1999/Ph 514: IOC Development Environment 2

Overview u Create and build IOC applications u u u u databases vx. Works

Overview u Create and build IOC applications u u u u databases vx. Works startup files SNL programs New record, device, driver support Access security configuration files Other IOC code Special Host code Source management features u u EPICS CVS can be used IOC software is divided into <top> areas Each <top> is separately managed gnumake + rules builds all components User prerequisites u u u Understands C Knows how to use a text editor Has superficial knowledge of make 1999/Ph 514: IOC Development Environment 3

<top> Directory Structure EPICS <top>/ config/ Configuration + Rules xxx. App/ All source files

<top> Directory Structure EPICS <top>/ config/ Configuration + Rules xxx. App/ All source files except startup src/ Code xxx. Src/ Arbitrary number of xxx. Src Db/ Databases xxx. Db Arbitrary number of xxx. Db. . . May have others: adl, etc xxx. App/ Arbitrary number of xxx. App ioc. Boot/ Only one ioc. Boot iocxxx Directory for each ioc … bin/ install directory <host_arch>/ <target_arch>/ … <other install directories> 1999/Ph 514: IOC Development Environment 4

Install directories EPICS By default installed into <top>/<xxx> <top> bin/ Object and executables solaris/

Install directories EPICS By default installed into <top>/<xxx> <top> bin/ Object and executables solaris/ mv 167/ lib/ Object libraries <arch> include/ e. g. xxx. Record. h dbd/ menu, recordtype, device, driver, etc db/ record instances, templates, etc. . . 1999/Ph 514: IOC Development Environment 5

gnumake u u u EPICS make (gnumake) at any level <top> u gnumake clean

gnumake u u u EPICS make (gnumake) at any level <top> u gnumake clean uninstall u gnumake Builds and installs everything that is not up to date xxx. App u gnumake <arguments> Same as issuing command in each subdirectory xxx. App/xxx. Src u Builds in O. <arch>; Installs in <top>/<something> u gnumake Builds and installs all out of date components u <args> u <arch> Build only for specified architecture gnumake mv 167 u clean Remove all O. <arch> directories xxx. App/xxx. Db generates and installs database instance files + more ioc. Boot/iocxxx Creates the cd. Commands file 1999/Ph 514: IOC Development Environment 6

config files u EPICS Files meant to be modified u CONFIG - Can override

config files u EPICS Files meant to be modified u CONFIG - Can override make variables CROSS_COMPILER_TARGET_ARCHS = mv 167 u u CONFIG_APP Definitions for <top>s referenced in RELEASE Location of other <top> areas EPICS_BASE=/usr/local/epics/base. R 3. 1 u Other files u u u RULES. xxx Files containing make rules *. pl Perl scripts used by make rules Structure of shared <top> areas u u Just another <top> Everything intended for use by other <top>s is installed. 1999/Ph 514: IOC Development Environment 7

xxx. App/src files u EPICS base. dbd - definitions supplied by base u u

xxx. App/src files u EPICS base. dbd - definitions supplied by base u u u get from base or other <top> and edit menu, recordtype, device, driver taken from base much support commented out include “menu. Global. dbd”. . . #include “eg. Record. dbd”. . . #device(ai, VME_IO, dev. Ai. Xy 566 Se, ”XYCOM-566 SE Scanned”) u base. LIBOBJS - objects supplied by base u u 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 1999/Ph 514: IOC Development Environment 8

base. dbd and base. LIBOBJS EPICS base. dbd include "menu. Global. dbd" include "menu.

base. dbd and base. LIBOBJS EPICS base. dbd include "menu. Global. dbd" include "menu. Convert. dbd" include "ai. Record. dbd" #include "aai. Record. dbd" include "ao. Record. dbd" #include "aao. Record. dbd" device(ai, CONSTANT, dev. Ai. Soft, "Soft Channel") device(ai, CONSTANT, dev. Ai. Soft. Raw, "Raw Soft Channel") #device(ai, VME_IO, dev. Ai. Xy 566 Se, "XYCOM-566 SE Scanned") #driver(drv. Gpib) driver(drv. Bit. Bus) #driver(drv. Bb 910) #LIBOBJS += $(EPICS_BASE_BIN)/aai. Record. o #LIBOBJS += $(EPICS_BASE_BIN)/aao. Record. o LIBOBJS += $(EPICS_BASE_BIN)/ai. Record. o LIBOBJS += $(EPICS_BASE_BIN)/ao. Record. o base. LIBOBJS += $(EPICS_BASE_BIN)/dev. Ai. Soft. o LIBOBJS += $(EPICS_BASE_BIN)/dev. Ai. Soft. Raw. o #LIBOBJS += $(EPICS_BASE_BIN)/dev. Ai. Xy 566 Se. o #LIBOBJS += $(EPICS_BASE_BIN)/drv. Bb 910. o LIBOBJS += $(EPICS_BASE_BIN)/drv. Bit. Bus. o #LIBOBJS += $(EPICS_BASE_BIN)/drv. Gpib. o 1999/Ph 514: IOC Development Environment 9

xxx. App/src continued u EPICS Makefile. Host RECTYPES += xxx. Record. h DBDEXPAND +=

xxx. App/src continued u EPICS Makefile. Host RECTYPES += xxx. Record. h DBDEXPAND += xxx. Include. dbd DBDNAME = xxx. App. dbd u xxx. Include. dbd include “base. dbd” include “xxx. Record. dbd” device(xxx, CONSTANT, dev. Xxx. Soft, ”Softchannel”) u Makefile. Vx LIBOBJS += xxx. Record. o LIBOBJS += snc. Example. o include. . /base. LIBOBJS LIBNAME = xxx. Lib INSTALLS += ioc. Core seq PROD += xxx. o 1999/Ph 514: IOC Development Environment 10

xxx. App/xxx. Db/ Makefile. Host u EPICS databases installed into <top>/db DB += xxx.

xxx. App/xxx. Db/ Makefile. Host u EPICS databases installed into <top>/db DB += xxx. db u Template files expanded on host u yyy. template has the format record(ai, ”$(USER): ai. Example$(NO)”){ … } u yyy. substitutions file yyy. template { {USER=“mrk”, NO=“ 1”} {USER=“mrk”, NO=“ 2”} } DB += yyy. db USES_TEMPLATE += yyy. template u Template files to be expanded at boot time via db. Load. Template() DB += zzz. template zzz. substitutions u u Support for capfast generated files Can also expand. dbd files 1999/Ph 514: IOC Development Environment 11

ioc. Boot u u EPICS ioc. Boot/Makefile Executes make in each subdirectory ioc. Boot/iocxxx/Makefile

ioc. Boot u u EPICS ioc. Boot/Makefile Executes make in each subdirectory ioc. Boot/iocxxx/Makefile Creates cd. Commands. Make sure that ARCH = <arch> is defined correctly u cd. Commands looks like startup=“<full path to iocxxx>“ appbin=“<full path to top/bin/arch>“ … u st. cmd looks like < cd. Commands cd appbin ld < ioc. Core ld < xxx. Lib cd startup db. Load. Database(“. . /dbd/xxx. App. dbd”) db. Load. Records(“. . /db/xxx. db”, ”user=mrk”) ioc. Init 1999/Ph 514: IOC Development Environment 12

make. Base. App u EPICS Execute the commands cd ~/ioc mkdir example cd example

make. Base. App u EPICS Execute the commands cd ~/ioc mkdir example cd example <path>/make. Base. App. pl -t example <path>/make. Base. App. pl -i -t example The first command creates: <top>/ Makefile config/. . . example. App src/. . . Db/. . . The second command creates: <top>/ioc. Boot Makefile iocexample/ … Each command can be issued multiple times u Look at example!!! 1999/Ph 514: IOC Development Environment 13

Application Templates u u EPICS make. Base. App uses templates base supplies the following

Application Templates u u EPICS make. Base. App uses templates base supplies the following <base>/templates/make. Base. App/top/ Makefile config example. App example. Boot simple. App simple. Boot u u Application templates can be created. <top>/config/RELEASE contains TEMPLATE_TOP = <full path to template top> u Templates are just like another <top> 1999/Ph 514: IOC Development Environment 14