Spice_icon SPICE
Spectrometer Instrument Control Environment


How to create a custom scan:

This guide is intended to describe the use of the scanon/scanoff structure in SPICE to produce a custom scan.  The basic idea behind this structure is that it allows any combination of drives and counts (and other commands if required) to be converted into a custom scan.  The best way to explain this structure is by first describing the commands which are present and then using an example.


Commands:

scanon:  This command initiates the structure.  It turns on a variable which prevents the normal output of commands, stores any errors that occur in subsequent commands, and records the returned values of any counts that occur.

stepend:  This command signifies the end of a step in the scan.  Any counts that have accumulated during the step are then output to the logfile and datafile and any errors that occured are printed in the logfile on a separate line (with the standard comment delimiter (#) in front of the messages.

stepbegin:  This command is not required for operation of the scanon/scanoff structure but is included for flexibility.  The execution of this command determines the point at which the motor positions will be stored for a step.  For instance, if a drive to a specific h,k,l point occured in a step which was then followed by a drive of some motor, the user would probably want to record motor positions after the h,k,l drive and not after the subsequent motor drive.  The use of the stepbegin command after the drive would allow the positions to be recorded at this point.

scanoff:  This command ends the scan and turns off the scanon variable so that normal command execution is restored.

NOTE: if a scanon/scanoff generated scan is stopped before execution of the scanoff command, the program still believes that the scanon structure is activated and will NOT resume normal operation until a scanoff command is issured.

Examples:

The easiest way to understand the use of this structure is through a series of examples.

Example #1:

This example is not particularly useful but explains the basic funtionality of the structure.