- Fixed a few problems with hklscan
- Added transfer of zipped data to conman.c, histogram memory software in order to support the TRICS status display. - Upgraded TRICS data file writing. - First installment of triple axis spectrometer support: initialization of data structures and an implementation of the MAD dr(ive) command.
This commit is contained in:
@@ -4,7 +4,13 @@
|
||||
**
|
||||
**------------------------------------------------------------------------------
|
||||
*/
|
||||
#define SINQHM_DEF_ID "V02G"
|
||||
#define SINQHM_DEF_ID "V03C"
|
||||
|
||||
#ifdef __alpha
|
||||
#ifndef __vms
|
||||
#pragma nomember_alignment
|
||||
#endif
|
||||
#endif
|
||||
/*------------------------------------------------------------------------------
|
||||
*/
|
||||
#ifndef OffsetOf
|
||||
@@ -20,6 +26,7 @@
|
||||
#define MAX_TOF_NBINS 32768 /* The maximum number of bins in a TOF histog */
|
||||
#define MAX_TOF_EDGE 16 /* The maximum number of TOF edge arrays */
|
||||
#define VMIO_BASE_ADDR 0x1900 /* VME address of a (possible) VMIO10 module */
|
||||
#define IDENT_MSGE_LEN 256 /* Length of Ident info for SQHM_IDENT */
|
||||
|
||||
#define uchar unsigned char
|
||||
#define usint unsigned short int
|
||||
@@ -56,6 +63,8 @@
|
||||
#define SQHM_DBG 0x05
|
||||
#define SQHM_DECONFIG 0x06
|
||||
#define SQHM_EXIT 0x07
|
||||
#define SQHM_IDENT 0x0e
|
||||
#define SQHM_PROJECT 0x0d
|
||||
#define SQHM_READ 0x08
|
||||
#define SQHM_SELECT 0x09
|
||||
#define SQHM_STATUS 0x0a
|
||||
@@ -68,7 +77,7 @@
|
||||
#define SQHM__HM_DIG 0x2000 /* Hist mode (with digitised read-out) */
|
||||
#define SQHM__TOF 0x3000 /* Time-of-Flight mode */
|
||||
#define SQHM__HM_PSD 0x4000 /* Hist mode (with Pos-sens-detect read-out) */
|
||||
#define SQHM__HRPT 0x5000 /* Histogram mode for HRPT cerca detector */
|
||||
#define SQHM__HRPT 0x5000 /* Hist mode for HRPT */
|
||||
/*
|
||||
** Define the various sub-mode bits of the operation modes
|
||||
*/
|
||||
@@ -83,7 +92,8 @@
|
||||
#define SQHM__BO_CNT 0x10 /* Keep counts of overflow bins */
|
||||
|
||||
#define SQHM__STROBO 0x20 /* Use strobo-bit information */
|
||||
#define SQHM__REFLECT 0x40 /* reflect histogram */
|
||||
#define SQHM__REFLECT 0x40 /* Reflect histograms */
|
||||
#define SQHM__NO_STAT 0x80 /* Suppress status info from "Filler" */
|
||||
/*
|
||||
** ----------------------------------------------------------
|
||||
** SQHM_DAQ sub-function codes
|
||||
@@ -94,11 +104,32 @@
|
||||
#define DAQ__INH 0x03
|
||||
#define DAQ__STOP 0x04
|
||||
#define DAQ__TST 0x05
|
||||
/*
|
||||
** ----------------------------------------------------------
|
||||
** SQHM_PROJECT sub-codes
|
||||
*/
|
||||
#define PROJECT__ON_Y 0x0001 /* Project onto y-axis */
|
||||
#define PROJECT__1_DIM 0x0002 /* Make projection of a 1-dim histogram */
|
||||
/*
|
||||
** ----------------------------------------------------------
|
||||
** Definition of bits in <flag> of TOF edge-array
|
||||
*/
|
||||
#define FLAG__VAR_BIN 0x01 /* Bin span of histogram is variable */
|
||||
/*
|
||||
** ----------------------------------------------------------
|
||||
** Definition of bits in <flags> of SQHM_STATUS response
|
||||
*/
|
||||
#define STATUS_FLAGS__PF 0x8000 /* PF - Power Fail */
|
||||
#define STATUS_FLAGS__SWC 0x4000 /* SWC - Status Word Changed */
|
||||
#define STATUS_FLAGS__NRL 0x2000 /* NRL - Neutron Rate Low */
|
||||
#define STATUS_FLAGS__DAQ 0x1000 /* DAQ on -- set if Hdr Mask Bits are
|
||||
** correct so that data acq is active */
|
||||
#define STATUS_FLAGS__SYNC3 0x0800 /* Ext Synch Bit #3 */
|
||||
#define STATUS_FLAGS__SYNC2 0x0400 /* Ext Synch Bit #2 */
|
||||
#define STATUS_FLAGS__SYNC1 0x0200 /* Ext Synch Bit #1 */
|
||||
#define STATUS_FLAGS__SYNC0 0x0100 /* Ext Synch Bit #0 */
|
||||
#define STATUS_FLAGS__UD 0x0080 /* UD - Up/Down */
|
||||
#define STATUS_FLAGS__GU 0x0040 /* GU - Gummi (i.e. Strobo) */
|
||||
/*
|
||||
** ----------------------------------------------------------
|
||||
*/
|
||||
@@ -107,19 +138,38 @@
|
||||
#define N_TOTAL_BYTES 0x400000 /* Maximum total bytes of histogram */
|
||||
/*
|
||||
**------------------------------------------------------------------------------
|
||||
** Definitions of Filler states in HRPT mode
|
||||
*/
|
||||
#define HRPT__SRCH_FRAME 1
|
||||
#define HRPT__READ_FRAME 2
|
||||
/*
|
||||
**------------------------------------------------------------------------------
|
||||
** Definitions for the LWL Datagrams
|
||||
*/
|
||||
#define LWL_HDR_TYPE_MASK (0x1f000000) /* Mask for extracting main dgrm ..
|
||||
** .. hdr command-type bits */
|
||||
#define LWL_HDR_PF_MASK (0x80000000) /* Mask for extr Power Fail bit */
|
||||
#define LWL_HDR_SWC_MASK (0x40000000) /* Mask for extr Status Word Chng bit */
|
||||
#define LWL_HDR_NRL_MASK (0x20000000) /* Mask for extr Neutron Rate Low bit */
|
||||
#define LWL_HDR_UD_MASK (0x00200000) /* Mask for extr Up/Down bit */
|
||||
#define LWL_HDR_BA_MASK (0x00f00000) /* Mask for extr Binning Addr */
|
||||
#define LWL_HDR_TS_MASK (0x000fffff) /* Mask for extr Time Stamp */
|
||||
#define LWL_HDR_PF_MASK (0x80000000) /* Mask for extr Power Fail bit */
|
||||
#define LWL_HDR_SWC_MASK (0x40000000) /* Mask for extr Status Word Chng bit */
|
||||
#define LWL_HDR_NRL_MASK (0x20000000) /* Mask for extr Neutron Rate Low bit */
|
||||
#define LWL_HDR_SYNC3_MASK (0x00800000) /* Mask for one of ext synch bits */
|
||||
#define LWL_HDR_SYNC2_MASK (0x00400000) /* Mask for one of ext synch bits */
|
||||
#define LWL_HDR_SYNC1_MASK (0x00200000) /* Mask for one of ext synch bits */
|
||||
#define LWL_HDR_SYNC0_MASK (0x00100000) /* Mask for one of ext synch bits */
|
||||
#define LWL_HDR_UD_MASK LWL_HDR_SYNC1_MASK /* Mask for Up/Down bit */
|
||||
#define LWL_HDR_GU_MASK LWL_HDR_SYNC0_MASK /* Mask for GU bit */
|
||||
#define LWL_HDR_BA_MASK (0x00f00000) /* Mask for TSI Binning Addr */
|
||||
#define LWL_HDR_TS_MASK (0x000fffff) /* Mask for TSI Time Stamp */
|
||||
|
||||
#define LWL_HDR_TYPE_NRL (LWL_HDR_TYPE_MASK | LWL_HDR_NRL_MASK) /* Mask for ..
|
||||
** .. extracting dgrm type + NRL bit */
|
||||
#define LWL_FIFO_EMPTY (0x1e000000) /* FIFO Empty */
|
||||
|
||||
#define LWL_TSI_TR (0x1f000000) /* Time-Status-Info Transp-Mode */
|
||||
#define LWL_TSI_HM_NC (0x1f000000) /* Time-Status-Info Hist-Mode+No-Coinc */
|
||||
#define LWL_TSI_HM_C (0x0e000000) /* Time-Status-Info Hist-Mode+Coinc */
|
||||
#define LWL_TSI_TOF (0x1f000000) /* Time-Status-Info TOF-Mode */
|
||||
#define LWL_TSI_SM_NC (0x1f000000) /* Time-Status-Info Strobo-Mode+No-Coin */
|
||||
#define LWL_TSI_SM_C (0x0e000000) /* Time-Status-Info Strobo-Mode+Coinc */
|
||||
#define LWL_TSI_DT_MSK (0x000fffff) /* Mask for Dead-Time in TSI */
|
||||
#define LWL_TSI_DTS_MSK (0x000fffff) /* Mask for Delay-Time-to-Start in TSI */
|
||||
|
||||
#define LWL_TR_C1 (0x00000001) /* Transp. Mode Chan 1 */
|
||||
#define LWL_TR_C2 (0x00000002) /* Transp. Mode Chan 2 */
|
||||
@@ -184,16 +234,15 @@
|
||||
#define LWL_SM_CO_C8 (0x18000000) /* Strobo-Mode + Coinc 8 chan dgrm hdr */
|
||||
#define LWL_SM_CO_C9 (0x19000000) /* Strobo-Mode + Coinc 9 chan dgrm hdr */
|
||||
|
||||
#define LWL_TS_TR (0x1f000000) /* Transp-Mode Time Status Info */
|
||||
#define LWL_TS_HM_NC (0x1f000000) /* Hist-Mode/No-Coinc Time Stat Info */
|
||||
#define LWL_TS_HM_TOF (0x1f000000) /* TOF-Mode Time Status Info */
|
||||
#define LWL_TS_SM_NC_TOF (0x1f000000) /* Strobo-Mode/No-Coin Time Stat Info */
|
||||
|
||||
#define LWL_ETS_TR (0x0e000000) /* Transp-Mode Ext Time Status Info */
|
||||
#define LWL_ETS_HM_C (0x0e000000) /* Hist-Mode+Coinc Time Status Info */
|
||||
#define LWL_ETS_SM_C (0x0e000000) /* Strobo-Mode+Coinc Time Status Info */
|
||||
|
||||
#define LWL_FIFO_EMPTY (0x1e000000) /* FIFO Empty */
|
||||
#define LWL_TSI_MODE_MASK (0x000e) /* Mask for mode in Time Status Info */
|
||||
#define LWL_TSI_MODE_TR (0x0000) /* TSI Transparent-Mode */
|
||||
#define LWL_TSI_MODE_HM (0x0002) /* TSI Hist-Mode */
|
||||
#define LWL_TSI_MODE_TOF (0x0004) /* TSI TOF-Mode */
|
||||
#define LWL_TSI_MODE_SM1 (0x0006) /* TSI Strobo-Mode 1 - time-stamp coded */
|
||||
#define LWL_TSI_MODE_TR_UD (0x0008) /* TSI Transparent-Mode Up-Down */
|
||||
#define LWL_TSI_MODE_HM_UD (0x000a) /* TSI Hist-Mode Up-Down */
|
||||
#define LWL_TSI_MODE_TOF_UD (0x000c) /* TSI TOF-Mode Up-Down */
|
||||
#define LWL_TSI_MODE_SM2 (0x000e) /* TSI Strobo-Mode 2 - h/w coded */
|
||||
/*
|
||||
**------------------------------------------------------------------------------
|
||||
** Define structure of a TOF histogram data item.
|
||||
@@ -228,7 +277,7 @@
|
||||
** value) if bin width is constant. Otherwise
|
||||
** it is zero. */
|
||||
uint hi_edge; /* Top edge of last bin (20-bit value) */
|
||||
uint edges[2]; /* Array of edge data (20-bit values). There
|
||||
uint edges[2]; /* Array of edge data (20-bit values). There
|
||||
** are actually (n_bins+1) items in the array
|
||||
** and give the bottom edges of the bin */
|
||||
};
|
||||
@@ -238,7 +287,7 @@
|
||||
struct tof_edge_arr {
|
||||
uint n_bins; /* Number of bins in histogram */
|
||||
uint flag; /* Flag (0/1) for fixed/variable bin size */
|
||||
uint *edges ; /* Array of bottom edges (20-bit values) */
|
||||
uint *edges; /* Array of bottom edges (20-bit values) */
|
||||
};
|
||||
|
||||
/* Define structure of a TOF 'bank' in SQHM__TOF config command
|
||||
@@ -286,12 +335,20 @@
|
||||
} u;
|
||||
} cnfg;
|
||||
|
||||
struct {uint level;} dbg;
|
||||
struct {uint mask;} dbg;
|
||||
|
||||
struct {uint sub_code;} decnfg;
|
||||
|
||||
struct {uint sub_cmnd;} daq;
|
||||
|
||||
struct {uint sub_code,
|
||||
x_lo,
|
||||
nx,
|
||||
y_lo,
|
||||
ny,
|
||||
xdim,
|
||||
nhist;} project;
|
||||
|
||||
struct {uint hist_no,
|
||||
first_bin,
|
||||
n_bins;} read;
|
||||
@@ -314,8 +371,8 @@
|
||||
*/
|
||||
struct rply_buff_struct { /* For messages from SinqHM */
|
||||
uint bigend;
|
||||
uint status,
|
||||
sub_status;
|
||||
uint status;
|
||||
uint sub_status;
|
||||
union {
|
||||
char message[52];
|
||||
|
||||
@@ -330,13 +387,34 @@
|
||||
uint total_bytes;
|
||||
uint lo_cntr;
|
||||
uint lo_bin;
|
||||
uint compress;} cnct;
|
||||
uint compress;
|
||||
uint up_time;} cnct;
|
||||
|
||||
struct {usint daq_now;
|
||||
usint daq_was;
|
||||
usint filler_mask;
|
||||
usint server_mask;} daq;
|
||||
|
||||
struct {uint n_extra_bytes;
|
||||
uint up_time;
|
||||
usint offset_vxWorks_ident;
|
||||
usint offset_vxWorks_date;
|
||||
usint offset_instr;
|
||||
usint offset_def_ident;
|
||||
usint offset_sinqhm_main_ident;
|
||||
usint offset_sinqhm_main_date;
|
||||
usint offset_sinqhm_server_ident;
|
||||
usint offset_sinqhm_server_date;
|
||||
usint offset_sinqhm_filler_ident;
|
||||
usint offset_sinqhm_filler_date;
|
||||
usint offset_sinqhm_routines_ident;
|
||||
usint offset_sinqhm_routines_date;} ident;
|
||||
|
||||
struct {uint n_bins;
|
||||
uint bytes_per_bin;
|
||||
uint cnts_lo;
|
||||
uint cnts_hi;} project;
|
||||
|
||||
struct {uint first_bin;
|
||||
uint n_bins;
|
||||
uint bytes_per_bin;
|
||||
@@ -344,18 +422,21 @@
|
||||
uint cnts_hi;} read;
|
||||
|
||||
struct {uint cfg_state;
|
||||
usint n_hists;
|
||||
usint curr_hist;
|
||||
usint n_hists, curr_hist;
|
||||
uint num_bins;
|
||||
uint max_n_hists;
|
||||
uint max_num_bins;
|
||||
uchar max_srvrs;
|
||||
uchar act_srvrs;
|
||||
uchar bytes_per_bin;
|
||||
uchar compress;
|
||||
usint daq_now;
|
||||
usint filler_mask;
|
||||
uint max_block;} status;
|
||||
uchar max_srvrs, act_srvrs, bytes_per_bin, compress;
|
||||
usint daq_now, filler_mask;
|
||||
uint max_block;
|
||||
usint tsi_status, flags;
|
||||
union {
|
||||
uint dead_time;
|
||||
uint dts;
|
||||
uint both;
|
||||
} dt_or_dts;
|
||||
uint num_bad_events;
|
||||
uint up_time;} status;
|
||||
} u;
|
||||
};
|
||||
/*
|
||||
|
||||
Reference in New Issue
Block a user