|
||
|
Hardware reference : Multichannel Data Acquisition | ||||||||||||||
|
|
|||||||||||||||
Multichannel Data Acquisitionmultichannel data acquisition devices include:
Description: In spec , an MCA-type device is something that returns a one-dimensional array of data. Such devices include multichannel analyzers, multichannel scalers, and digital correlators. Operation of most of these devices is through either manual commands to start and stop acquisition when appropriate to the experiment or automatic operation with the standard counting commands and macros. All MCA-type devices (except CAMAC) are assigned a device number from 0 to 31 in the config file. spec 's original MCA functions ( mca_get() , mca_put() and mca_par() ) operate on
the MCA device last selected with the mca_sel() function.
The newer functions ( mca_sget() , mca_sput() and
mca_spar() ) take that device number as an
additional initial parameter.Currently, you cannot assign arbitrary device numbers to CAMAC MCA-type devices. Instead the numbers are automatically assigned starting with the lowest available device number not otherwise taken when spec reads the config file. Use the mca_sel("?") to see
what device numbers have been assigned.DATA GROUPS AND ARRAYS Originally, spec 's mca_get() and mca_put() functions,
which transfer data between the MCA-type hardware and spec , were
written to use data groups. The data groups were the second-generation
method of handling arrays of data in spec . (The first-generation
method used a single internal two-dimensional array of fixed size for
storing the data.) The data help file describes use of data groups.The third-generation and most recent method of handling arrays of data in spec is by use of the new array data type. Usage of the array data type is far more intuitive than that of the data groups. The arrays help file explains general features of the array data
type. In brief, the arrays are declared with a type and dimension.
For example,
SPEC.1> ulong array mca_data[8192]
declares an unsigned-long data array of 8,192 elements. The
mca_get() and mca_put() functions can be invoked with the array name
as an argument. If the declared type of the array matches that of
the hardware, the data will be transferred directly to the array. If
the type doesn't match, spec will create a temporary buffer of the
correct type, read the data into that, then copy the data to the
user's array, all transparently to the user. Either way will work,
though there is a slight efficiency advantage in declaring the array
to match the native type of the hardware. The command
SPEC.2> print mca_par("native_type")
long
shows the native type of the selected MCA device. |
|||||||||||||||
|
|
|||||||||||||||