EPICS_MCA Class

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: Thu Apr 18 11:52:38 2013.


List of Routines


Routine Descriptions

EPICS_MCA::ACQUIRE_OFF

[Next Routine] [List of Routines]
 NAME:
       EPICS_MCA::ACQUIRE_OFF

 PURPOSE:
       This procedures turns off acquisition of the MCA.

 CATEGORY:
       EPICS device class library.

 CALLING SEQUENCE:

       epics_mca->ACQUIRE_OFF

 INPUTS:
       None

 OUTPUTS:
       None

 EXAMPLE:
       mca = obj_new('EPICS_MCA', '13IDC:mca1')
       mca->ACQUIRE_OFF

 MODIFICATION HISTORY:
       Written by:     Mark Rivers, October 1, 1997
       19-Sep-1998 MLR  Added /WAIT since that is now longer default
       17-Mar-1999 MLR  Removed /WAIT from caput, to be compatible with
                        version 4.3 and later of the MCA record, which does
                        not fire forward links until acquisition is complete.

(See epics_mca__define.pro)


EPICS_MCA::ACQUIRE_ON

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       EPICS_MCA::ACQUIRE_ON

 PURPOSE:
       This procedures turns on acquisition of the MCA.

 CATEGORY:
       EPICS device class library.

 CALLING SEQUENCE:

       epics_mca->ACQUIRE_ON

 INPUTS:
       None

 OUTPUTS:
       None

 EXAMPLE:
       mca = obj_new('EPICS_MCA', '13IDC:mca1')
       mca->ACQUIRE_ON

 MODIFICATION HISTORY:
       Written by:     Mark Rivers, October 1, 1997
       May 5, 1998:    Mark Rivers, removed setting the acquisition start time
                       here, since the record now does that.
       19-Sep-1998 MLR  Added /WAIT since that is now longer default
       17-Mar-1999 MLR  Removed /WAIT from caput, to be compatible with
                        version 4.3 and later of the MCA record, which does
                        not fire forward links until acquisition is complete.

(See epics_mca__define.pro)


EPICS_MCA::ACQUIRE_WAIT

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       EPICS_MCA::ACQUIRE_WAIT

 PURPOSE:
       This procedures waits for acquisition of the MCA to complete.

 CATEGORY:
       EPICS device class library.

 CALLING SEQUENCE:

       epics_mca->ACQUIRE_WAIT, Time

 OPTIONAL INPUTS:
       Time:  The estimated acquisition time of the MCA.

 KEYWORD_PARAMETERS:
       START:
           Set this flag to wait for acquisition to start.
       STOP:
           Set this flag to wait for acquisition to stop.  This is the default.

       If both the START and STOP keywords are given then the routine will wait
       first for acquisition to start and then for acquistion to stop.  If only
       /START is given then it will not wait for acquisition to stop.
       

 OUTPUTS:
       None

 PROCEDURE:
       This routine simply polls to see if acquisition is complete using
       EPICS_MCA::GET_ACQUIRE_STATUS(). If the optional Time input is
       specified then the time between polling is Time/10.  The default and
       minimum time between polling is one second.

 EXAMPLE:
       mca = obj_new('EPICS_MCA', '13IDC:mca1')
       mca->ACQUIRE_ON

 MODIFICATION HISTORY:
       Written by:     Mark Rivers, October 1, 1997
       MLR 18-APR-2001 Added START and STOP keywords

(See epics_mca__define.pro)


EPICS_MCA::ADD_ROI

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       EPICS_MCA::ADD_ROI

 PURPOSE:
       This function adds a new region-of-interest to the MCA.

 CATEGORY:
       EPICS device class library.

 CALLING SEQUENCE:

       epics_mca->ADD_ROI, roi

 PROCEDURE:
       This function invokes MCA::ADD_ROI and then calls EPICS_MCA::SET_ROIS
       to write the new region-of-interest to the hardware the EPICS MCA
       record.

 ADDITIONAL INFORMATION:
       See MCA::ADD_ROI.

 MODIFICATION HISTORY:
       Written by:     Mark Rivers, October 1, 1997
       23-Mar-1998     Mark Rivers.  Changed input parameter to a structure
                       of type MCA_ROI from left, right, label, bgd_width

(See epics_mca__define.pro)


EPICS_MCA::DEL_ROI

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       EPICS_MCA::DEL_ROI

 PURPOSE:
       This function deletes a region-of-interest from the MCA.

 CATEGORY:
       EPICS device class library.

 CALLING SEQUENCE:

       epics_mca->DEL_ROI, Index

 PROCEDURE:
       This function invokes MCA::DEL_ROI and then calls EPICS_MCA::SET_ROIS
       to write the new region-of-interest to the hardware the EPICS MCA
       record.

 ADDITIONAL INFORMATION:
       See MCA::DEL_ROI.

 MODIFICATION HISTORY:
       Written by:     Mark Rivers, October 1, 1997
       23-Mar-1998     Mark Rivers.  Modified input parameters to ROI index
                       from left, right.

(See epics_mca__define.pro)


EPICS_MCA::ERASE

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       EPICS_MCA::ERASE

 PURPOSE:
       This procedures erases the MCA data, i.e. sets all channels to zero.

 CATEGORY:
       EPICS device class library.

 CALLING SEQUENCE:

       epics_mca->ERASE

 INPUTS:
       None

 OUTPUTS:
       None

 PROCEDURE:
       This procedure erases the MCA by sending the appropriate command
       to the EPICS MCA record.

 EXAMPLE:
       mca = obj_new('EPICS_MCA', '13IDC:mca1')
       mca->ERASE

 MODIFICATION HISTORY:
       Written by:     Mark Rivers, October 1, 1997
       May 5, 1998:    Mark Rivers, removed setting the acquisition start time
                       here, since the record now does that.
       19-Sep-1998 MLR  Added /WAIT since that is now longer default
       17-Mar-1999 MLR  Removed /WAIT from caput, to be compatible with
                        version 4.3 and later of the MCA record, which does
                        not fire forward links until acquisition is complete.

(See epics_mca__define.pro)


EPICS_MCA::GET_ACQUIRE_STATUS

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       EPICS_MCA::GET_ACQUIRE_STATUS

 PURPOSE:
       This function returns the acquisition status for the MCA.
       This is 1 if the MCA is acquiring and 0 if it is not acquiring.

 CATEGORY:
       EPICS device class library.

 CALLING SEQUENCE:
       Result = epics_mca->GET_ACQUIRE_STATUS()

 KEYWORD PARAMETERS:
   UPDATE:
       Set this keyword to force the routine to process the record.
       By default this routine does NOT process the record.  The
       acquire status returned will be the status when the record
       was last processed.
   CHECK_NEW:
       A flag which indicates that this routine should only return
       the acquire status if it has changed.

 OPTIONAL OUTPUTS:
   NEW_FLAG:
       If CHECK_FLAG is set, then NEW_FLAG will be 1 if the function
       is returning new acquire status, 0 if the function is not
       returning new acquire status. If CHECK_FLAG is set and
       NEW_FLAG is 0 then the function returns -1.

 PROCEDURE:
       This function reads the acquisition status from the hardware using
       the EPICS MCA record, and then invokes MCA::GET_ACQUIRE_STATUS

 ADDITIONAL INFORMATION:
       See MCA::GET_ACQUIRE_STATUS().

 RESTRICTIONS:
       This routine does NOT force the record to process by default.
       The status will not update unless the record is processed.  This can
       be done by setting the UPDATE keyword.
 MODIFICATION HISTORY:
       Written by:     Mark Rivers, October 1, 1997
       Nov. 14, 1997   Mark Rivers added UPDATE keyword, changed routine to not
                       process record by default.
       19-Sep-1998 MLR  Added /WAIT since that is now longer default
       17-Mar-1999 MLR  Removed /WAIT from caput, to be compatible with
                        version 4.3 and later of the MCA record, which does
                        not fire forward links until acquisition is complete.
       15-Apr-1999 MLR Added CHECK_NEW and NEW_FLAG

(See epics_mca__define.pro)


EPICS_MCA::GET_CALIBRATION

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       EPICS_MCA::GET_CALIBRATION

 PURPOSE:
       This function returns the calibration parameters for the MCA.
       The calibration information is contained in a structure of type
       MCA_CALIBRATION.

 CATEGORY:
       EPICS device class library.

 CALLING SEQUENCE:

       Result = epics_mca->GET_CALIBRATION()

 PROCEDURE:
       This function reads the calibration information from the hardware using
       the EPICS MCA record, and then invokes MCA::GET_CALIBRATION

 ADDITIONAL INFORMATION:
       See MCA::GET_CALIBRATION().

 MODIFICATION HISTORY:
       Written by:     Mark Rivers, October 1, 1997
       19-Sep-1998 MLR  Added caStartGroup, caEndGroup for efficiency

(See epics_mca__define.pro)


EPICS_MCA::GET_DATA

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       EPICS_MCA::GET_DATA

 PURPOSE:
       This function returns the data from the MCA.

 CATEGORY:
       EPICS device class library.

 CALLING SEQUENCE:
       Result = epics_mca->GET_DATA()

 KEYWORD_PARAMETERS:
       CHECK_NEW:
           A flag which indicates that this routine should only return
           the data if it has changed.

 OPTIONAL OUTPUTS:
       NEW_FLAG:
           If CHECK_FLAG is set, then NEW_FLAG will be 1 if the function
           is returning new data, 0 if the function is not returning new
           data.  If CHECK_FLAG is set and NEW_FLAG is 0 then the function
           returns -1.
 PROCEDURE:
       This function reads the data from the hardware using the EPICS MCA
       record, and then invokes MCA::GET_DATA

 ADDITIONAL INFORMATION:
       See MCA::GET_DATA().

 MODIFICATION HISTORY:
       Written by:     Mark Rivers, October 1, 1997
       Nov. 14, 1997   Mark Rivers.  Changed routine to eliminate setting
                       rec.READ back to 0, since record support does this
                       automatically and it was causing record to process
                       again.
       19-Sep-1998 MLR  Added /WAIT to caput, since default is not to wait
                        for callback now.
       17-Mar-1999 MLR  Removed /WAIT from caput, to be compatible with
                        version 4.3 and later of the MCA record, which does
                        not fire forward links until acquisition is complete.
       28-Mar-1999 MLR  Changed routine so it no longer pokes READ field.
                        This assumes that someone else (typically a database)
                        is periodically poking the READ field.  The object
                        initialization code now sets a monitor on the VAL
                        field. Added New_flag output and CHECK_NEW keyword.

(See epics_mca__define.pro)


EPICS_MCA::GET_ELAPSED

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       EPICS_MCA::GET_ELAPSED

 PURPOSE:
       This function returns the elapsed parameters for the MCA.
       The elapsed information is contained in a structure of type
       MCA_ELAPSED.

 CATEGORY:
       EPICS device class library.

 CALLING SEQUENCE:
       Result = epics_mca->GET_ELAPSED()

 KEYWORD_PARAMETERS:
       CHECK_NEW:
           A flag which indicates that this routine should only return
           the elapsed parameters if they have changed.

 OPTIONAL OUTPUTS:
       NEW_FLAG:
           If CHECK_FLAG is set, then NEW_FLAG will be 1 if the function
           is returning new elapsed parameters, 0 if the function is not
           returning new elapsed parameters.  If CHECK_FLAG is set and
           NEW_FLAG is 0 then the function returns -1.

 PROCEDURE:
       This function reads the elapsed information from the hardware using
       the EPICS MCA record, and then invokes MCA::GET_ELAPSED

 ADDITIONAL INFORMATION:
       See MCA::GET_ELAPSED().

 MODIFICATION HISTORY:
       Written by:     Mark Rivers, October 1, 1997
       May 5, 1998:    Mark Rivers, added reading the acquisition start time
                       from the timestamp field of the record.
       19-Sep-1998 MLR Added caStartGroup, caEndGroup for efficiency
       15-APR-1999 MLR Changed from using catimestamp to reading the .STIM
                       field of the record
       16-MAY-1999 MLR Added .read_time field
       28-SEP-2001 MLR Added caStartGroup and caEndGroup

(See epics_mca__define.pro)


EPICS_MCA::GET_ENVIRONMENT

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       EPICS_MCA::GET_ENVIRONMENT

 PURPOSE:
       This function gets the environment parameters for the MCA.
       The environment information is contained in an array of structures 
       of type MCA_ENVIRONMENT.

 CATEGORY:
       IDL device class library.

 CALLING SEQUENCE:
       Result = epics_mca->GET_ENVIRONMENT()

 PROCEDURE:
       This function reads the environment information from EPICS 
       and then invokes MCA::GET_ENVIRONMENT

 KEYWORD PARAMETERS:
       This function accepts all of the keyword paramters used by 
       MCA::GET_ENVIRONMENT

 ADDITIONAL INFORMATION:
       See MCA::GET_ENVIRONMENT().

 EXAMPLE:
       mca = obj_new('EPICS_MCA', '13IDC:aim_adc1')
       env = mca->GET_ENVIRONMENT(count)
       ; Get all environment variables
       help, /structure, env[0]
       ; Get all of the sample information
       env = mca->GET_ENVIRONMENT(DESCRIPTION='Sample', count)
       for i=0, count-1 do print, env[i].name, '=', env[i].value

 MODIFICATION HISTORY:
       Written by:     Mark Rivers, Sept. 29, 2001.  Put this code here
                       and deleted from the MCA::WRITE_FILE routines.

(See epics_mca__define.pro)


EPICS_MCA::GET_PRESETS

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       EPICS_MCA::GET_PRESETS

 PURPOSE:
       This function returns the preset parameters for the MCA.
       The preset information is contained in a structure of type
       MCA_PRESETS.

 CATEGORY:
       EPICS device class library.

 CALLING SEQUENCE:

       Result = epics_mca->GET_PRESETS()

 PROCEDURE:
       This function reads the preset information from the hardware using
       the EPICS MCA record, and then invokes MCA::GET_PRESETS

 ADDITIONAL INFORMATION:
       See MCA::GET_PRESETS().

 MODIFICATION HISTORY:
       Written by:     Mark Rivers, October 1, 1997
       19-Sep-1998 MLR  Added caStartGroup, caEndGroup for efficiency

(See epics_mca__define.pro)


EPICS_MCA::GET_ROIS

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       EPICS_MCA::GET_ROIS

 PURPOSE:
       This function returns the region-of-interest information for the MCA.
       The rois information is contained in a structure of type MCA_ROIS.

 CATEGORY:
       EPICS device class library.

 CALLING SEQUENCE:

       Result = epics_mca->GET_ROIS(roi_info, /ENERGY)

 PROCEDURE:
       This function reads the region-of-interest information from the
       hardware using the EPICS MCA record, and then invokes MCA::GET_ROIS

 ADDITIONAL INFORMATION:
       See MCA::GET_ROIS().

 MODIFICATION HISTORY:
       Written by:     Mark Rivers, October 1, 1997
       19-Sep-1998 MLR  Added caStartGroup, caEndGroup for efficiency
       25-Sep-1998 MLR  Added ENERGY keyword
       28-Sep-2001 MLR  Re-wrote to use caGetArray, factor of 32 speed improvement

(See epics_mca__define.pro)


EPICS_MCA::GET_ROI_COUNTS

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       EPICS_MCA::GET_ROI_COUNTS

 PURPOSE:
       This procedures returns the net and total counts of each
       region-of-interest in the MCA.

 CATEGORY:
       EPICS device class library.

 CALLING SEQUENCE:

       epics_mca->GET_ROI_COUNTS, Total, Net

 INPUTS:
       None

 OUTPUTS:
       Total:  The total counts in each ROI.
       Net:    The net counts in each ROI.

       NOTE: These values are computed by the record itself, not by this
             routine or by the base class routine mca::get_roi_counts.
             The dimension of each array is NROIS, where NROIS
             is the number of currently defined ROIs for this MCA.  It returns
             zero for both if NROIS is zero.  Users should call
             MCA::GET_ROIS() to check the number of ROIS.

 EXAMPLE:
       mca = obj_new('EPICS_MCA', '13IDC:mca1')
       mca->GET_ROI_COUNTS, total, net
       print, 'Net counts = ', net

 MODIFICATION HISTORY:
       Written by:     Mark Rivers, October 1, 1997

(See epics_mca__define.pro)


EPICS_MCA::GET_SEQUENCE

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       EPICS_MCA::GET_SEQUENCE

 PURPOSE:
       This function returns the current sequence number MCA.  Sequences
       are used for time resolved spectroscopy, and refer to different regions
       of MCA memory for data acquistion and readout.

 CATEGORY:
       EPICS device class library.

 CALLING SEQUENCE:

       Result = epics_mca->GET_SEQUENCE()

 PROCEDURE:
       This function reads the preset information from the hardware using
       the EPICS MCA record.

 MODIFICATION HISTORY:
       Written by:     Mark Rivers, November 18, 1997

(See epics_mca__define.pro)


EPICS_MCA::INIT

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       EPICS_MCA::INIT

 PURPOSE:
       This is the initialization code which is invoked when a new object of
       type EPICS_MCA is created.  It cannot be called directly, but only
       indirectly by the IDL OBJ_NEW() function.

 CATEGORY:
       EPICS device class library.

 CALLING SEQUENCE:
       Result = OBJ_NEW('EPICS_MCA', Record_Name)

 INPUTS:
       Record_Name:  The name of the EPICS MCA record for the MCA object
                     being created.  This record name can include a field
                     name which will be stripped off.  For example,
                     '13IDC:mca1' and '13IDC:mca1.DESC' are both
                     valid.  This makes it convenient when dragging process
                     variable names from MEDM windows to IDL windows.

 KEYWORD_PARAMETERS:
       Environment_file:
           This keyword can be used to specify the name of a file which
           contains the names of EPICS process variables which should be saved
           in the header of files written with MCA::WRITE_FILE.  If this
           keyword is not specified then this function will attempt to open
           a file called 'catch1d.env' in the current directory.  This is done
           to be compatible with the data catcher program.  This is an ASCII
           with each line containing a process variable name, followed by a
           space and a description field.

 OUTPUTS:
       This function returns a status to indicate whether it was able to
       establish channel access communication with the specified EPICS MCA
       record.  This status is 1 for success, 0 for failure.  This status is
       passed back indirectly to the routine which calls OBJ_NEW().  OBJ_NEW
       will return a valid object pointer if this routine succeeds, and will
       return a NULL object pointer if this routine fails.  The user should
       test the return value of OBJ_NEW() with the IDL function OBJ_VALID().

 SIDE EFFECTS:
       The routine establishes channel access monitors on all of the fields
       in the MCA record which the methods in this class will read.  This
       greatly improves the speed and efficiency.

 RESTRICTIONS:
       This routine cannot be called directly.  It is called indirectly when
       creating a new object of class EPICS_MCA by the IDL OBJ_NEW()
       function.

 EXAMPLE:
       mca = obj_new('EPICS_MCA', '13IDC:mca1')
       if (OBJ_VALID(mca)) then print, 'It worked!'

 MODIFICATION HISTORY:
       Written by:     Mark Rivers, October 1, 1997
       MLR 18-Nov-1997  Removed CA monitor on .VAL field, because old data
                        were being read when doing things quickly.
       MLR 22-Oct-1998  Added environment_file
       MLR 28-Mar-1999  Put monitor on VAL field so get_data() can return
                        a flag indicating if there is new data.
       MLR 15-Apr-1999  Put monitor on STIM field since we now use this to get
                        acquisition start time.

(See epics_mca__define.pro)


EPICS_MCA::SET_CALIBRATION

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       EPICS_MCA::SET_CALIBRATION

 PURPOSE:
       This procedure sets the calibration parameters for the MCA.
       The calibration information is contained in a structure of type
       MCA_CALIBRATION.

 CATEGORY:
       EPICS device class library.

 CALLING SEQUENCE:

       epics_mca->SET_CALIBRATION, Calibration

 PROCEDURE:
       This function invokes MCA::SET_CALIBRATION and then writes the
       calibration information to the hardware using the EPICS MCA record.

 ADDITIONAL INFORMATION:
       See MCA::SET_CALIBRATION.

 MODIFICATION HISTORY:
       Written by:     Mark Rivers, October 1, 1997
       17-Sep-1998 MLR  Removed caStartGroup, caEndGroup, since these don't
                        work with the non-callback version of caput, which
                        we are now using (ezcaPutOldCa)

(See epics_mca__define.pro)


EPICS_MCA::SET_DATA

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       EPICS_MCA::SET_DATA

 PURPOSE:
       This procedure writes data to the MCA

 CATEGORY:
       EPICS device class library.

 CALLING SEQUENCE:
       epics_mca->SET_DATA, Data

 PROCEDURE:
       This function calls MCA::SET_DATA and then writes the data to the
       EPICS MCA record.

 ADDITIONAL INFORMATION:
       See MCA::SET_DATA().

 RESTRICTIONS:
       This procedure writes the spectral data to the EPICS MCA record.
       However the MCA record does not yet write the values to the MCA hardware
       for any supported devices.

 MODIFICATION HISTORY:
       Written by:     Mark Rivers, April 29, 2000

(See epics_mca__define.pro)


EPICS_MCA::SET_PRESETS

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
      EPICS_MCA::SET_PRESETS

 PURPOSE:
       This procedure sets the preset parameters for the MCA.
       The preset information is contained in a structure of type
       MCA_PRESETS.

 CATEGORY:
       EPICS device class library.

 CALLING SEQUENCE:

       epics_mca->SET_PRESETS, Presets

 PROCEDURE:
       This function invokes MCA::SET_PRESETS and then writes the
       preset information to the hardware using the EPICS MCA record.

 ADDITIONAL INFORMATION:
       See MCA::SET_PRESETS.

 MODIFICATION HISTORY:
       Written by:     Mark Rivers, October 1, 1997
       17-Sep-1998 MLR  Removed caStartGroup, caEndGroup, since these don't
                        work with the non-callback version of caput, which
                        we are now using (ezcaPutOldCa)

(See epics_mca__define.pro)


EPICS_MCA::SET_ROIS

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
      EPICS_MCA::SET_ROIS

 PURPOSE:
       This procedure sets the region-of-interest information for the MCA.
       The region-of-interest information is contained in an array of
       structures of type MCA_ROIS.

 CATEGORY:
       EPICS device class library.

 CALLING SEQUENCE:

       epics_mca->SET_ROIS, Rois

 PROCEDURE:
       This function invokes MCA::SET_ROIS and then writes the
       ROI information to the hardware using the EPICS MCA record.

 ADDITIONAL INFORMATION:
       See MCA::SET_ROIS.

 MODIFICATION HISTORY:
       Written by:     Mark Rivers, October 1, 1997
       17-Sep-1998 MLR  Removed caStartGroup, caEndGroup, since these don't
                        work with the non-callback version of caput, which
                        we are now using (ezcaPutOldCa)
       28-Sep-2001 MLR  Changed to using caPutArray, much faster.

(See epics_mca__define.pro)


EPICS_MCA::SET_SEQUENCE

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
      EPICS_MCA::SET_SEQUENCE

 PURPOSE:
       This procedure sets the current sequence number for the MCA.  Sequences
       are used for time resolved spectroscopy, and refer to different regions
       of MCA memory for data acquistion and readout.

 CATEGORY:
       EPICS device class library.

 CALLING SEQUENCE:

       epics_mca->SET_SEQUENCE, Sequence

 PROCEDURE:
       This function invokes writes the sequence number to the hardware
       using the EPICS MCA record.

 MODIFICATION HISTORY:
       Written by:     Mark Rivers, November 18, 1997

(See epics_mca__define.pro)


EPICS_MCA::SPECTRA_SCAN

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       EPICS_MCA::SPECTRA_SCAN

 PURPOSE:
       This procedures collects MCA spectra in conjunction with an EPICS
       scan record.

 CATEGORY:
       EPICS device class library.

 CALLING SEQUENCE:
       epics_mca->SPECTRA_SCAN, First_file, Scan_record

 INPUTS:
       First_file:  
           The name of the first spectrum file to save.  Subsequent files 
           will be named using the INCREMENT_FILENAME()function.  The 
           filename must end in a numeric extension for this to work.

       Scan_record:
           The name of the EPIC scan record which is controlling the scan.
           This scan record must start MCA data collection by writing "1" 
           into the EraseStart record of the MCA database.
       
 EXAMPLE:
       mca = obj_new('EPICS_MCA', '13IDC:mca1')
       mca->SPECTRA_SCAN, 'test.001', '13IDC:scan1'

 PROCEDURE:
       1) Set scan.EnableWait to 1 so scan will wait for IDL client
       2) Wait for scan.EXSC = 1, meaning scan has started
       3) If scan.EXSC is still 0 (scan ended or aborted) disable EnableWait
          and return
       4) Read scan.ClientWait, if 0 (meaning acquisition has not started) go
          to 3
       5) Wait for MCA aquisition to start and then stop
       6) Write data to disk with MCA::WRITE_FILE, increment file name
       7) Reset ClientWait to 0 so scan will continue
       8) Go to 3

 MODIFICATION HISTORY:
       Written by:     Mark Rivers, April 18, 2001.  Copied from MED__DEFINE.

(See epics_mca__define.pro)


EPICS_MCA::WRITE_FILE

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       EPICS_MCA::WRITE_FILE

 PURPOSE:
       This procedure writes an EPIC_MCA object to a disk file.

 CATEGORY:
       EPICS device class library.

 CALLING SEQUENCE:

       epics_mca->WRITE_FILE, file

 PROCEDURE:
       This function reads all information from the hardware using the EPICS
       MCA record, and then invokes MCA::WRITE_FILE

 ADDITIONAL INFORMATION:
       See MCA::WRITE_FILE.

 MODIFICATION HISTORY:
       Written by:     Mark Rivers, January 17, 1998
       MLR 29-SEP-2001 Removed calls to read elapsed, calibration, rois, and
                       data, since this is done in MCA::WRITE_FILE.

(See epics_mca__define.pro)


EPICS_MCA__DEFINE

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       EPICS_MCA__DEFINE

 PURPOSE:
       This is the definition code which is invoked when a new object of
       type EPICS_MCA is created.  It cannot be called directly, but only
       indirectly by the IDL OBJ_NEW() function,

 CATEGORY:
       EPICS device class library.

 CALLING SEQUENCE:
       Result = OBJ_NEW('EPICS_MCA', Record_Name)

 INPUTS:
       Record_Name:  The name of the EPICS MCA record for the MCA object
                     being created.  This record name can include a field
                     name which will be stripped off.  For example,
                     '13IDC:mca1' and '13IDC:mca1.DESC' are both
                     valid.  This makes it convenient when dragging process
                     variable names from MEDM windows to IDL windows.  This
                     name is passed to EPICS_MCA::INIT().

 OUTPUTS:
       None (but see EPICS_MCA::INIT)

 RESTRICTIONS:
       This routine cannot be called directly.  It is called indirectly when
       creating a new object of class EPICS_MCA by the IDL OBJ_NEW()
       function.

 EXAMPLE:
       mca = obj_new('EPICS_MCA', '13IDC:mca1')
       if (OBJ_VALID(mca)) then print, 'It worked!'


 MODIFICATION HISTORY:
       Written by:     Mark Rivers, October 1, 1997

(See epics_mca__define.pro)


RELEASE NOTES

[Previous Routine] [List of Routines]
 NAME:
 Release notes
   Version 3:
       Everything prior to 3/17/99 when I started making release notes!
       Prior to this date there are release notes for each routine but no
       global release notes for the EPICS_MCA class, and there are no
       version numbers
   Version 4.0
       March 17, 1999.  Mark Rivers.
           Removed the /WAIT qualifier from all CAPUT calls to make the class
           compatible with Version 4.3 of the EPICS MCA record.
           Added monitors to all PVs, including .VAL field
           Changed logic of getting acquisition start time from using
           catimestamp (Ben-Chin's routine) to using the new .STIM field in
           the record.  This requires version 4.6 or greater of the record.
       April 15, 1999. Mark Rivers
           Added CHECK_NEW and NEW_FLAG to GET_ELAPSED, GET_DATA and
           GET_ACQUIRE_STATUS.
  Version 4.1
       May 16, 1999  Mark Rivers
           Added .read_time field to MCA_ELAPSED and put a monitor on it for
           accurate counts/second calculations
  Version 4.2
       Dec. 1, 1999 Mark Rivers
           Fixed bug in epics_mca::init when reading environment file.
       Dec. 2, 1999 Mark Rivers
           Added .dwell, .channel_advance and .prescale to MCA_PRESETS
       Dec. 3, 1999 Mark Rivers
           Changed GET_DATA to read .NUSE each time, adjust self.nchans.
           This permits NUSE to be changed after the EPICS_MCA is created.
           Modified WRITE_FILE to reset ClientWait after file is written.
       April 18, 2001 Mark Rivers
           Added MCA::SPECTRA_SCAN to collect spectra using the "ClientWait"
           PV.  This already existed in EPICS_MED, added to EPICS_MCA.
           Added the /START and /STOP keywords to EPICS_MCA::ACQUIRE_WAIT
       Sept. 28, 2001 Mark Rivers
           Changed GET_ROIS to use caGetArray and SET_ROIS to use caPutArray.
           This speeded up GET_ROIS by a factor of 32 and SET_ROIS by a factor
           of 32 the first time, not much on subsequent calls.
       Sept. 29, 2001 Mark Rivers
           Added GET_ENVIRONMENT.  This code used to be in MCA::WRITE_FILE
           where it did not belong.
           Deleted calls to read the data, rois, etc. in EPICS_MCA::
           WRITE_FILE, since this was done again in MCA::WRITE_FILE.
           Changed many calls from caGet to caGetArray.  This eliminates the
           need for caSetMonitor which was slowing things down at startup.
       March 5, 2002 Mark Rivers
           Changed acquire_wait to poll every dwell_time/100. from dwell_time/10.
           to reduce latencies

(See epics_mca__define.pro)