Download LUCID User's Guide - Experimental Subatomic Physics

Transcript
LUCID
The Reader
will cause the READER to print a message on the user’s terminal,
in the form
Enter angle:
The READER will then stop and wait for the user to enter a value
that is consistent with the definition of angle. We are assuming
that “angle” is defined as a true variable, and not a CAMAC variable or an array. When prompting for input, the READER simply
prints the word Enter, followed by the name of the variable. If
you would like to give the operator more information about
what’s expected for input, you can specify a message in the read
statement, after the variable name. For example, the statement:
read angle “the spectrometer angle, 20-60 degrees”
would display
Enter angle (the spectrometer angle, 20-60 degrees):
to the operator.
Reading Array Data
If the variable is actually an array element, then the default
prompt would indicate that fact to the user. For instance, the
statement
read adjust[0]
would cause the READER to prompt with
Enter adjust[0]:
If the name of an array is given without a subscript, the READER
will prompt for each element’s value in turn, until each one has
been read.
Enter adjust[0]:
Enter adjust[1]:
Enter adjust[2]:
•
•
•
Although LUCID allows you to enter certain values interactively
as your experiment proceeds, this isn’t always convenient if
you’re not sure when they will happen, or if an inexperienced
colleague is filling in for you. LUCID offers two flexible options
for reading values into variables.
Reading from a File
The first option allows you to read values from a file. The statement:
read adjust from “/home/wright/adjustments”
The EVENT Section Reading Data
Making a Reader Description File
3-15