/* dsc2_ConfCheck.c */ #include #include #include #include #include /* ssh halld@roctrg11 source /home/halld/test_setup/coda_setup source /home/halld/test_setup/.aliases cd /home/halld/test_setup/rocbcal1/rol/ ./dsc2_ConfCheck cc -rdynamic -o dsc2_ConfCheck dsc2_ConfCheck.c -DLinux_vme -I/home/halld/test_setup/coda/linuxvme/include /home/halld/test_setup/coda/linuxvme/jvme/libjvme.a /home/halld/test_setup/coda/linuxvme/fadcV2/libfadc.a /home/halld/test_setup/coda/linuxvme/dsc2/libdsc2.a /home/halld/test_setup/coda/linuxvme/tdc1290/libtdc1190.a /home/halld/test_setup/coda/linuxvme/f1tdc/libf1tdc.a /home/halld/test_setup/coda/linuxvme/ti/libti.a /home/halld/test_setup/coda/linuxvme/ssp/libssp.a /home/halld/test_setup/coda/linuxvme/ctp/libctp.a -ldl -lpthread -lrt ${CC} -rdynamic -o $@ $< -DLinux_vme -I/home/halld/test_setup/coda/linuxvme/include /home/halld/test_setup/coda/linuxvme/jvme/libjvme.a /home/halld/test_setup/coda/linuxvme/fadcV2/libfadc.a /home/halld/test_setup/coda/linuxvme/dsc2/libdsc2.a /home/halld/test_setup/coda/linuxvme/tdc1290/libtdc1190.a /home/halld/test_setup/coda/linuxvme/f1tdc/libf1tdc.a /home/halld/test_setup/coda/linuxvme/ti/libti.a /home/halld/test_setup/coda/linuxvme/ssp/libssp.a -ldl -lpthread -lrt @echo ${CC} -rdynamic -o $@ $< -DLinux_vme ${CODA_CFLAGS} tcpClient rocbcal1 "fadc250Config('/home/halld/test_setup/rocbcal1/fadc250_example.cnf')" tcpClient rocbcal1 "fadc250Mon(0)" tcpClient rocbcal1 "dsc2Init(0x100000,0x80000,20,0)" tcpClient rocbcal1 "dsc2Config('/home/halld/test_setup/rocbcal1/dsc2_example.cnf')" tcpClient rocbcal1 "dsc2Mon(0)" tcpClient rocbcal1 "tdc1190Init(0x09A00000,0,1,0)" tcpClient rocbcal1 "tdc1290Config('/home/halld/test_setup/rocbcal1/tdc1290_example.cnf')" tcpClient rocbcal1 "tdc1290Mon(0)" */ int test1() { printf("test1\n"); } int test2(int a) { printf("test2: a=%d\n",a); } #include "tcpServer.c" #include "fadc250Config.c" #include "dsc2Config.c" #include "tdc1290Config.c" #include "f1tdcConfig.c" #include "v851.c" int main(int argc, char *argv[]) { char myname[256]; int iFlag = 0; int sl; int NFADC=18; int FA_SLOT; /* Open the default VME windows */ vmeOpenDefaultWindows(); printf("argc=%d\n",argc);fflush(stdout); printf("= 0 ======================================================\n");fflush(stdout); if(argc==2) { printf("= 1 ======================================================\n");fflush(stdout); strncpy(myname, argv[1], 255); printf("use argument >%s< as host name\n",myname);fflush(stdout); } else { printf("= 2 ======================================================\n");fflush(stdout); /* getenv("HOSTNAME"); printf("= 2.1 ======================================================\n");fflush(stdout); printf(" getenv >%s< \n",getenv("HOSTNAME"));fflush(stdout); printf("= 2.2 ======================================================\n");fflush(stdout); strncpy(myname, "roctrg11", 255); */ strncpy(myname, getenv("HOSTNAME"), 255); printf("= 3 ======================================================\n");fflush(stdout); printf("use env var HOST >%s< as host name\n",myname);fflush(stdout); printf("= 4 ======================================================\n");fflush(stdout); } printf("2 < 19 =0x%x \n",(2 << 19));fflush(stdout); printf("3 < 19 =0x%x \n",(3 << 19));fflush(stdout); printf("4 < 19 =0x%x \n",(4 << 19));fflush(stdout); dsc2Init(0x100000,0x80000,20,0); dsc2Mon(0); printf("==========================================================\n\n"); tdc1190Init(0x09A00000,0,1,0); tdc1290Mon(0); printf("==========================================================\n\n"); /* f1Init(0x480000,0,1,0); printf("==========================================================\n\n"); */ #define TI_ADDR (21<<19) #define TI_READOUT 3 tiInit(TI_ADDR,TI_READOUT,0); tiStatus(); printf("==========================================================\n\n"); /* Setup the iFlag.. flags for FADC initialization */ iFlag = 0; /* Sync Source */ iFlag |= (1<<0); /* VXS */ /* Trigger Source */ iFlag |= (1<<2); /* VXS */ /* Clock Source */ /*iFlag |= (1<<5);*/ /* VXS */ iFlag |= (0<<5); /* self*/ vmeSetQuietFlag(1); /* skip the errors associated with BUS Errors */ faInit((unsigned int)(3<<19),(1<<19),NFADC,iFlag); /* start from 0x00180000, increment 0x00080000 */ NFADC=nfadc; /* Redefine our NFADC with what was found from the driver */ printf(" TEST............NFADC= %d \n",NFADC); FA_SLOT = fadcID[0]; faPrintDAC(FA_SLOT); printf("==========================================================\n\n"); sspInit(0x200000,0,1,0); sspStatus(4,1); printf("==========================================================\n\n"); ctpInit(0); ctpSetFinalSumThreshold(230,0); printf("==========================================================\n\n"); tcpServer(myname); fflush(stdout); while(1) sleep(1); }