Installation

 

 

 

 

 

The sequencer is distributed as an EPICS R3.14 makeBaseApp application. This chapter describes how to obtain, unpack, build, install, verify and use the distribution.

 

Prerequisites

EPICS R3.14 (any version) or later must be installed on your system.

Obtaining the distribution

The distribution should be obtained via the sequencer home page which is, at the time of writing, at URL http://www2.keck.hawaii.edu:3636/realpublic/epics/seq (what a mouthful). This describes the available versions and will point you to a gzipped tar file with a name of the form seq-n.m.p.tar.gz ( n.m.p is the version number, e.g. 2.0.0 ).

Select and download the appropriate version. In what follows, we will assume that you downloaded v2.0.0. However, the instructions will apply to this or any later version.

Note that, from v2.0.0, the third digit is the patch level and will be incremented each time a new version is released, no matter how minor the changes. The second digit is the minor version number and will be incremented each time functional changes are made. The first digit is the major version number and will be incremented only when major changes are made.

Unpacking the distribution

cd to the directory that you wish to be the parent of the sequencer tree. Then unpack and untar the file. For example (these steps can be combined by clever use of pipes using syntax that I can never remember, or else if you have GNU tar, its -z option will decompress on the fly).

% gunzip seq-2.0.0.tar.gz

% tar xvf seq-2.0.0.tar

This creates a directory tree with the following general structure (this is part of the file in the top-level directory).

/sequencer

 

README This file (general notes at the top, followed

by release notes, most recent first)

 

(etc... update when README has been updated!)

Preparing to build

It will be necessary to edit the files configure/RELEASE and configure/CONFIG before building. Here are copies of these files, with the lines that you are likely to have change highlit:

#RELEASE Location of external products

EPICS_BASE=/home/wlupton/epics/anl/base

TEMPLATE_TOP=$(EPICS_BASE)/templates/makeBaseApp/top

SEQ=/home/wlupton/epics/seq

 

#CONFIG

include $(TOP)/configure/CONFIG_APP

# Add any changes to make rules here

 

#CROSS_COMPILER_TARGET_ARCHS = vxWorks-68040

CROSS_COMPILER_TARGET_ARCHS =

 

# shareable library version (from CONFIG_BASE)

SHRLIB_VERSION = $(EPICS_VERSION).$(EPICS_REVISION)

 

# sequencer version number (replaces old Version file)

SEQ_VERSION = 2.0.0

 

# override to use snc from SEQ

SNC = $(SEQ)/bin/$(EPICS_HOST_ARCH)/snc

 

# which message systems to support (comment to disable)

PVCA = TRUE

#PVFILE = TRUE

#PVKTL = TRUE

In RELEASE , you should select EPICS base via the EPICS_BASE macro and the top of the sequencer tree via the SEQ macro.

In CONFIG , you should select the target architectures for which to build via the CROSS_COMPILER_TARGET_ARCHS macro (a subset of those for which EPICS has been built), and the message systems to support via the PVXXX macros.

Building and installing

Ensure that your environment is configured for building EPICS applications. The only EPICS requirement is that the EPICS_HOST_ARCH environment variable be set correctly (you can use the $EPICS_BASE/startup/EpicsHostArch script to set it). However, if you built EPICS with shareable library support, your LD_LIBRARY_PATH environment variable will have to include $EPICS_BASE/lib/$EPICS_HOST_ARCH , and if you are using gcc with shareable library support, it will have to include the directory that contains libstdc++.so . These notes are written from a Solaris standpoint; details may vary slightly under other architectures.

cd to the top of the sequencer tree and run GNU make. The tree should build without incident. Please feed back any build problems (and their resolutions!) to me. My e-mail address is on the front cover of this manual.

Note that make builds in the configure directory, then the src tree, and finally the test tree. A failure in the test tree will not impact your ability to write sequences.

Verifying the installation

Under Solaris, the -R loader option will have been used to link executables, so LD_LIBRARY_PATH should need no further additions. Under other operating systems, it may be necessary to append $SUPPORT/lib/$EPICS_HOST_ARCH , where SUPPORT has the value that you gave it in configure/RELEASE .

cd to $SUPPORT/bin/$EPICS_HOST_ARCH . It should look like this:

demo sncDelay sncEntryVar sncExample sncOpttVar

demo.vws sncEntry sncExEntry sncExitOptx

snc sncEntryOpte sncExOpt sncOptt

Try running demo. This includes its own CA server, so no IOC or portable CA server is needed. It should look something like this:

% ./demo

Starting iocInit

##################################################################

### @(#)EPICS IOC CORE built on Mar 22 2000

### @(#)Version R3.14.0.alpha $$Date: 2000/04/04 03:21:38 $$

### @(#)Built date Mar 22 2000

##################################################################

db_attach_pvAdapter I dont know what to call

iocInit: All initialization complete

@(#)SEQ Version 2.0.0: Fri Mar 31 16:50:09 HST 2000

osiSockDiscoverInterfaces(): ignoring loopback interface: lo0

osiSockDiscoverInterfaces(): net intf hme0 found

osiSockDiscoverInterfaces(): ignoring loopback interface: lo0

osiSockDiscoverInterfaces(): net intf hme0 found

Spawning thread 0xa54c0: "demo_1"

Spawning thread 0xa5580: "demo_2"

Spawning state program "demo", thread 0x98240: "demo"

demo_1 2000/03/31 17:14:24: start -> ramp_up

demo 2000/03/31 17:14:31: light_off -> light_on

demo_1 2000/03/31 17:14:35: ramp_up -> ramp_down

If you see the " start -> ramp_up " etc. messages, things are good. If not, some channels haven't connected (use the " - " to command to find out which).

Issue the " i " command. You should something like this:

i

NAME ID PRI STATE WAIT

_main_ 2adf8 0 OK

errlog 323a0 10 OK

taskwd 32508 10 OK

cbLow 3cf48 59 OK

cbMedium 30e10 64 OK

cbHigh 30ed8 71 OK

dbCaLink 313f0 50 OK

CAC process 31570 50 OK

scanOnce 4c5f0 70 OK

scan10 4c878 60 OK

scan5 4c908 61 OK

scan2 4c9b0 62 OK

scan1 4ca40 63 OK

scan0.5 4cad0 64 OK

scan0.2 4cb60 65 OK

scan0.1 4cbf0 66 OK

CAtcp 4cda0 20 OK

CAudp 4ce30 19 OK

seqAux 4def0 51 OK

CAonline 4df80 7 OK

CAC process 8ee70 50 OK

demo 9b310 50 OK

CAC UDP Recv 9c588 10 OK

CAC UDP Send 9c618 10 OK

osiTimerQueue 9c6e0 0 OK

demo_1 9cac0 50 OK

demo_2 9cb50 50 OK

CAC TCP Recv 9d070 10 OK

CAC TCP Send 9d100 10 OK

CA event b2cd8 19 OK

CAclient b2d68 10 OK

Finally, go to an xterm and do the following:

% caget ss0

ss0 light

% caget ss1

ss1 ramp

This illustrates the very basic "sequencer device support" in this release. These records are returning the names of the first two state-sets of the above sequence.

Most (maybe all) of the other test programs do not connect to control system variables and can be run without an IOC. For example:

% sncExitOptx

@(#)SEQ Version 2.0.0: Fri Mar 31 16:50:09 HST 2000

Spawning state program "sncexitoptx", thread 0x30868: "sncexitoptx"

low, delay timeout, incr v and now reenter low

v = 1

Pause on each exit of low, including 'iterations'

low, delay timeout, incr v and now reenter low

v = 2

Pause on each exit of low, including 'iterations'

low, delay timeout, incr v and now reenter low

v = 3

Pause on each exit of low, including 'iterations'

^D

Using the installation

This section assumes that you are working in a makeBaseApp environment. The more general information in See Using makeBaseApp should help if this is not the case.

You need to edit your own configure/RELEASE and configure/CONFIG files to reference the correct sequencer version. The necessary changes are similar to those that were made to build the sequencer (See Preparing to build). Here are versions of the files with the lines that must be added for the sequencer highlit:

#RELEASE Location of external products

EPICS_BASE=_EPICS_BASE_

TEMPLATE_TOP=_TEMPLATE_TOP_

SEQ=_SEQ_TOP_

 

#CONFIG

include $(TOP)/configure/CONFIG_APP

# Add any changes to make rules here

 

#CROSS_COMPILER_TARGET_ARCHS = vxWorks-68040

 

SNC = $(SEQ)/bin/$(EPICS_HOST_ARCH)/snc

You can refer to the various Makefile s in the test tree to see how to write your own sequences. For example, here is the Makefile for the above sncExitOptx program ( test/validate/Makefile ):

TOP = ../..

include $(TOP)/configure/CONFIG

 

SNCFLAGS = +m

 

SEQS = sncDelay sncEntry sncEntryOpte sncEntryVar sncExitOptx \

sncOptt sncOpttVar

PROD = $(SEQS)

OBJS_vxWorks = $(SEQS)

 

PROD_LIBS += seq

seq_DIR = $(SEQ_LIB)

 

include $(TOP)/test/Makefile.pv

 

PROD_LIBS += Com

 

include $(TOP)/configure/RULES

This Makefile includes test/Makefile.pv but you will probably want to look at that and bring what you need inline (it handles all the possible message systems and you will likely be using only a single message system). For example, to use CA, the following would be fine.

TOP = ../..

include $(TOP)/configure/CONFIG

 

SNCFLAGS = +m

 

SEQS = sncDelay sncEntry sncEntryOpte sncEntryVar sncExitOptx \

sncOptt sncOpttVar

PROD = $(SEQS)

OBJS_vxWorks = $(SEQS)

 

PROD_LIBS += seq pv pvCa ca Com

seq_DIR = $(SEQ_LIB)

 

include $(TOP)/configure/RULES

The only real requirements here are that SEQ is defined to point to the head of the tree in which the sequencer has been installed (see configure/RELEASE ; SEQ_LIB is automatically defined by a make rule in configure ), and that SNC is defined like this (see configure/CONFIG ):

SNC = $(SUPPORT)/bin/$(EPICS_HOST_ARCH)/snc