Table of Contents Previous Chapter Chapter 5: User Interface

Chapter 5: User Interface

1. Introduction

This chapter explains how to create an application that uses base products. This normally means IOC applications. Channel access client extensions can also be executed in this environment.

The environment described here is fine for small applications and for testing. If you have a large application there is an extension product (Application Source/Release Control System) that provides a much more complete environment.

2. Creating an Application Directory

Execute the following commands:

  mkdir <appdir>
  cd <appdir>
You will need a vxWorks startup script file. The following is a sample:

  # vxWorks startup script to load and execute system (iocCore) software.
  ld < targetmv167/iocCore
  ld < targetmv167/drvSup
  ld < targetmv167/devSup
  ld < targetmv167/recSup
  ld < src/O.mv167/myobj1.o
  ld < src/O.mv167/myobj2.o
  dbLoad  "default.dctsdr"
  dbLoadRecords  "<app1>.db"
  dbLoadRecords  "<app2>.db"
<app1>.db and <app2>.db are database files created in gdct database format.

3. Getting a Release

If this is a new application or if you want to use a new base release execute the command:

  <epics_path>/base/tools/getrel <epics_path> <iocarch> [<iocarch>]
where <epics_path> is the location of an EPICS tree. For example if you want release 3.12 and you have an mv167 IOC processor then issue the command:

  /usr/local/epics/R3.12/base/tools/getrel /usr/local/epics/R3.12 mv167
After issuing this command issue the ls command. You will see that getrel created several soft links for you. These links allow you to:

  1. Create, load, and execute IOC databases and sequence programs,
  2. Create and use private record/device/driver support,
  3. Create and use other IOC software.
You can also build Unix code in this environment but you might prefer to do this in an extension development environment. Included are the soft links:

4. Boot Parameters

The following are sample IOC boot parameters.

  boot device          : ei 
  processor number     : 0 
  host name            : <boot host name> 
  file name            : <full path name to your app dir>/vxWorksmv167 
  inet on ethernet (e) : <inet address of ioc>:ffffff00 
  inet on backplane (b): 
  host inet (h)        : <inet address of host> 
  gateway inet (g)     : 
  user (u)             : <userid for ioc> 
  ftp password (pw) (blank = use rsh): <password for ioc> 
  flags (f)            : 0x0 
  target name (tn)     : 
  startup script (s)   : st.cmdmv167 
  other (o)            : 

5. Creating Private ASCII Files

The getrel environment allows you to create private record/device/driver support as well as override the support provided with a release. The first step is to create two directories:

As an example let's say that you want to create:

  1. A new record type called myRecord.
  2. Device support for the new record called devMyRecord.
  3. A new driver called myDriver.
The following files are placed in cat_ascii:

After you have created or modified the local ASCII files (or after a new getrel) then just execute the command:

This command creates the file default.dctsdr which contains the information from all the ASCII files including yours. It also creates a directory sdrH/rec, which contains all the record type header files.

6. Building Private Source Files

If you want to develop private components for use on Unix and/or in an IOC (record support, etc.) then it is a good idea to create a subdirectory called src. It is then possible to create makefiles that use base development configuration files. This document describes these configuration files in Chapter 8, Section "Configuration Files" on page 37. The following samples are intended to show how simple makefiles can be. The following makefiles assume that they and all the source files reside in a directory one level below where getrel is executed.

Components for all site supported architectures will be built in automatically generated O.<arch> subdirectories via the command "gmake" from the src directory.

The Makefiles for building the private source files have the same structure and features as the Makefiles described in Chapter 6, Section "Using EPICS Makefiles" on page 24 and Chapter 6, Section "Creating High-level Makefiles" on page 25, except that the default rule has been set to "build" instead of "install" because "install" is not meaningful when in an application directory.


  include $(EPICS)/config/CONFIG_BASE
  default: build
  include $(EPICS)/config/RULES_ARCHS


Execution of this Makefile is from O.<arch> subdirectory.

  include Target.include
  include $(EPICS)/config/CONFIG_BASE
  USR_INCLUDES = -I$(EPICS)/replace_ascii -I$(EPICS)/cat_ascii \
      -I$(EPICS)/sdrH/rec -I$(EPICS)/include/rec
  SRCS.C = ../<src1>.c ../<src2>.c ../<src3>.c ../<src4>.c
  TARGETS = <src1>.o <src2>.o <src3>.o <src4>.o
  default: build
  include $(EPICS)/config/RULES.Vx


Execution of this Makefile is from the O.<arch> subdirectory.

  include Target.include
  include $(EPICS)/config/CONFIG_BASE
  DEPLIBS = $(EPICS_BASE_LIB)/libca.a $(EPICS_BASE_LIB)/libCom.a
  USR_LDLIBS = -lca -lCom
  SRCS.c = ../src1.c ../src2.c ../src3.c
  OBJS = obj1.c obj2.c obj3.c
  TARGETS = target
  default: build
  include $(EPICS)/config/RULES.Unix
  target:  $(OBJS) $(DEPLIBS)
    $(RM) $@
    $(LINK.c) -o $@ ${OBJS} $(LDLIBS)
Table of Contents Next Chapter