EPICS Logger

This page was created by the IDL library routine mk_html_help. For more information on this routine, refer to the IDL Online Help Navigator or type:

     ? mk_html_help

at the IDL command line prompt.

Last modified: Sun Jul 11 00:54:42 1999.


List of Routines


Routine Descriptions

EPICS_LOGGER

[Next Routine] [List of Routines]
 NAME:
   EPICS_LOGGER

 PURPOSE:
   This procedure logs EPICS process variables to a GUI window and to a
   disk file.

 CATEGORY:
   EPICS data acquisition.

 CALLING SEQUENCE:
   EPICS_LOGGER

 INPUTS:
       None.

 KEYWORD PARAMETERS:
   INPUT_FILE:
       The name of an input file containing the list of EPICS process
       variables (PV) to be logged.  The format of this file is one line per
       PV.  Each line has the following format:

           PVName | PVFormat | Description | DescriptionFormat

       "PVName" is the name of the EPICS PV.

       "PVFormat" is the format with which the PV should be displayed on the
       screen and written to the disk file, e.g. F10.3 or E12.4.

       "Description" is a string which describes this PV. It is displayed at
       the top of the screen.  Any character except "|" can be used in this 
       field, including white space.

       "DescriptionFormat" is the format with which the description string
       should be displayed on the screen and in the disk file, e.g. A15.
       This format should specify the same field width (e.g. 15 characters) as
       the PVformat for this PV to make things line up properly on the screen.

       If INPUT_FILE is not present then the input file can be selected later
       from the "File" menu in the procedure.

   OUTPUT_FILE:
       The name of the output file to which the logging data will be written.
       If OUTPUT_FILE is not present then the output file can be selected later
       from the "File" menu in the procedure.

       The output is an ASCII file with 3 types of lines in it.  Lines
       beginning with "PVS:" list the process variables which follow in the
       file. Lines beginning with "DESCRIPTION:" list the descriptions of the
       PVs.  Finally, lines beginning with "DATA:" list the date and time, and
       then the values of all of the PVs.  Each value on a line is separated
       from the next by a vertical bar ("|").
       The following is an example of the first few lines from an output file:
          PVS:|Date and time|13BMD:DMM1Ch1_calc.VAL|13BMD:DMM1Ch3_calc.VAL
          DESCRIPTION:|Date and time|Load, Tons|Ram Ht, mm
          DATA:|10-Jul-1999 09:35:44|91.42843|8.244
          DATA:|10-Jul-1999 09:35:45|91.42777|8.244
          DATA:|10-Jul-1999 09:35:46|91.42398|8.244
          DATA:|10-Jul-1999 09:35:47|91.38756|8.244
       These data files can be read into IDL with the function READ_EPICS_LOG.
       They can easily be read into spreadsheets such as Excel, by specifying
       that the input is "Delimited" with a delimiter character of "|".
       The date format in the file is recognized by Excel as a valid data/time
       field.

   TIME:
       The time interval for logging, in floating point seconds.  The default
       is 10 seconds.

   FONT:
       The font to be used for the descriptions and the logging output.  The
       default is the font returned from GET_FONT_NAME(/COURIER, /LARGE)

   XSIZE:
       The width of the text output window in pixels.  The default is 600.
       The window can be resized with the mouse when the program is running.

   YSIZE:
       The height of the text output window in pixels.  The default is 300.
       The window can be resized with the mouse when the program is running.

   MAX_LINES
       The maximum number of lines which the text window will retain for
       vertical scrolling.  The default is 1000.

   MAX_PVS
       The maximum number of process variables in an input file.
       The default is 100.

   START:
       Set this flag to start logging immediately when the procedure begins.
       By default the user must press the "Start" button to begin logging.

 OUTPUTS:
   None.

 SIDE EFFECTS:
   This procedure places EPICS monitors on all of the PVs for efficiency.
   It writes a disk file of logging results.

 RESTRICTIONS:
   Placing monitors on all PVs is not efficient when the PVs change
   rapidly and the logging period is long.
   This procedure does not gracefully handle the case when PVs cannot be
   accessed, such as when a crate is rebooted.

 EXAMPLE:
   EPICS_LOGGER, input_file='xrf_pvs.inp', output_file='xrf_pvs.log', time=2

 MODIFICATION HISTORY:
       Written by:     Mark Rivers, July 10, 1999.

(See epics_logger.pro)


READ_EPICS_LOG

[Previous Routine] [List of Routines]
 NAME:
   READ_EPICS_LOG

 PURPOSE:
   This function reads an EPICS log file into an IDL structure.

 CATEGORY:
   EPICS data acquisition.

 CALLING SEQUENCE:
   Result = READ_EPICS_LOG(Filename)

 INPUTS:
   Filename:
       The name of the EPICS log file to read.  These files are created
       with EPICS_LOGGER.  If the filename is not specified then the
       user will be presented with a file selection dialog box.

 OUTPUTS:
   This function returns a structure of the following type:
      { file:
        pvs:
        description:
        data:
        time_string:
        julian_time:
        num_pvs:
        num_points:
    }
   These fields are defined as follows:
       .file is a string containing the name of the input log file
       .num_pvs is the number of EPICS process variables in the file
       .pvs[num_pvs] is a string array containing the names of the EPICS
           process variables.
       .description[num_pvs] is a string array containing the descriptions of
           the process variables which were contained in the input file for
           EPICS_LOGGER.
       .num_points is the number of data points in the file.
       .data[num_pvs, num_points] is a double precision array containing the
           data for each PV at each time point.
       .time_string[num_points] is a string containing the date and time when
           each data point was collected.
       .julian_time[num_points] is a double precision array containing the
           Julian time when each data point was collected.  This is useful for
           plotting.  The units of julian_time are days since some day in
           about 4000BC.

 RESTRICTIONS:
   This function assumes that all of the PVs in the log file are numbers, it
   will not work if any of them are non-numeric strings.

 EXAMPLE:
   result = READ_EPICS_LOG('xrf_pvs.log')
   plot, result.data[0,*]

 MODIFICATION HISTORY:
   Written by:     Mark Rivers, July 9, 1999

(See read_epics_log.pro)