2.4.8.2. - Counting
mcount(counts)
-
Starts the timer/clock
counting for
counts
monitor counts. Returns zero. tcount(t)
-
Starts the timer/clock
counting for
t
seconds, wheret
may be nonintegral. Returns zero. getcounts
-
Loads the built-in array
S[]
with the contents of the scalers. cnt_mne(counter)
-
Returns the string mnemonic of counter number
counter
as given in the configuration file. (Mnemonics are, at most, 7 characters long.) Resets to command level if not configured forcounter
. cnt_name(counter)
-
Returns the string name of counter number
counter
as given in the configuration file. (Names are, at most, 15 characters long.) Returns"?"
if not configured forcounter
. cnt_num(mne)
-
Returns the counter number corresponding to the counter mnemonic
mne
, or -1 if there is no such counter configured. As of spec release 6.05.01,mne
can be a variable or an expression. Ifmne
is an uninitialized variable, -1 is returned. counter_par(counter, par [, val ])
-
Returns or sets parameters associated with counter number
counter
as given in the configuration file. The followingpar
arguments are supported for all counters:"unit"
- returns the unit number of the indicated counter.
"channel"
- returns the channel number of the indicated counter.
"scale"
- returns the value of the scale factor set in the
config
file for the indicated counter.
"responsive"
- returns nonzero if the hardware appears to be working for the indicated
counter.
"controller"
- returns a string that indicates the controller type of the indicated
counter.
"disable"
- returns a nonzero value if the counter has been disabled by software.
If
val
is given and is nonzero, then the counter is disabled. Ifval
is given and is zero, the counter becomes no longer disabled. A disabled counter channel will not be accessed by any of spec's counting commands. Anycdef()
-defined macros will automatically exclude the portions of the macro keyed to the particular counter when the counter is software disabled.
In addition, device-dependent values forpar
are available for specific counter models. See the Hardware Reference for values for specific controllers.
The counting functions
mcount()
and
tcount()
both program the timer/clock
for a specified count time.
Before the count period begins,
both functions clear and enable
all configured scalers and MCAs.
The routines return immediately, as counting is asynchronous.
Use
wait()
,
described below, to determine if counting has been completed.
A
^C
will halt the timer/clock.
When the count time has expired, or counting is aborted by a
^C
,
the scalers and MCAs
are disabled.
Normally, enable signals from the timer/clock
are used to directly gate the scalers or MCAs.
Software gating takes place whether or not hardware
gating is in place and can be used in lieu of hardware gating,
although the interval over which the gating occurs will not be
as precisely controlled.