packetCollection - Collect & write packet files
packetCollection [-h|-i] -subsystem <subsystemName>
-packetfilename <fileName> &
The packetCollection program is a generic application which
can be used to retrieve packets from a specified EPICS based
control system and write them out to a packet file for col-
lection by UltraDAS. The application is commanded via DRAMA
and implements the ARCHIVE_B and the ARCHIVE_E actions.
The application is data driven. The details of the packets
that are to be collected will be found in a header packet
configuration file supplied as one of the command line argu-
In addition to it's ability to collect packets from EPICS
based systems, it has the ability to collect headers also
from the NAOMI Electra process monitor. The type of system
that the packet collection task is to collect headers from
will be specified in the packet collection header file.
There will be an instance of this application running for
every subsystem that UltraDAS expects to collects headers
from, each one differing from the others by it's DRAMA name
and the configuration file that it will use to establish
which headers it has to collect.
The command line options that the program accepts are
-h Print usage information about the application.
-i Print usage information about the application.
The name that this instance of the packet collection
task will be known within DRAMA networking. If an
instance of the packet collection task is already run-
ning with the same name when the application is
started, the application will abort. The -subsystem
option must be specified.
This is the absolute path to a file that contains the
configuration details which will be used to instruct
the application how to collect headers and write the
packet file. This option must be specified and it must
point to a valid configuration file.
The application implements two DRAMA actions ARCHIVE_B and
ARCHIVE_B will be requested at the start of a run by Ultra-
DAS and will instruct the application to collect all of the
headers that will not be updated throughout the run.
ARCHIVE_E will be requested at the end of a run by UltraDAS
and will instruct the application to collect all of the
headers that may have been updated throughout the run. After
the headers have been collected, the application will then
attempt to write the packet file. In the case that ARCHIVE_E
is requested before a ARCHIVE_E is received, an ARCHIVE_B
action is initiated before the ARCHIVE_E action is executed.
For each of the DRAMA actions, the application will expect
three arguments supplied with the action which are as fol-
lows and in the order outlined;
The name of the packet. This will be used in order to
create a file with the name in the format that UltraDAS
is expecting. An example packet name might be NAOMI.
The name of the camera. This will be used in order to
create a file with it's name in the format that Ultra-
DAS is expecting. An example camera name may be INGRID.
This will be the current run number and will be used in
order to create a file with the name in the format that
UltraDAS is expecting.
The output from the application are packet files. The packet
files will adopt the following naming convention.
The files will be written in standard FITS format to the
directory specified in the packet collection configuration
PACKET CONFIGURATION FILES
The application is data driven by means of a configuration
file which is specified on the command line when the appli-
cation is started. The following section detail the format
of the configuration files.
It should be noted that case is not significant when speci-
fying the keywords in the configuration file.
This mandatory keyword is used to specify the device to
use in order to retrieve headers from the subsystem in
question. By specifying NAOMI, the application will use
the NAOMI Electra process monitor as the source of the
header data. If the keyword EPICS is used, then the
application will use channel access in order to
retrieve the packet information.
Adding comments into the file
Comments can be added to the file in the standard way
by inserting a "#" character at the start of the line
The PacketDirectory keyword will be used to instruct
the application into which directory it should write
the packet files. The keyword accepts a single argument
which is an absolute directory name.
Time> <FITS Comment>
(Packet|FixedPacket) <Name> <Source> <Data Type> <Collection
The Packet or the FixedPacket keyword will be used to
declare a packet to be collected by the application.
There may be one or more of these declarations found
within the configuration file. The keywords accepts a
number of arguments, all of them mandatory.
The Packet Name argument will be used to specify the
name of the packet. This should be given in uppercase
in accordance with FITS conventions.
The Packet Source argument will be used to specify the
name of the source of the packet. In the case of col-
lection via an EPICS based system, this will be the
name of a process variable. In the case of collection
from NAOMI, it will be the name of a variable found in
the Electra process monitor. If the Fixed Packet key-
word was declared at the start of the line, the value
of the this argument is considered to be the actual
packet value rather than a reference to a data source
inside NAOMI or EPICS.
The FITS Data Type argument will be used to determine
the type of packet. The packet data will be formatted
and written into the packet file in accordance with the
FITS standard for the data type specified here. The
FITS Data Type can be one of the following;
I indicates that the data type for the packet will be
an integer and will be formatted in the packet file in
accordance with the FITS conventions for writing
R indicates that the data type for the packet will be a
real integer and will be formatted in the packet file
in accordance with the FITS conventions for writing
C indicates that the data type for the packet will be a
character string and will be formatted in the packet
file in accordance with the FITS conventions for writ-
L indicates that the data type for the packet will be a
logical string and will be formatted in the packet file
in accordance with the FITS conventions for writing
The collection time argument will be used to specify at
which point throughout the run that the packet should
be collected. It can be set to either write or update.
write indicates that the packet will be collected when
a ARCHIVE_B action is requested. update indicates that
the packet should be collected when requested to per-
form a ARCHIVE_E.
The FITS Comment field is used to specify the comment
associated with the packet. It should be enclosed in
quotes and be less then 80 characters long. If the com-
ment is longer than the 80 characters permitted it will
The application will report all of it's errors to stdout if
there is a controlling terminal. All errors will be written
to the syslog.
The script returns the following codes after execution.
0 - Program completed with no error
The application terminated without any error.
1 - Subsystem has not been specified
The user has not specified the command line option
-subsystem when starting the application.
2 - A valid packet file name not been specified
The user has not specified a packet file name using the
command line option -packetfilename when starting the
3 - Unable to read the packet description file
The packet description file that has been specified
could not be read. This may be that the file does not
exist or the current user does not have adequate
priveledges to read it.
4 - Unable to load DRAMA
This indicates that when the application attempted to
load DRAMA, it failed.
Craige Bevil (email@example.com)
Man(1) output converted with