/* Generated with snc from sncTds3x.i */ /* Program "sncTds3x" */ #include #include #include #include #include "epicsTypes.h" #include "seqCom.h" /* Variable declarations */ # line 11 "../sncTds3x.st" static short dochan[4] = {0,0,0,0}; # line 14 "../sncTds3x.st" static short chanrd[4] = {0,0,0,0}; # line 19 "../sncTds3x.st" static short chanwt[4] = {0,0,0,0}; # line 22 "../sncTds3x.st" static short acqur = 0; # line 24 "../sncTds3x.st" static short clrR = 0; # line 26 "../sncTds3x.st" static short ops = 0; # line 27 "../sncTds3x.st" static short cts = 0; # line 28 "../sncTds3x.st" static int busy[4] = {0,0,0,0}; # line 30 "../sncTds3x.st" static char spath[128] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}; # line 31 "../sncTds3x.st" static char setup[4000] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,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0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}; # line 37 "../sncTds3x.st" static int count = 0; # line 38 "../sncTds3x.st" static int i = 0; # line 39 "../sncTds3x.st" static int j = 0; # line 40 "../sncTds3x.st" static int chRdOld[4] = {0,0,0,0}; # line 41 "../sncTds3x.st" static int flg1[4] = {0,0,0,0}; # line 42 "../sncTds3x.st" static int flg2[4] = {0,0,0,0}; # line 43 "../sncTds3x.st" static char *fname = 0; /* C code definitions */ # line 5 "../sncTds3x.st" #include # line 6 "../sncTds3x.st" #include # line 45 "../sncTds3x.st" static int rdFile( char* msg,char* fn){ FILE* fd; char str[32]; strcpy( str,msg); strcat( str,":rdFile"); fd=fopen( fn,"r"); if(!fd) printf( "%s:rdFile: failed to open %s\n",msg,fn); else{ printf( "%s:rdFile:opened %s\n",msg,fn); fgets( wfRst,4000 -1,fd); wfRst[4000 -1]=0; printf( "sncTds3x:rdFile:strlen(wfRst)=%d\n",strlen(wfRst)); if(ferror( fd)){ perror( str); return(-1);} } return(0); } static void wtFile( char* msg,char* fn){ FILE* fd; int stat; fd=fopen( fn,"w"); if(!fd) printf( "%s:wtFile: failed to open %s\n",msg,fn); else{ setup[4000 -1]=0; stat=fputs( setup,fd); if(stat==EOF) printf( "%s:wtFile:fputs: failed to write\n",msg); else printf( "%s:wtFile: wrote to %s\n",msg,fn); fclose( fd); } } /* Program init func */ static void G_prog_init(struct UserVar *pVar) { } /****** Code for state "init" in state set "savRest" ******/ /* Delay function for state "init" in state set "savRest" */ static void D_savRest_init(SS_ID ssId, struct UserVar *pVar) { } /* Event function for state "init" in state set "savRest" */ static seqBool E_savRest_init(SS_ID ssId, struct UserVar *pVar, int *pTransNum, int *pNextState) { # line 83 "../sncTds3x.st" if (1) { *pNextState = 1; *pTransNum = 0; return TRUE; } return FALSE; } /* Action function for state "init" in state set "savRest" */ static void A_savRest_init(SS_ID ssId, struct UserVar *pVar, int transNum, int *pNextState) { switch(transNum) { case 0: { # line 84 "../sncTds3x.st" fname = seq_macValueGet(ssId, "FN"); strncpy( spath,fname,128 -1); # line 86 "../sncTds3x.st" spath[128 - 1] = 0; # line 87 "../sncTds3x.st" seq_pvPut(ssId, 20/*spath*/, 0); # line 88 "../sncTds3x.st" seq_efClear(ssId, 4/*setpEv*/); # line 89 "../sncTds3x.st" seq_efClear(ssId, 5/*rstrEv*/); # line 90 "../sncTds3x.st" printf("sncTds3x:savRest: file path initialized\n"); } return; } } /****** Code for state "save" in state set "savRest" ******/ /* Delay function for state "save" in state set "savRest" */ static void D_savRest_save(SS_ID ssId, struct UserVar *pVar) { # line 97 "../sncTds3x.st" seq_delayInit(ssId, 0, (0.1)); } /* Event function for state "save" in state set "savRest" */ static seqBool E_savRest_save(SS_ID ssId, struct UserVar *pVar, int *pTransNum, int *pNextState) { # line 94 "../sncTds3x.st" if (seq_efTestAndClear(ssId, 4/*setpEv*/)) { *pNextState = 2; *pTransNum = 0; return TRUE; } # line 97 "../sncTds3x.st" if (seq_delay(ssId, 0)) { *pNextState = 2; *pTransNum = 1; return TRUE; } return FALSE; } /* Action function for state "save" in state set "savRest" */ static void A_savRest_save(SS_ID ssId, struct UserVar *pVar, int transNum, int *pNextState) { switch(transNum) { case 0: { # line 95 "../sncTds3x.st" wtFile("sncTds3x", spath); } return; case 1: { } return; } } /****** Code for state "restore" in state set "savRest" ******/ /* Delay function for state "restore" in state set "savRest" */ static void D_savRest_restore(SS_ID ssId, struct UserVar *pVar) { # line 103 "../sncTds3x.st" seq_delayInit(ssId, 0, (0.5)); } /* Event function for state "restore" in state set "savRest" */ static seqBool E_savRest_restore(SS_ID ssId, struct UserVar *pVar, int *pTransNum, int *pNextState) { # line 100 "../sncTds3x.st" if (seq_efTestAndClear(ssId, 5/*rstrEv*/)) { *pNextState = 1; *pTransNum = 0; return TRUE; } # line 103 "../sncTds3x.st" if (seq_delay(ssId, 0)) { *pNextState = 1; *pTransNum = 1; return TRUE; } return FALSE; } /* Action function for state "restore" in state set "savRest" */ static void A_savRest_restore(SS_ID ssId, struct UserVar *pVar, int transNum, int *pNextState) { switch(transNum) { case 0: { # line 101 "../sncTds3x.st" if (!rdFile("sncTds3x", spath)) # line 101 "../sncTds3x.st" seq_pvPut(ssId, 23/*wfRst*/, 0); } return; case 1: { } return; } } /****** Code for state "init" in state set "acquire" ******/ /* Delay function for state "init" in state set "acquire" */ static void D_acquire_init(SS_ID ssId, struct UserVar *pVar) { } /* Event function for state "init" in state set "acquire" */ static seqBool E_acquire_init(SS_ID ssId, struct UserVar *pVar, int *pTransNum, int *pNextState) { # line 112 "../sncTds3x.st" if (1) { *pNextState = 1; *pTransNum = 0; return TRUE; } return FALSE; } /* Action function for state "init" in state set "acquire" */ static void A_acquire_init(SS_ID ssId, struct UserVar *pVar, int transNum, int *pNextState) { switch(transNum) { case 0: { # line 113 "../sncTds3x.st" for (i = 0; i < 4; i++) { # line 114 "../sncTds3x.st" flg1[i] = flg2[i] = 0; # line 115 "../sncTds3x.st" busy[i] = 0; # line 115 "../sncTds3x.st" seq_pvPut(ssId, 16/*busy*/ + (VAR_ID)(0), 0); } # line 117 "../sncTds3x.st" printf("sncTds3x:acquire:init\n"); } return; } } /****** Code for state "doIt" in state set "acquire" ******/ /* Delay function for state "doIt" in state set "acquire" */ static void D_acquire_doIt(SS_ID ssId, struct UserVar *pVar) { # line 145 "../sncTds3x.st" seq_delayInit(ssId, 0, (0.05)); } /* Event function for state "doIt" in state set "acquire" */ static seqBool E_acquire_doIt(SS_ID ssId, struct UserVar *pVar, int *pTransNum, int *pNextState) { # line 121 "../sncTds3x.st" if (seq_efTestAndClear(ssId, 2/*acqEv*/)) { *pNextState = 1; *pTransNum = 0; return TRUE; } # line 145 "../sncTds3x.st" if (seq_delay(ssId, 0)) { *pNextState = 1; *pTransNum = 1; return TRUE; } return FALSE; } /* Action function for state "doIt" in state set "acquire" */ static void A_acquire_doIt(SS_ID ssId, struct UserVar *pVar, int transNum, int *pNextState) { switch(transNum) { case 0: { # line 122 "../sncTds3x.st" for (i = 0; i < 4; i++) { # line 126 "../sncTds3x.st" if (chanrd[count]) { # line 126 "../sncTds3x.st" flg1[count] = 1; break; } else # line 127 "../sncTds3x.st" if (flg2[count]) break; # line 128 "../sncTds3x.st" if ((++count) >= 4) # line 128 "../sncTds3x.st" count = 0; } # line 130 "../sncTds3x.st" seq_pvGet(ssId, 16/*busy*/ + (VAR_ID)(count), 0); # line 132 "../sncTds3x.st" if (!busy[count]) { # line 133 "../sncTds3x.st" if (flg1[count] || flg2[count]) { # line 134 "../sncTds3x.st" busy[count] = 1; # line 134 "../sncTds3x.st" seq_pvPut(ssId, 16/*busy*/ + (VAR_ID)(count), 0); # line 135 "../sncTds3x.st" dochan[count] = 1; # line 135 "../sncTds3x.st" seq_pvPut(ssId, 0/*dochan*/ + (VAR_ID)(count), 0); } # line 136 "../sncTds3x.st" if (flg1[count]) { # line 136 "../sncTds3x.st" flg1[count] = 0; # line 136 "../sncTds3x.st" flg2[count] = 1; } else # line 137 "../sncTds3x.st" if (flg2[count]) # line 137 "../sncTds3x.st" flg2[count] = 0; } # line 143 "../sncTds3x.st" if ((++count) >= 4) # line 143 "../sncTds3x.st" count = 0; } return; case 1: { } return; } } /****** Code for state "chkChanInit" in state set "chkChan" ******/ /* Delay function for state "chkChanInit" in state set "chkChan" */ static void D_chkChan_chkChanInit(SS_ID ssId, struct UserVar *pVar) { } /* Event function for state "chkChanInit" in state set "chkChan" */ static seqBool E_chkChan_chkChanInit(SS_ID ssId, struct UserVar *pVar, int *pTransNum, int *pNextState) { # line 153 "../sncTds3x.st" if (1) { *pNextState = 1; *pTransNum = 0; return TRUE; } return FALSE; } /* Action function for state "chkChanInit" in state set "chkChan" */ static void A_chkChan_chkChanInit(SS_ID ssId, struct UserVar *pVar, int transNum, int *pNextState) { switch(transNum) { case 0: { # line 154 "../sncTds3x.st" for (j = 0; j < 4; j++) { # line 155 "../sncTds3x.st" seq_pvGet(ssId, 4/*chanrd*/ + (VAR_ID)(j), 0); # line 156 "../sncTds3x.st" if (chanrd[j]) { # line 156 "../sncTds3x.st" chanwt[j] = 1; # line 156 "../sncTds3x.st" seq_pvPut(ssId, 8/*chanwt*/ + (VAR_ID)(j), 0); } # line 157 "../sncTds3x.st" chRdOld[j] = chanrd[j]; } } return; } } /****** Code for state "chkChanDo" in state set "chkChan" ******/ /* Delay function for state "chkChanDo" in state set "chkChan" */ static void D_chkChan_chkChanDo(SS_ID ssId, struct UserVar *pVar) { # line 171 "../sncTds3x.st" seq_delayInit(ssId, 0, (0.05)); } /* Event function for state "chkChanDo" in state set "chkChan" */ static seqBool E_chkChan_chkChanDo(SS_ID ssId, struct UserVar *pVar, int *pTransNum, int *pNextState) { # line 162 "../sncTds3x.st" if (seq_efTestAndClear(ssId, 1/*chRdFlg*/)) { *pNextState = 1; *pTransNum = 0; return TRUE; } # line 171 "../sncTds3x.st" if (seq_delay(ssId, 0)) { *pNextState = 1; *pTransNum = 1; return TRUE; } return FALSE; } /* Action function for state "chkChanDo" in state set "chkChan" */ static void A_chkChan_chkChanDo(SS_ID ssId, struct UserVar *pVar, int transNum, int *pNextState) { switch(transNum) { case 0: { # line 163 "../sncTds3x.st" for (j = 0; j < 4; j++) { # line 164 "../sncTds3x.st" if (chanrd[j] != chRdOld[j]) { # line 165 "../sncTds3x.st" chanwt[j] = chanrd[j]; # line 166 "../sncTds3x.st" seq_pvPut(ssId, 8/*chanwt*/ + (VAR_ID)(j), 0); # line 167 "../sncTds3x.st" chRdOld[j] = chanrd[j]; } } } return; case 1: { } return; } } /****** Code for state "doClr" in state set "doRate" ******/ /* Delay function for state "doClr" in state set "doRate" */ static void D_doRate_doClr(SS_ID ssId, struct UserVar *pVar) { # line 182 "../sncTds3x.st" seq_delayInit(ssId, 0, (0.5)); } /* Event function for state "doClr" in state set "doRate" */ static seqBool E_doRate_doClr(SS_ID ssId, struct UserVar *pVar, int *pTransNum, int *pNextState) { # line 178 "../sncTds3x.st" if (seq_efTestAndClear(ssId, 3/*clrREv*/)) { *pNextState = 0; *pTransNum = 0; return TRUE; } # line 182 "../sncTds3x.st" if (seq_delay(ssId, 0)) { *pNextState = 0; *pTransNum = 1; return TRUE; } return FALSE; } /* Action function for state "doClr" in state set "doRate" */ static void A_doRate_doClr(SS_ID ssId, struct UserVar *pVar, int transNum, int *pNextState) { switch(transNum) { case 0: { # line 179 "../sncTds3x.st" ops = 1; # line 179 "../sncTds3x.st" seq_pvPut(ssId, 14/*ops*/, 0); # line 180 "../sncTds3x.st" cts = 1; # line 180 "../sncTds3x.st" seq_pvPut(ssId, 15/*cts*/, 0); } return; case 1: { } return; } } /************************ Tables ************************/ /* Channel table */ static seqChan G_channels[] = { /* chName, offset, varName, varType, count, eventNum, efId, monitored, queueSize, queueIndex */ {"{P}SQ_CH1_UPD_WF.PROC", (size_t)&dochan[0], "dochan[0]", "short", 1, 6, 0, 0, 0, 0}, {"{P}SQ_CH2_UPD_WF.PROC", (size_t)&dochan[1], "dochan[1]", "short", 1, 7, 0, 0, 0, 0}, {"{P}SQ_CH3_UPD_WF.PROC", (size_t)&dochan[2], "dochan[2]", "short", 1, 8, 0, 0, 0, 0}, {"{P}SQ_CH4_UPD_WF.PROC", (size_t)&dochan[3], "dochan[3]", "short", 1, 9, 0, 0, 0, 0}, {"{P}R_CH1_ENABLE", (size_t)&chanrd[0], "chanrd[0]", "short", 1, 10, 1, 1, 0, 0}, {"{P}R_CH2_ENABLE", (size_t)&chanrd[1], "chanrd[1]", "short", 1, 11, 1, 1, 0, 0}, {"{P}R_CH3_ENABLE", (size_t)&chanrd[2], "chanrd[2]", "short", 1, 12, 1, 1, 0, 0}, {"{P}R_CH4_ENABLE", (size_t)&chanrd[3], "chanrd[3]", "short", 1, 13, 1, 1, 0, 0}, {"{P}W_CH1_ENABLE", (size_t)&chanwt[0], "chanwt[0]", "short", 1, 14, 0, 0, 0, 0}, {"{P}W_CH2_ENABLE", (size_t)&chanwt[1], "chanwt[1]", "short", 1, 15, 0, 0, 0, 0}, {"{P}W_CH3_ENABLE", (size_t)&chanwt[2], "chanwt[2]", "short", 1, 16, 0, 0, 0, 0}, {"{P}W_CH4_ENABLE", (size_t)&chanwt[3], "chanwt[3]", "short", 1, 17, 0, 0, 0, 0}, {"{P}COUNT", (size_t)&acqur, "acqur", "short", 1, 18, 2, 1, 0, 0}, {"{P}CLR_RATE", (size_t)&clrR, "clrR", "short", 1, 19, 3, 1, 0, 0}, {"{P}1PER_SECOND.VAL", (size_t)&ops, "ops", "short", 1, 20, 0, 0, 0, 0}, {"{P}COUNT_GETS.VAL", (size_t)&cts, "cts", "short", 1, 21, 0, 0, 0, 0}, {"{P}C_CH1_BUSY.VAL", (size_t)&busy[0], "busy[0]", "int", 1, 22, 0, 0, 0, 0}, {"{P}C_CH2_BUSY.VAL", (size_t)&busy[1], "busy[1]", "int", 1, 23, 0, 0, 0, 0}, {"{P}C_CH3_BUSY.VAL", (size_t)&busy[2], "busy[2]", "int", 1, 24, 0, 0, 0, 0}, {"{P}C_CH4_BUSY.VAL", (size_t)&busy[3], "busy[3]", "int", 1, 25, 0, 0, 0, 0}, {"{P}SAV_PATH", (size_t)&spath, "spath", "char", 128, 26, 0, 1, 0, 0}, {"{P}R_SETUP", (size_t)&setup, "setup", "char", 4000, 27, 4, 1, 0, 0}, {"{P}RESTORE", (size_t)&rstor, "rstor", "short", 1, 28, 5, 1, 0, 0}, {"{P}W_SETUP", (size_t)&wfRst, "wfRst", "char", 4000, 29, 0, 0, 0, 0} }; /* Event masks for state set "savRest" */ static const seqMask EM_savRest_init[] = { 0x00000000, }; static const seqMask EM_savRest_save[] = { 0x00000010, }; static const seqMask EM_savRest_restore[] = { 0x00000020, }; /* State table for state set "savRest" */ static seqState G_savRest_states[] = { { /* state name */ "init", /* action function */ A_savRest_init, /* event function */ E_savRest_init, /* delay function */ D_savRest_init, /* entry function */ 0, /* exit function */ 0, /* event mask array */ EM_savRest_init, /* state options */ (0) }, { /* state name */ "save", /* action function */ A_savRest_save, /* event function */ E_savRest_save, /* delay function */ D_savRest_save, /* entry function */ 0, /* exit function */ 0, /* event mask array */ EM_savRest_save, /* state options */ (0) }, { /* state name */ "restore", /* action function */ A_savRest_restore, /* event function */ E_savRest_restore, /* delay function */ D_savRest_restore, /* entry function */ 0, /* exit function */ 0, /* event mask array */ EM_savRest_restore, /* state options */ (0) }, }; /* Event masks for state set "acquire" */ static const seqMask EM_acquire_init[] = { 0x00000000, }; static const seqMask EM_acquire_doIt[] = { 0x00000004, }; /* State table for state set "acquire" */ static seqState G_acquire_states[] = { { /* state name */ "init", /* action function */ A_acquire_init, /* event function */ E_acquire_init, /* delay function */ D_acquire_init, /* entry function */ 0, /* exit function */ 0, /* event mask array */ EM_acquire_init, /* state options */ (0) }, { /* state name */ "doIt", /* action function */ A_acquire_doIt, /* event function */ E_acquire_doIt, /* delay function */ D_acquire_doIt, /* entry function */ 0, /* exit function */ 0, /* event mask array */ EM_acquire_doIt, /* state options */ (0) }, }; /* Event masks for state set "chkChan" */ static const seqMask EM_chkChan_chkChanInit[] = { 0x00000000, }; static const seqMask EM_chkChan_chkChanDo[] = { 0x00000002, }; /* State table for state set "chkChan" */ static seqState G_chkChan_states[] = { { /* state name */ "chkChanInit", /* action function */ A_chkChan_chkChanInit, /* event function */ E_chkChan_chkChanInit, /* delay function */ D_chkChan_chkChanInit, /* entry function */ 0, /* exit function */ 0, /* event mask array */ EM_chkChan_chkChanInit, /* state options */ (0) }, { /* state name */ "chkChanDo", /* action function */ A_chkChan_chkChanDo, /* event function */ E_chkChan_chkChanDo, /* delay function */ D_chkChan_chkChanDo, /* entry function */ 0, /* exit function */ 0, /* event mask array */ EM_chkChan_chkChanDo, /* state options */ (0) }, }; /* Event masks for state set "doRate" */ static const seqMask EM_doRate_doClr[] = { 0x00000008, }; /* State table for state set "doRate" */ static seqState G_doRate_states[] = { { /* state name */ "doClr", /* action function */ A_doRate_doClr, /* event function */ E_doRate_doClr, /* delay function */ D_doRate_doClr, /* entry function */ 0, /* exit function */ 0, /* event mask array */ EM_doRate_doClr, /* state options */ (0) }, }; /* State set table */ static seqSS G_state_sets[] = { { /* state set name */ "savRest", /* states */ G_savRest_states, /* number of states */ 3, /* number of delays */ 1 }, { /* state set name */ "acquire", /* states */ G_acquire_states, /* number of states */ 2, /* number of delays */ 1 }, { /* state set name */ "chkChan", /* states */ G_chkChan_states, /* number of states */ 2, /* number of delays */ 1 }, { /* state set name */ "doRate", /* states */ G_doRate_states, /* number of states */ 1, /* number of delays */ 1 }, }; /* Program table (global) */ seqProgram sncTds3x = { /* magic number */ 2001006, /* program name */ "sncTds3x", /* channels */ G_channels, /* num. channels */ 24, /* state sets */ G_state_sets, /* num. state sets */ 4, /* user var size */ 0, /* param */ "P=TDS:,FN=/afs/slac/g/esb/ilc/restore/tds3000.txt", /* num. event flags */ 5, /* encoded options */ (0 | OPT_CONN | OPT_NEWEF), /* init func */ G_prog_init, /* entry func */ NULL, /* exit func */ NULL, /* num. queues */ 0 }; /* Register sequencer commands and program */ #include "epicsExport.h" static void sncTds3xRegistrar (void) { seqRegisterSequencerCommands(); seqRegisterSequencerProgram (&sncTds3x); } epicsExportRegistrar(sncTds3xRegistrar);