DAQ
Data Acquisition System
PC Data Acquisition Commands
Quick Reference List:
12 Input Router
Setup
OU
Channel Devices
1.Inputs
1-12 Channel
Address 1
2.
OR
Output
Channel
Address 2
3.
Strobe
Output
Channel
Address 3
4.
General
Setup
Channel
Address 4
Channel
Address 5
Data
Format
Channel
Address 11
Histogram
Files
Event
Files
COMMANDS
add
<source> <dest>
eg.
add file1 file2
Adds
data array <source> to data
array <dest> channel by channel.

cleartime
Sets
the expired acquire time to
zero. Must be in stop.
clear
<name> [<value>]
eg.
clear data1 10
Clears
the array 'name' to zero unless the
optional value is specified.
Note: clear * clears
all data files
dcopy
<source> <dest> [start
<start channel>] [stop <stop
channel>]
eg.
dcopy file1 file2 start 200 stop 300
Copies data array source to array
dest. Optional start and stop channels
may
be specified with keywords 'start' and
'stop' and must be followed by the
appropriate channel numbers.
define
<arrayname> <length> [type
<type>] [clear <initial
value>]
[prescale
<prescale value>]
Creates
a named array in memory.
arrayname:
the name of the array,
1-16 characters
length:
the
number of channels
type:
the array type
Defined
types are:
0
= linear (default)
1 = 64 by 64 two
parameter
5 = rump
6 = linear histogram
cleared and saved at evsave
7 = linear histogram
saved at evsave
9 = event mode
auto_clear but no auto_saved. An
automatic STOP, call to
evuser.c,
clear all array type 9, then
automatic ANALYZE is issued.
10 = event mode auto_clear and
auto_saved
999=event mode auto_clear and
auto_saved
Array
types and prescale may be re-defined
if the length of the array is the same
as originally defined
Types
10 - 255 are auto_saved as
.\data\evt(disk)\arrayname.(type)
where (disk) is the
current disk number and (type) is the
current type number. After the
save, the type
number is incremented. Before each
auto_save an automatic STOP is issued
then the
optional user function evuser.c is
called to process the event_mode data.
All defined
arrays of type 10 or above are saved
and cleared then an automatic ANALYZE
is
re-issued.
Clear may be specified to preset all
channels of the array to initial
value.
eg.
define psd 4096 type 1 clear 10
delete <name>
eg.
delete data1
Deletes
the definition of array 'name' and
returns the memory to the memory pool.

disk
[number]
Disk
with no number parameter displays the
current system default disk number.
If
number is specified, the system
default disk is set to number. The
disk number is
used by the get
and save
commands.
drename <original name> <new
name>
eg.
drename file1 file2
Renames
data array <original name> to
data array <new name>.
gate
[number] [lower] [upper]
where:
[number]
is the gate number (0-150). If number
is not specified all defined
gates
are specified. If [number] is
specified but no other parameters are
specified the current values for gate
[number] are displayed.
[lower]
is the lower channel number for gate
[number].
[upper]
is the upper channel number for gate
[number].
The
use of the gates is dependent in the interrupt.c,evuser.c, daquser.c, and
replay.c
functions. The standard DAQ
function replay.c checks the gates and
histograms
[dest vector] at channel [sourc
vector] if replaying [gate vector] and
data [gate vector]
is between [lower] and [upper]
(normalized to the histogram array
specified in the
replay command).
See help on replay
for more information.
get
<name> [disk ####] [tag ####]
[incr ####] [replace] [evfname.typ]
Gets a
data array from disk. The file is
retrieved using the path:
./data/dsk####/tag####.dat
or if
the event file evfname.typ is
specified:
./data/evt####/evfname.type
(where #### is DISK number)
That
is, the current directory's DATA.DIR
directory will contain one or more
dsk####.dsk or evt#### directories,
each containing data files named
tag####.dat
or event files. The disk and tag
numbers are taken from the global
values set by the
'disk' and 'tag'
commands. The default disk
and tag numbers may be overridden by
using the 'disk####' and
'tag####' options.
It is
important to remember the TAG NUMBER
IS INCREMENTED BY ONE
AFTER THE DATA IS RETRIEVED, unless
the disk, tag number, evfname.typ
option or 'incr ####' is used. If
the disk or tag number is specified,
the global tag
number is NOT changed
UNLESS 'incr ####' is also used.
If the 'incr ####' option is
used, the tag number will be
incremented by #### after the data is
retrieved in all
circumstances.
The
option replace will replace an
existing file in memory with the new
data if the size of the existing file
is the same an the file being
requested.
help
Provides
online help.
integrate
array start stop
integrate
channels start to stop of array and
return the sum in &return1
learn
(commands terminated by #)
Learn
assigns commands entered to a single
character string assignment.
The command string is terminated
with a # character.
Examples:
learn
"clr"
clear
data1 123
clear
data2 456#
learn
"ddir"
"ls
-l ./data"#
learn
"sav"
save
data1
save
data2#
loadint
NAME_OF_INTERRUPT_SERVICE_ROUTINE
Command to select the desired interrupt
service routine to use for this
experiment.
The names of the available interrupt
service routines compiled into this
version of DAQ
can be displayed by typing loadint with
no parameter.
example:
loadint npcoinc2
overlay histogram | vector
Overlay the currently active plot with
another histogram of the same length.
The original plot is in black and
the overlay plot is in color. Only
one additional
histogram can be overlaid.
If a subsequent overlay command is
issued, only
the new overlay spectrum will be
overlaid. Plot data (sum, cursor
counts etc.)
are for the original spectrum
that was plotted.
16. plot
(windows
version) Back
to List
1.plot
help menu
2.using
a mouse in the help menu
plot
<name> [start <start
channel>] [stop <stop
channel>]
[overlay
| over | ov <name2>]
Displays
array 'name'.
If
keyword 'start' is found, it must be
followed by the start channel.
If keyword 'stop' is found, it must be
followed by the stop channel.
If keyword 'overlay' or 'over' or 'ov'
is found, it must be followed by array
'name2'.
Overlay,
over or ov plots a specturm on top of
another spectrum in a different color.
While plotting a spectrum, a help menu
is displayed when the '?' key is
depressed.
Help
Menu ( '?'
) * Back
to plot
F5
displays
a single parameter
F6
displays
2 parameters ( 3-dimension
projection )
F7
displays
2 parameters ( color contor )
left, right, up &
down arrow keys
move cursor
control + arrow key moves cursor
slowly
z
zoom
control +
z zooms
slowly
shift + z
unzoom
,
pan
left
<
slow
pan left
. pan
right
>
slow
pan right
End
autoscale
Page
Up sets
start channel to cursur channel
Page Down
sets
stop channel to cursor channel
a begin
accepting data
s
stop
accepting data
1, 2, 3, 4
displays
the first, second, third or fourth
quarter of display
(For Example: If you divide the
screen into four equal sections
and the part you wish to examine is in
the third quarter press '3'.)
Home displays
the entire spectrum
+ multiplies
the Y scale by 2
-
divides
the Y scale by 2
l
linear
display
shift +
l
log
display ( 100.0
log10 (counts) )
c
clear
DISPLAYED spectrum to 0
d set
color dot size for color contour plot
g displays
no grid
shift +
g
displays
grid
p changes
3D perspective
m dispalys
mean and standard deviation (with
fit option)
t change
preset acquire time (0 = infinite)
alt +
c enter
calibration data
alt +
f linear
fit
shift +
r begins
new fit
Enter continue
~ simulate
runfor complete (set oual_terminate =
1)
control + x, alt + x, or esc
exits
plot
control + F1, F2, F3, F4, F9,
F10 saves
plot in F1, F2, F3, F4, F9, F10
F1, F2, F3, F4, F9,
F10 restores
saved region
Using a
Mouse in the Help
Menu * Back
to plot
* move the mouse to
display the cursor
* move the cursor near the double
lines at the top of the screen to
display the menu
* the menu contains the following
commands:
Exit, Fit, Zoom,
Pan, Cursor, Cnts, Auto, Grid, Home
* For the following: L -denotes
left mouse button, and R
-denotes right mouse button
* To use the below, place cursor
on the command and click L or R button
Exit L
- exit
Fit L
- refresh screen
Zoom L
- expands screen, R - contracts screen
Pan L
- pans left, R - pans right
Cursor L
- turns off cursor
Cnts
L - full scale reduced, R - full scale
increased
Auto L
- autoscale
Grid L
- toggles between grid on and off
Home L
- home, R - help

16. plot
(linux
version)
* Back
to plot
plot <name | vector>
[start <start channel>]
[stop <stop channel>]
[overlay
| over <name2>]
[loops <# plot refreshes then
exit>]
[geometry <X-window geometry>]
[ex1
| ex2 | ex3 | ex4 <program name (no
extension) to execute when pressed>]
Displays array 'name' in an new window
created for the plot.
If keyword 'start' is found, it must be
followed by the start channel.
If keyword 'stop' is found, it must be
followed by the stop channel.
If keyword 'overlay' or 'over' is found,
it must be followed by array 'name2'.
overlay or over plots a specturm on top
of another spectrum in a different
color.
If keyword 'loops' is found, it must be
followed by the number of refresh loops
to plot before exiting.
If
keyword 'geometry' is found, it must be
followed by the X windows window
geometry specification.
If
keyword 'ex[1-4]' is found, it must be
followed by the command to execute if
the button is pushed.
example: plot tof ex1 clr
would define the button ex1 to execute
clr when pushed.
The plot window displays in real-time the
histogram for array 'name'. The
system will only display a
single spectrum real-time. If
another plot command is executed any
previous plot windows will become
'STATIC' meaning that the data will not be
updated in real-time. Only the last
plotted spectrum will be
real-time.
The plot window contains the following
information and functionality...
The window title (upper left) is displayed
as the computer name:spectrum name.
Line 2
contains a row of buttons followed again
by the machine name: spectrum name.
'Quit' will remove the plot.
'Ex1' will execute command 'Ex1' when
pressed (or whatever Ex1 was set to by
parameter ex1)
'Ex2' will execute command 'Ex2' when
pressed (or whatever Ex2 was set to by
parameter ex2)
'Ex3' will execute command 'Ex3' when
pressed (or whatever Ex3 was set to by
parameter ex3)
'Ex4' will execute command 'Ex4' when
pressed (or whatever Ex4 was set to by
parameter ex4)
The default function of Ex1, Ex2, Ex3 and
Ex4 is to zoom the display to the
1,2,3,4th quarter
of the screen.
'Home' will display the entire spectrum
autoscaled
'Auto/L' will toggle between Linear
Autoscale and Log y-axis scales.
'Ydn' will fix the Y scale down by a
factor of 2
'Yup' will fix the Y scale up by a factor
of 2
'Zoom' will increase the start channel and
decrease the stop channel by about 10%
'UnZoom' will decrease the start channel
and increase the stop channel by about 10%
'PanL' will decrease the start channel and
decrease the stop channel by about 10%
'PanR' will increase the start channel and
increase the stop channel by about 10%
'Ref' will toggle between 2 views of a 2
parameter 3-dimensional plot, contour or
projection.
The next line on the plot displays:
MaxCounts = Maximum Y-axis value, Count
Rate
in counts per second of the displayed
channels, the Sum of the displayed Y
channels
and the last number is the total number of
channels displayed on the X-Axis.
The bottom line of the plot displays the
X-axis start channel, The Y-value of the
channel
under the cursor that is moved by the
mouse, followed by the X-axis stop
channel.
To zoom a region...
to set the start channel to the current
mouse position, push the left mouse button
to set the stop channel to the current
mouse position, push the right mouse
button
or depress left mouse button starting at
left of desired region and with the mouse
button
depressed drag the line to the right of
the desired region, then release the left
button
to zoom into the desired region.

prescale
[ Name | * ] [value]
prescale = 0 : Do not do auto
prescale.
prescale
> 1 : If a data point in the
array reaches full scale,
all
data in array is divided by 2 and the
prescale is doubled.
q
Displays
the currently defined arrays, lengths
and types.
Alters the
spectral headings of [rump].rbs
files.
rcmd [defined filename] [commands
and values]
commands:
values(units):
[filename] "text"
set filename
[date] "text" date
string
[ltct] "text"
live
time, clock time
information
[id]
"text" identifier
string
[e0] value
incident energy in
MeV
[beam] value
follow format of 4He++
[q] value total
accumulated charge
(uC)
[current] value average
beam current
(nA)
[conv] value value
keV / channel and
offset
[first] value channel
number of first data
point
[fwhm] value detector
resolution
(keV)
[geom] value geometry
identifier
valid values: General = -1 |
Cornell = 0 | IMB = 1
[phi] value
detector
angle (degrees)
[theta] value target
angle (degrees)
[psi]
value geometry
dependent angle
(degrees)
[omega] value detector
solid angle
(mSr)
[corr] value
random
correction
factor
[npt] value
number of
data points
[show]
displays current information of
[filename]
Example: rbs
mev 3.04 charge 10 conv 8.04 34.5
READ
init.daq to examine system setup.
<RET> for command prompt.
rem
comment
Usually
used to enter comments into *.daq
command files.
Example:
replay
<event vector> <histogram
vector>
Replays
the events from <event vector>
and histogram the vector
<histogram vector>. Both
<event vector> and <histogram
vector> may be
specified by the vector number or the
associated array name specified
in the vector.
The vector <histogram vector> is
histogrammed for each event in
<event vector>.
The channel number that is
histogrammed is then checked against
the lower and
upper channel numbers for each gate
that has a gate vector equal
to <event vector>.
If this gate is satisfied, the
corresponding event is read from
source vector and the
array dest vector
is histogrammed. The vectors gate
vector, source vector, and dest
vector as well as the lower and upper
channel numbers corresponding to the
gate are
defined by the gate command.
See
help on gate
for more information. Also see help on
command vector.
22. rgate Back
to List
Seegate.
rgate
[number] [lower] [upper] [gate vector]
[sourc vector] [dest vector]
where:
[number]
is the gate number (0-150). If number
is not specified all defined
gates
are specified. If [number] is
specified but no other parameters are
specified the current values for gate
[number] are displayed.
[lower]
is the lower channel number for gate
[number].
[upper]
is the upper channel number for gate
[number].
[gate
vector] is the event mode vector on
which this gate is set, this may
be the
array
name or the vector number.
[sourc
vector] is the event mode array used
as input data if this event satisfies
the
gate, this may be the array name or
the vector number.
[dest
vector] is the data array to histogram
if the gate is satisfied, this
may be
the
array name or the vector number.
The
use of the gates is dependent in the interrupt.c,evuser.c,
daquser.c,
and replay.c
functions. The standard DAQ
function replay.c checks the gates and
histograms
[dest vector] at channel [sourc
vector] if replaying [gate vector] and
data [gate vector]
is between [lower] and [upper]
(normalized to the histogram array
specified in the
replay
command).
See help on replay
for more information.
23. rplot Back
to List
24. runfor
Back
to List
runfor
[count]
Runs for
[count]
events. Initailizes
oual_runfor to be used by interrup.c.
$done.daq will be executed when
oual_terminate is set to one by
interrup.c.
25.
runtime
Back to List
runtime
Sets
the acquire time.
Enter the acquire time with the
command runtime, or after the command
runtime is entered you will
be asked to enter the acquire time.
Either method is
valid.
s
Stops
data acquisition.
save
<name> [disk ####] [tag ####]
[incr ####] [stop ####] [rump]
Writes
a data array to disk. The file created
is placed using the path:
./data/dsk####/tag####.dat
That
is, the current directory's data
directory will contain one or more
dsk#### directories,
each containing data files named
tag####.dat. The disk
and tag numbers are taken from
the global values set by the 'disk'
and 'tag' commands.
The default disk and tag numbers may
be overridden by using the 'disk ####'
and
'tag ####' options.
It is
important to remember the TAG NUMBER
IS INCREMENTED BY ONE
AFTER THE DATA IS SAVED, unless
the disk or tag number option or 'incr
####'
option is used. If the disk or
tag number is specified, the global
tag number is NOT
changed UNLESS 'incr####'is also used.
If the 'incr ####' option is
used, the tag number
will be incremented by #### after the
data is saved in all
circumstances.
<name> is the
name of the data array to be
saved. If the name is
* all event mode arrays
(type 10 or above) are saved.
[rump]
saves data in rump format.
If the file already exists, an
extension is automatically appended to
the file name to
prevent overwriting previous data
files of the same name. A
warning message is
also generated on the terminal window.
sub
<source> <dest>
eg.
sub file1 file2
Subtracts
data array <source> from data
array <dest> channel by channel.
t0
[number]
t0
with no number parameter displays the
current system t0 number. If number is
specified, the system t0 is set to
number. The t0 number may be used by
the
interrupt.c
function.
tag
[number]
Tag
with no number parameter displays the
current system default tag number. If
number is specified, the system
default tag is set to number. The tag
number is used
and modified by the get
and save
commands.
vector
<number> <name>
[conversion gain] [uld] [lld] [offset]
If no
parameters are specified, a list of
defined vectors is
displayed. Associates
interrupt
routine vector number <number>
with previously defined array
<name>.
The following parameters are optional
and position dependent:
[conversion
gain] The conversion gain to be
associated with this
data.
Possible
values are 4096(default), 2048,
1024, 512, 256, 128, 64.
[uld] The digital upper level
discriminator to be associated with
this vector.
The
default is the last channel of the
array.
[lld] The digital lower level
discriminator to be associated with
this vector.
The
default is 0.
[offset] The digital offset to be
associated with this vector. This
allows
offsetting
the starting data channel to channel
0 of the array.
The
default is 0.
32. verbose Back
to List
verbose
[0,1]
0 = Quiet
1 = Verbose
33. write Back
to List
write
Saves
file in rump format.
If type 5, Ft = .rbs else .cdf.
User
Supplied Functions:
34. interrupt Back
to List
interrupt.c
The
user supplied function that is called by
DAQ for every interrupt that is
received
from the ADC's. You should
begin by modifying an existing
interrupt.c
routine to suite your needs.
You
should write/keep your own interrupt
functions in your
own
directory under some other name
( eg. int001.dec ).
When you
wish
to generate a version of DAQ that
employes your version of the interrupt
routine you
should copy your interrupt to
d:\daq\interrupt.c along with your
versions
of
evuser.c
and daquser.c. When
you have done this, you can go to
directory d:/daq
and
execute the command tc daq.prj.
You should then issue a
<alt>c m (make exe. file).
This
will build your version (daq.exe) that
you should copy and rename to your own
directory. Remember
that the files interrupt.c, daquser.c,
evuser.c and daq.exe are names
used
by others in the d:\daq directory. The
main DAQ routines will be kept current
in this
directory
for all users of DAQ.
daquser.c
A user supplied function that DAQ will
call after each plot refresh or after
each keystroke
is
entered. This function can be
useful if the user wishes to
periodically check the progress
of
the experiment or possibly do background
analysis of incoming data.
evuser.c
A
user supplied function that DAQ will
call after the event mode buffers fill.
When this
happens, the
DAQ system will issue a STOP to stop
more data from coming in from the
ADC's and
then call evuser.c so it can process the
data if desired. After the call to
evuser.c
all
arrays of type 10 or above are saved to
disk as .\data\evt(disk)\name.(type),
the type
numbers
are incremented, the arrays of type 9 or
greater are cleared, and ANALYZE is
issued
to begin acquiring data. Also see
help on define.
If
you have no need for this function, you
need to supply a default routine
evuser.c that does
nothing
but return. See help on interrupt.c
for information on building DAQ with
user supplied
functions
and interrupt routines.
command_files
Command files can be
created by editing a file
<filename>.daq and placing
Back
to List
commands in the file.
Command files may contain DAQ main
commands, names of
other command files, or DOS commands.
DAQ
searches for commands as follows:
1.
known internal commands (define,
clear, get, etc.)
2. <command>.daq command files
in the current directory
3. DOS commands
The
result when 'setup' was typed
would be:
1.
data1 defined as 1024 channels
2. data2 defined as 1024 channels
3. array data1 assigned to vector
1
4. array data2 assigned to vector
2
5. the command file clr.daq is
executed, clearing data1 and data2
6. the DOS dir command is executed
Note:
Only main
commands can be executed during
data acquisition.
Each
recursion level has 20 variables
defined as &0 to &19. If you
call a subroutine
or function, its variables are
different from the calling function
variables. The
command line level may call a function
that calls 3 additional levels of
functions. If
you prefer to use names for variables
you can use "learn"
to assign a character string
to a &n variable.
For
example: learn "sum" &1#
will equivalence
the name sum to &1.
You
should delete
any learned variables before exiting
the function,
eg. (delete"sum"). Since each
recursion level has a different set of
variables, each
assigned the names &0 - &19, a
method of directly referencing a
specific variable
at a specific recursion level is
employed. Recursion level 0 (command
line level)
variables &0 - &19 may be
explicitly referenced as variables
&100 - &119.
Level 1 (first level of function or
subroutine) variables are referenced
as variables
&200 -&219. Similarly for all
levels up to &500 - &519 at
the uppermost level.
Three
types of variables are supported:
The
type of the variable is set when the
variable is
initialized. Initialization
is
done using the &move or &[I]
[f] [ ] read commands.
For
example:
&move
1 &0
would
define &0 as an integer = 1
&move 1.0 &0
would define &0 as a
floating value 1.0
&move abcdef &0
would define
&0 to the string 'abcdef'
There
are three different &read commands
(read from the keyboard):
The
precision of the floating point
variables is set with &precision n
where n is the
number of places after the
decimal point to
keep.
The
command &? will display a list of
all variables and their current
values.
&n
denotes
one of the user variables
&&n
this notation may be used
to reference a variable by a variable
token
denotes a user
variable, system variable or constant
expression
For
example:
"&move
token &n" indicates that the
command &move can move any
option
of token to a system user variable
such as &move &0 &1,
&move no &0,
&move &tag &0
level
0 => &0 - &19 (&100 -
&119)
level 1 => &0 - &19
(&200 - &219)
level 2 => &0 - &19
(&300 - &319)
level 3 => &0 - &19
(&400 - &419)
level 4 => &0 - &19
(&500 - &519)
The
command interpreter operates most
efficiently when variables are
specified
using the &nn format when nn
denotes an integer and the variable
may be directly
referenced using nn as an index to the
variable array. This eliminates the
search
required to match a variable name with
a variable location. Any programs that
must
be coded as speed efficient as
possible should be the &nn
variable type.
If a
maximal speed is not necessary and
readability is more important,
variables may
be assigned names that are used as
pointers to the real variables
&nn. DAQ then
searches the variable name table for a
match with the user variable
&user_defined
variable then uses the index as the
variable &index. The command to
define variable
names is &var or &vars. The
format for &var(s) is:
&vars
[nn] [string1] [nn] [string2] . . .
Where :
The first [nn] may optionally be used
to specify the variable nn index point
(defaults to 0) and assigns string1 to
variable &nn. Optionally more [nn]
index
points and [strings] may define more
strings to [nn] (default = sequential)
to
&nn variables. This is most easily
described by examples of the various
forms.
The programmer must be aware that the
&var command is assigning
equivalence
strings to the system variables &0
- &19, not defining variables.
Here
are some valid forms:
&vars
alpha beta charlie
&alpha
= &0, &beta = &1,
&charlie = &2
&var
10 counter
&counter
= &10
&var
alpha beta 10 counter start 19 dummy
&alpha
= &0, &beta = &1,
&counter = &10, &start =
&11,
&dummy
= &19
Note
that these variable definitions are
dynamic and are known by name only to
the
command file executing on this
recursion level. This means that
re-entrant programs
may be written (a function may call
itself) if local variable definitions
&0 - &19 are
used (or their equivalence named
variables). These variables may still
be directly
referenced using the &1nn where 1
denotes the recursion level. Global or
common
variables (variables know by all
routines) should be defined with the
&global
command. Global variables will be
defined starting at &119 and count
down by
default instead of up as in the
&var command. The local (&var)
table is searched
before the global table is searched so
if a locally defined variable has the
same name
as a globally defined variable the
local name dominates.
Below
are some examples
&global
first second third
&first
= &119, &second = &118,
&third = &117
&global
first second third 10 v10 v9 5 five
&first
= &119, &second = &118,
&third = &117,
&v10
= &110, &v9 = 109, &five =
&105
&stack
Display the current stack values
&?
Displays
contents of variables
&$
Displays
current names associated with variables
&anal
= 1 if in analyze mode
&disk
= current
DISK value
&inplot
= 1 if currently plotting a spectrum,
else 0
&level
= current
recursion level
&nextlevel =
(current recursion level + 2) * 100
&nstack
=
number of stack elements on stack
&sofint
= current hex (6 bit)
value of interrupt inputs
&t0
= current value of T0
&tag
=
current TAG value
&date
= system date and time string
&hostname =
system hostname
&fullname
= system hostname including domain
B. Initialization
Commands Back
to List
&move
token &n
initialize the variable &n with
token and set variable type
dependent
on token (12 = integer, 12.0 = float,
abc = string)
&read
&n read
a string from keyboard into &n
&iread &n
read
a integer from keyboard into &n
&fread
&n read
a floating point value from keyboard
into &n
C. Reverse
Polish Mathmatical Expression
Evaluator (&let)
&let &n [=] token [token |
oper] . . .
Back to List
&let
evaluates mathmatical expressions
similar to an RPN (Reverse Polish
Notation)
calculator. The process begins from
left to right with the first token and
places it on
the 10 element stack. For all
succeeding [token | oper]'s; if not a
known operation,
the token is placed on the stack (last
in, first out) else if it is a known
operation, the
operation is performed on the lower
element(s) of the stack (bottom
element for
unary operations, bottom 2 elements
for binary operations). The stack is
then
collapsed with the result of the
operation left at the bottom of the
stack. The type
of operation (integer or floating
point) is determined by the type
currently at the
bottom of the stack for +, -, *, /,
and sqrt. Otherwise the type is float.
Note:
Tokens may not be the result of
functions.
i.e.
& .LLD &name,
etc...
A list
of known operations:
+
add I, F
-
subtract I, F
*
multiply I, F
/
divide I, F
sqrt
square root I, F
**
power F
sin
sine F
cos
cosine F
tan
tangent F
log
log
base e F
log10
log base 10 F
exp
e ** n F
pow10 10 ** n F
float
set type = floatF
int
set type = int I
pop pop
stack element into variable
For
Example:
to
perform the algebraic x = sqrt ( ( a
+ 10 ) * ( b * c ) )
&let
&x = &a 10 + &b &c *
* sqrt
to
convert variable x to type float
&let
&x = &x float
to
assign y the value of x
&let &y = &x
to
perform the algebraic avg = ( a + b
+ c + d + e )/ 5
1.
&let &avg = &a &b +
&c + &d + &e + 5 / or
2.
&let &avg = &a &b
&c &d &e + + + + 5 / or
3.
&let &avg = &a &b +
&c &d + &e + + 5 /
Note:
Solution 1 might be considered
better because the stack only
needs
to be two elements high
max. Solution 2 requires
the stack
to
be five elements high. The stack is
ten elements high.
D. Integer
and Logical Commands
Back
to List
&add
token &n
integer
add token to &n
&sub token &n
integer subtract token from
&n
&mul token &n
integer multiply &n by token
&div token &n
integer divide &n by token
&and token &n
logical and &n with token
&xor token &n
logical exclusive or &n with token
&or token &n
logical or &n with token
&mod token &n
&n
= &n mod token (remainder)
&add$ token
&n
concatenate (add string) token
to &n
$addi$ token
&n
concatenate (add character) the ascii
character of value token to &n
E. Floating Point
Commands
Back to List
&add
token &n
floating add token to &n
&sub token &n
floating
subtract token from &n
&mul token &n
floating
multiply &n by token
&div token &n
floating
divide &n by token
&precision n
set number of decimal digits to n
(valid range 1 - 9)
Format
Conversion Commands
&int
&n
convert &n to type integer
&float
&n
convert &n to type float
&string &n
convert &n to type string
F. Output
Commands (some DOS only)
Back
to List
&type
token token token
types
tokens on display
Example:
&type "The sum is" &1
&cat token token
concatenates
tokens (type with no spaces or
returns)
Example:
&cat "DSK" &1
&log token token token
...
print tokens into the daq.log file as
a note
&nl
prints
a carriage return
&clrscr
clears
screen
&gotoxy tokenx
tokeny moves
text curser to x,y (1,1 = top left)
&opentop
creates
window in top half of screen
&openbottom
creates
window in bottom half of screen
&typew
same
as &type except types in opened
window
&catw
same
as &cat except types in open
window
Colors
for following commands:
0 =
Black
1 = Blue
2 = Green
3
= Cyan
4
= Red
5 = Magenta
6 =
Brown
7 =
LtGray 8
= DkGray 9 =
LtBlue
10 = LtGreen 11 = LtCyan
12 = LtRed
13
= LtMagnta
14 =
Yellow 15
= White
16 =
Blank
&textattr
token
sets
text attributes (Bbbbffff)
&textcolor token
sets
text color
&textbackground
token sets
background color
&textmode token
1
= C40, 3 = C80, 64 = EGA43
&peek
array_name token
function value is token channel of
array array_name
Example:
"&move &peek data 10 &1"
will move the
contents
of array data channel 10 to &1
&poke array_name token1 token2
write into
array_name channel token1 the value
of
token2; Example: "&poke
data 10 100" will write
100
at channel 10 of array data
&peek$
peek value of element of string
eg.
&move abcd &0, &move
&peek$ &0 1 &1, &type
&1, => 98, decimal value for
'b'
&_length
token
function value is length of array
token
&_type token
function
value is type of array token
&_uld token
function
value is uld of array token
&_lld token
function
value is lld of array token
&_offset token
function
value is digital offset of array token
&_shift token
function
value is shift count for conversion
gain
&_prescale token
function
value is prescale for array token
&_ndat token
function
value is num data pts in fit for array
&_cg token
function
value is conversion gain for array
token
Example:
&move &_prescale data &1
will set &1
to
the prescale value for array data
H. Conditional
and Control Commands
Back
to List
&goto
[int] label [lable2]
transfer
control to the line that is label
(Labels must
begin
with a ; and be the only entry on the
line. They
must
also not be an integer, i.e. a label
cannot be ;2.)
Example:
&goto
loop
:
;loop
A
computed goto is also available by
specifying an integer variable after
the &goto
command. In this form the [int] label
will be the destination label. [int] =
1 for the
first label, [int] = 2 for the second
label etc. [int] = 0 will attempt to
go to label ;0.
For
Example:
&goto
&1 first secnd third
will
goto first if &1 = 1
will
goto secnd if &1 = 2
will
goto third if &1 = 3
will
print error if &1 > 3 (number
of labels)and continue
with
statement following the computed goto
&if
token1 oper token2 {
statement1
statement2
.
. .
}
or
. . .
If
token1 oper token2 statement(s)
valid
oper are:
.gt.
">"
token1
greater than token2
.lt.
"<"
token1 less
than token2
.gteq. ">="
token1 greater than or equal to token2
.lteq. "<="
token1 less than or equal to token2
.eqgt. "=>"
token1 greater than or equal to token2
.eqlt. "=<"
token1 less than or equal to token2
.neq. "!="
token1 not equal to token2
.neq$. "!==" (string)
token1 not equal to (string) token2
.ne.
"!="
token1 not equal to
token2
.ne$. "!==" (string)
token1 not equal to (string) token2
.eq. "="
token1 equal
to token2
.eq$. "=="
(srting) token1 equal to
(string) token2
&ifgtzero
&n statement(s)
execute
statements if &n greater than zero
(multiple
statements are allowed on a line,
but
if one of the statements is &type
or &cat
it
must be the last statement on the
line)
&ifgteqzero
&n
stmt(s) greater
than or equal to zero
&ifltzero
&n
statement(s) less
than zero
&iflteqzero
&n statement(s)
less than or
equal to zero
&ifzero &n
statement(s) zero
&ifnotzero
&n statement(s)
not zero
&ifdef
token statement(s)
if array token is defined
&ifndef
token statement(s)
if
token array is not defined
&ifeq token1 token2 stmt(s)
if (string) token1
equals (string) token2
&ifneq
token1 token2 stmt(s) if
(string) token1 does not equal
(string) token2
&ifgt
token1 token2 stmt(s)
if token1 is
greater than token2
&iflt
token1 token2 stmt(s)
if
token1 is less than token2
&ifgteq
token1 token2 stmt(s) if token1 is
greater than or equal to token2
&iflteq
token1 token2 stmt(s) if token1
is less than or equal to token2
Example:
&ifneq &1 100 &add 1
&1 &goto -lpoop
&wtkbd
wait
for keypress at keyboard
&ifnkbd statement(s)
executes
statement(s) if no keys pressed
&ifkbd
statement(s)
executes
statement(s) if keys pressed
&ret
[param] [param] . .
.
return from function or exit
(parameters
are returned LIFO on stack
and are
obtained by using &let &n =
pop)
&ret[stackop] [stackop] . .
. (may
optionally return paremeters LIFO on
stack)
&sleep
token
wait for token seconds then return
&delay
token
wait for token milliseconds then
return
&usleep
token
wait for token microsends then return
&clrstack
set
number of parameters on stack equal to
zero
&mask
prevents
software interrupts from being
processed
&unmask
allows
software interrupts to be processed
($intn.daq)
&return1
variable that some commands return a
result
eg: integrate e 10 20 will return
&return1 = sum of e channels 10-20
&in
addr fun
reads channel
device e.g. &move &in 1
2 &0
&out addr fun &n
output &n to channel
device addr function fun
&inport
port
reads io port eg. &move
&inport 796 &0
&outport port &n
output &n to io port
eg.&outport 796 0
Comments can use the command "rem" or
begin with a ;
When
calling a function parameters can be
passed. These parameters are passed to
the function starting with variable
&1...&n with &0 containing
the number of
parameters passed. For example, if a
function was written to integrate an
array from
starting channel to stopping channel
and was called as "integrate array 100
200"
when the function integrate was
invoked &0 would = 3, &1 =
array, &2 = 100, and
&3 = 200.
Functions must be edited as
filename.daq
Interrupts
are provided to respond to real time
control events. At present two
different types are provided. The OU
channel controller has 6 BNC
connectors
that are labeled $int0 - $int1. These
connections will initiate DAQ
execution of the
corresponding files named $int0.daq -
$int5.daq when the following
conditions are
met.
1) The
interrupts must be "unmasked" using
the &unmask command.
2) The input must be pulled to ground.
Another
interrupt can be initiated using the "runfor"
command. This command can
be used to count a certain number of
events in the DAQ adc interrupt
response
program and initiate execution of the
file $done.daq when this count equals
a
specified number. The runfor command
sets the global variable oual_counter.
When
oual_counter reaches a predetermined
value the interrupt.c program sets
global
variable oual_terminate = 1 and this
will initiatw the $done.daq program if
the
interrupts are not masked (&mask
and &unmask commands
respectively).
Upon
receipt of an interrupt ($intn.daq of
$done.daq) DAQ will issue a stop "s"
command and a "&mask" command to
prevent further data from being
processed
and also to prevent more interrupts.
The interrupt service routines
($intn.daq or $done.daq) must issue an
"a"
command to begin data acquisition
again
(if desired) and also an "&unmask"
command before exiting to allow
further interrupts.
___________________________________________________________________________________
Example
command language program
fun3.daq
&global flag pos_decay neg_decay
search
&vars index start stop fun fun1 10
dx y x z1 z2 starty startx resp
&precision 7
&if &flag .eq$. Undefined {
&let &pos_decay = 6.28
&let &neg_decay = 6.28
&move defined &flag
}
&if &index .gt. 0 {
&let &search =
&index
;scan
&if &&search .eq$.
decay {
&type enter
positive decay...
&fread
&pos_decay
&type enter
negative decay...
&fread
&neg_decay
&if &index
.eq. 5 {
&type assuming &start
&stop &fun
&goto have_decays
}
&goto get_start
}
&sub 1 &search
&if &search .gt. 0
&goto scan
}
;
&if &index .neq. 4 {
&add 1 &index
&goto &index get_start
get_stop get_fun get_fun1
;get_start
&type enter start
value ...
&fread &start
;get_stop
&type enter stop
value ...
&fread &stop
;get_fun
&type enter
function...
&read &fun
;get_fun1
&type enter
function...
&read &fun1
}
;have_decays
&let &start = &start float
&let &stop =
&stop float
&let
&index = &index int
&if &stop .lteq. &start {
&type Error:(fun)
start must be less than stop
&goto get_start
}
;
&let &dx = &stop
&start - 63.0 /
&ifndef &fun define &fun
4096 type 1
;
&type Computing...
&let &x = 0
&let &y = 0
&let &startx = &start
&let &starty = &start
;loopy
&if &starty .gteq. 0.0
{
&let &z1 =
&starty &fun1 1.02 + 100.0 *
0.0 &starty - &stop /
&pos_decay * exp *
}
&if &starty .lt. 0.0 {
&let &z1 =
&starty &fun1 1.02 + 100.0 *
&starty &stop / &neg_decay
* exp *
}
;loopx
&ifkbd {
;* plot &fun
&type ENTER (again,
exit or c/r=continue)
&read &resp
&if &resp .eq$.
"exit" &ret
&if &resp .eq$.
"again" &goto get_start
}
&if &startx .gteq. 0.0
{
&let &z2 =
&startx &fun 1.02 + 100.0 *
0.0 &startx - &stop /
&pos_decay * exp *
}
&if &startx .lt. 0.0 {
&let &z2 =
&startx &fun 1.02 + 100.0 *
&startx &stop / &neg_decay
* exp *
}
&let &index = 64 &y
* &x +
&let &z2 = &z1
&z2 *
&if &z2 .gt. 32760.0
&let &z2 = 32760.0
&let &z2 = &z2 int
&poke &fun &index
&z2
&let &startx =
&startx &dx +
&add 1 &x
&move 0 &x
&let &startx =
&start
&let &starty =
&starty &dx +
&cat .
&if &y .lt. 64
&goto loopy
;plot &fun
&ret
12 Input
Router Setup
These
inputs trigger internal 6 ns
monostables. Each input is AC coupled
width and
terminated in 50 Ohms. Each input will
trigger on > 4 Volts and 50ns width
or > 2 Volts
if the input is > 100 ns wide. A
552 B slow output is fine.
Figure to be inserted here.
Each
monostable output is "OR"ed and
inverted to produce an output to view
during
setup to see how long the monostables
are triggered.
Figure
to be inserted here.
The
strobe output is the pulse that shifts
the contents of the router monostables
into
the FIFO with ADC data.
Figure
to be inserted here.
Trigger
the router with the positive edge of a
logic signal that happens when this
detector is fired. The general
setup requires that the first ADC read
out will also
read the contents of the
route FIFO. Make sure that the
route monostable is true
in all cases when the strobe output
occurs. The strobe output of the
router will
occur ~ 1ns after the strobe to the
ADC unless the ADC is busy with
another
detector.
Figure
to be inserted here.
Data Format
Histogram
Files Back
to List
./data/dsknnnn/tagnnnn.dat
All are I8
format.
Record #
1 Disk
Tag Start Stop
Date Time
2 CH0
CH1 CH2 CH3
CH4 CH5 CH6
CH7 CH8 CH9
3 CH10
CH11 CH12 CH13 .
. .
Event
Files Back
to List
./data/evtnnnn/fn.nnn
Record #
1 Disk
Tag Start Stop
Date Time
2 #events
event1 event2 .
. . event9
3 event10
event11 . . .
* Each event word is a sum of (4096*ADC#) + the 12 bit digitized value.
 
The digitized value can be extracted as: value = event & 0xfff;
 
The ADC# can be extracted as: adc = (event & 0x7000) >> 12;
** Date and Time are integer coded
as
Date = (10000 * years past 1900) + (100 *
month) + (day of month)
Time = (10000 * hour) + (100 *
minute) + (seconds
OU
Channel Devices
Use $in
and $out
to communicate to channel.
Channel
Address 1
Analog Input
Module Back to List
16 Independent
Single Ended Analog Inputs
ICEOS
I/O Format
&IN 1 Input
Where
1 = Device
Address
Input = Input
Number (0-15)
The
inputs are unipolar 0 - 10V single
ended. The digitized value is 12
bits (0-4095).
Channel
Address 2
Digital
Output
Module Back to List
4
OPTO-Isolated Digital Outputs
ICEOS
I/O Format
&OUT
2 1 Token
Where
2 = Device
Address
1 = Function
Must Be 1
Token = Value
to Output
The
value to output may range from 0 - 15.
The 4 outputs represent the 4
binary bits in
the range 0 - 15. For example,
to turn on outputs 2 and 8
simultaneously, the command
&OUT
2 1 10
could be used.
1 = BCI
Reset
2 = Swinger
ON/OFF
4 = Swinger Direction
8 = Sample
Changer
Channel
Address 3
Digital Output
Module Back to List
4 OPTO-Isolated
Digital Outputs
ICEOS
I/O Format
&OUT 3 1 Token
Where 3
= Device Address
1 = Function
Must be 1
Token
= Value to Output
The
value to output may range from 0 -
15. The 4 outputs represent
the 4 binary bits in
the range 0 - 15. For example,
to turn on outputs 2 and 8
simultaneously, the command
&OUT
3 1 10
could be used.
Channel
Address 4
Real
Time Clock
Module Back to List
Keeps Date and Time
Information
ICEOS
I/O Format
&IN 4 Function
(Read Clock)
&OUT 4 Function
Token (Set Clock)
Where
4
= Device Address
Token = Value
to Set Clock
Function
= See Table
FUNCTION
TABLE
FUNCTION
ADDRESS
INPUTS
|
INTERNAL
COUNTER
|
DATA I/O
|
DATA
LIMITS
|
NOTES
|
READ
|
WRITE
|
A0
A1
A2
A3
|
|
D0 D1
D2
D3
|
|
|
|
|
0 0 0
0
|
S 1
|
* * * *
|
0 ~ 9
|
S1 or S10 are reset
to zero
irrespective of
input data
D0 ~ D3 when
write
instruction is
executed
with address
selection.
|
16
|
32
|
1
0 0 0
|
S 10
|
* * * *
|
0 ~ 5
|
|
17
|
33
|
0 1
0
0
|
MI 1
|
* * * *
|
0 ~ 9
|
|
18
|
34
|
1 1 0 0
|
MI 10
|
* * * *
|
0 ~ 5
|
|
19
|
35
|
0 0 1 0
|
H 1
|
* * * *
|
0 ~ 9
|
|
20
|
36
|
1 0 1 0
|
H 10
|
* * + +
|
0 ~ 1/
0 ~ 2
|
D2 = "1" for
PM
D2 = "0" for
AM
D3 = "1" for
24 hr
format
D3 = "0" for
24 hr format
|
21
|
37
|
0 1 1 0
|
W
|
* * *
|
0 ~ 6
|
|
22
|
38
|
1 1 1 0
|
D 1
|
* * * *
|
0 ~ 9
|
|
23
|
39
|
0 0 0 1
|
D 10
|
* * +
|
0 ~ 3
|
D2
= "1" for 29 days
in month 2
D2
= "0" for 28 days
in
month 2
(2)
|
24
|
40
|
1 0 0 1
|
MO 1
|
* * * *
|
0 ~ 9
|
|
25
|
41
|
0 1 0 1
|
MO 10
|
*
|
0 ~ 1
|
|
26
|
42
|
1 1 0 1
|
Y 1
|
* * * *
|
0 ~ 9
|
|
27
|
43
|
0 0 1 1
|
Y 10
|
* * * *
|
0 ~ 9
|
|
28
|
44
|
|
(1) * data
valid as "0" or "1"
blank does not exist (unrecognized
during a write and held at "0" during
a read)
+
data bits used for AM / PM, 12 /
24 HOUR and Leap Year
(2) If D2
previously set to "1", upon completion
of month 2 day 29, D2 will be
internally reset to "0"
Channel
Address 5
Dual
Scalar
Module Back to List
Two Independent Nim
and Slow Input Scalars
ICEOS
I/O Format
&IN
5 Function (Read
Scaler)
&OUT 5 Function Token (Set
Mode)
Where
5 =
Device Address
&N
= Variable to Place Count
Token
= Value to Set Prescaler
Function = See Table
The
scalar is a 16 bit binary counter with a
prescale of 1, 10, 100, or
1000. The
counter can count to 65,535 in the /1
prescale or 65,535,000 in the /1000
prescale.
TABLE
&OUT
|
5
|
1
|
0
|
Reset Both
Scalers
|
&OUT
|
5
|
2
|
0
|
Reset
Scaler A
|
&OUT
|
5
|
4
|
0
|
Reset
Scaler B
|
&IN
|
5
|
8
|
|
Read
Scaler A
|
&IN
|
5
|
16
|
|
Read
Scaler B
|
&OUT
|
5
|
32
|
Token
|
Set
Prescaler
|
|
PRESCALE TABLE
Token
|
Prescale A
|
Prescale B
|
|
Token
|
Prescale A
|
Prescale B
|
0
|
/1
|
/1
|
|
8
|
/1
|
/100
|
1
|
/10
|
/1
|
|
9
|
/10
|
/100
|
2
|
/100
|
/1
|
|
10
|
/100
|
/100
|
3
|
/1000
|
/1
|
|
11
|
/1000
|
/100
|
4
|
/1
|
/10
|
|
12
|
/1
|
/1000
|
5
|
/10
|
/10
|
|
13
|
/10
|
/1000
|
6
|
/100
|
/10
|
|
14
|
/100
|
/1000
|
7
|
/1000
|
/10
|
|
15
|
/1000
|
/1000
|
|
Channel
Address 11
Dual
RS232 Serial Port
Back to List
300 baud, 140 parity,
2 stop, 7 bits
&OUT
|
11
|
4
|
0
|
Reset Both
Varts
|
&OUT
|
11
|
2
|
(DATA)
|
Send Data to
Channel A
|
&OUT
|
11
|
10
|
(DATA)
|
Send Data to
Channel B
|
|
&IN
|
11
|
0
|
Sense Status
Channel A
|
&IN
|
11
|
8
|
Sense Status
Channel B
|
|
STATUS
|___|___|___|___|___|___|___|___|x______|_______|
d
X o f
p <------
7 data bits ----->
a M
v r a
t
I e a r
a T r m
i
b r
i t
a u u
n y
v
f n
g
a f
e
i e e e r
l
r r r
r
r r o
a o
o r
v r
r
a
i
l
&IN
|
11
|
1
|
Read Data at
Channel A and Reset
DAV
|
&IN
|
11
|
9
|
Read Data at
Channel B and Reset
DAV
|
|
IN WORD
|_x_|_x_|_x_|___|___|___|___|___|_x_|_______|_______|
D T
O F P <------7
Data Bits------>
A
B
V E E
V
E E
R
R
U
N
FUNCTION BITS
|
3 | 2 | 1 | 0 |
0 = Chan
A r d
r
1 = Chan B
e
a
e
s
t
s
e
a
e
t
t
s
v
t
D
a
r
A
r o
V
t
b
s
e
(both)
|