- Added back calculation from motor positions to Q/E variables into

TAS code.
- Fixed communication problems in SerPortServer, mainly with terminator
  detection.
- Added SPS switched motors for TOPSI
- Debugged Power-PC histogram memory software for TRICS
This commit is contained in:
cvs
2001-05-18 14:12:32 +00:00
parent 8b4a022881
commit 2d16479717
31 changed files with 1951 additions and 55 deletions

View File

@@ -368,13 +368,13 @@
sbpc_showHelp (errmsg);
return False;
} /* xOff*/
if ((sscanf (p_arg2, "%i", &xOff) != 1) || (xOff <= 0)) {
if ((sscanf (p_arg2, "%i", &xOff) != 1)) {
sprintf (errmsg, "The value for <#-xOff>, \"%s\", is illegal!\n"
"It must be a positive integer.", p_arg1);
sbpc_showHelp (errmsg);
return False;
} /* xFac */
if ((sscanf (p_arg3, "%i", &xFac) != 1) || (xFac <= 0)) {
if ((sscanf (p_arg3, "%i", &xFac) != 1)|| xFac <= 0) {
sprintf (errmsg, "The value for <#-xFac>, \"%s\", is illegal!\n"
"It must be a positive integer.", p_arg1);
sbpc_showHelp (errmsg);
@@ -387,7 +387,7 @@
sbpc_showHelp (errmsg);
return False;
} /* yOff*/
if ((sscanf (p_arg5, "%i", &yOff) != 1) || (yOff <= 0)) {
if ((sscanf (p_arg5, "%i", &yOff) != 1)) {
sprintf (errmsg, "The value for <#-yOff>, \"%s\", is illegal!\n"
"It must be a positive integer.", p_arg1);
sbpc_showHelp (errmsg);

View File

@@ -214,11 +214,13 @@
#define LWL_TOF_C9 (0x09000000) /* TOF-Mode 9 chan dgrm hdr */
#define LWL_PSD_TSI 0x0E000000 /* PSD-Mode TSI datagram */
#define LWL_PSD_DATA 0x13000000 /* PSD-mode data datagram */
#define LWL_PSD_DATA 0x12000000 /* PSD-mode data datagram */
#define LWL_PSD_PWF 0x20000000 /* PSD-mode Power Fail bit */
#define LWL_PSD_TIME 0x000fffff /* PSD-mode time stamp extraction
mask */
#define LWL_PSD_FLASH_MASK 0x00ff /* mask for flash count */
#define LWL_PSD_XORF 0x2000 /* mask for TDC-XORF bit */
#define LWL_PSD_CONF 0x0100 /* mask for TDC-CONF flag */
#define LWL_SM_NC (0x10000000) /* Strobo-Mode/No-Coinc 0 chan dgrm hdr */
#define LWL_SM_NC_C1 (0x11000000) /* Strobo-Mode/No-Coinc 1 chan dgrm hdr */

View File

@@ -185,7 +185,8 @@
int psdFlashCount;
int psdHitCount;
int psdXSize;
int psdYSize;
int psdYSize;
int psdXORF, psdConf;
/*========================== Define the function prototypes ================*/
void catch_int_signal (

View File

@@ -167,13 +167,16 @@
if (lwl_hdr.ui4 == LWL_FIFO_EMPTY) {
taskDelay (0); /* If FIFO is empty, we can take a breather! */
}else if ((lwl_hdr.ui4 & LWL_HDR_TYPE_MASK) == LWL_HM_NC_C1) {
/* Histo data, single channel */
VmioBase[VMIO_PORT_A] = 0xff; /* Set timer level (if present) */
for (i=0; i<1000; i++) {
for (i=0; i<1000000; i++) {
lwl_data.ui4 = *Lwl_fifo; /* Get the 16 bits of data */
if (lwl_data.ui4 != LWL_FIFO_EMPTY) break;
taskDelay (0); /* But wait if FIFO is slow! */
if (lwl_data.ui4 != LWL_FIFO_EMPTY) {
break;
}
taskDelay (0); /* But wait if FIFO is slow! */
}
if (lwl_data.ui4 == LWL_FIFO_EMPTY) {
printf ("Time-out getting histogram data word! Event # = %d\n",
N_events);
@@ -239,20 +242,24 @@
VmioBase[VMIO_PORT_A] = 0x00; /* Reset timer level (if present) */
N_events++;
}else if ((lwl_hdr.ui4 & LWL_HDR_TYPE_MASK) == LWL_TSI_HM_NC) {
process_no_coinc_tsi (lwl_hdr.ui4); /* We have found a "normal"
** TSI (Timing-Status-Info) header. Process
** it.
*/
}else if ((lwl_hdr.ui4 & LWL_HDR_TYPE_MASK) == LWL_TSI_HM_C) {
process_coinc_tsi (lwl_hdr.ui4); /* We have found a "coincidence"
** type TSI header. The packet has 10 bytes
** altogether. Process it.
*/
}else { /* Anything else gets flushed */
lwl_Packet_Read (lwl_hdr.ui4, my_buff);
}
if (FillTimer_expired) {
/* if (FillTimer_expired) { */
if (0) {
if (Print_hdr) printf ("\nTaking data in Digitised Histogramming Mode\n"
" #-Events #-Skip #-TSI Dead-Time Sync-Status\n");
Print_hdr = False;
@@ -711,7 +718,7 @@
*/
void SinqHM_filler_daq_psd () {
/* =====================
** Routine to handle Time-of-flight Mode
** Routine to handle PSD-TOF Mode
** Note:
** Lwl_fifo could, in principle, be accessed via a register for better
** efficiency. However, this can cause trouble with the GDB debugger
@@ -727,6 +734,7 @@
} lwl_hdr, xData, yData;
int xPos, yPos, iTime, dataPos;
signed int sPosx, sPosy;
int i, j, is, ts, left, right, middl, not_finished;
uint *edge_pntr;
char er_eol[] = {ESC, '[', '0', 'J'}; /* Erase to End-of-Line */
@@ -793,8 +801,16 @@
/*
We have a valid PSD packet. Find and check positions.
*/
xPos = (xData.ui2[1] - psdXOffset)/psdXFactor;
yPos = (yData.ui2[1] - psdYOffset)/psdYFactor;
xPos = xData.ui2[1];
if(xPos >= 32767)
xPos -= 65536;
yPos = yData.ui2[1];
if(yPos >= 32767)
yPos -= 65536;
xPos = (xPos + psdXOffset)/psdXFactor;
yPos = (yPos + psdYOffset)/psdYFactor;
if(xPos < 0 || xPos > psdXSize)
{
printf("X position out of range: %d, alllowed 0 - %d\n",
@@ -896,6 +912,8 @@
if ((Tsi_flags & STATUS_FLAGS__SYNC0) != 0) printf (" SYNC0");
if ((Tsi_flags & STATUS_FLAGS__UD) != 0) printf (" UD");
if ((Tsi_flags & STATUS_FLAGS__GU) != 0) printf (" GU");
if(psdXORF) printf(" XORF");
if(psdConf) printf(" CONF");
is = timer_settime (FillTimerId, ~TIMER_ABSTIME, &FillerTime, NULL);
if (is != 0) {

View File

@@ -3469,7 +3469,9 @@
for (j=0; j<3; j++) { /* Get the remaining 6 bytes */
for (i=0; i<1000; i++) {
lwl_data.ui4 = *Lwl_fifo; /* Get the last 16 bits */
if (lwl_data.ui4 != LWL_FIFO_EMPTY) break;
if (lwl_data.ui4 != LWL_FIFO_EMPTY) {
break;
}
taskDelay (0); /* But wait if FIFO is slow! */
}
if (lwl_data.ui4 == LWL_FIFO_EMPTY) {
@@ -3533,6 +3535,7 @@
}
words[j] = lwl_data.ui2[1];
}
/* printf(" %X %X %X\n", words[0], words[1], words[2]); */
N_coin_tsi++;
Dt_or_dts.both = hdr & LWL_TSI_DT_MSK;
@@ -3554,6 +3557,16 @@
*/
psdHitCount += words[1];
psdFlashCount += words[2] & LWL_PSD_FLASH_MASK;
if((words[2] & LWL_PSD_XORF) != 0) {
psdXORF = 1;
}else {
psdXORF = 0;
}
if((words[2] & LWL_PSD_CONF) != 0) {
psdConf = 0;
}else {
psdConf = 1;
}
}
/*
@@ -3575,7 +3588,9 @@
for (i=0; i<1000; i++) {
lwl_data.ui4 = *Lwl_fifo; /* Get the last 16 bits */
if (lwl_data.ui4 != LWL_FIFO_EMPTY) break;
if (lwl_data.ui4 != LWL_FIFO_EMPTY) {
break;
}
taskDelay (0); /* But wait if FIFO is slow! */
}
if (lwl_data.ui4 == LWL_FIFO_EMPTY) {

View File

@@ -360,6 +360,7 @@
printf ("\nCycle %5d", i+1);
for (j = 0; j < nrec; j++) {
status = send (Cnct_skt, p_recs[j], (*p_recs[j])+1, 0);
sleep(2);
}
}
printf ("\nDone.\n");