/* Generated with snc from ../sncPhaseControl.stt */ /* Program "RFPhaseControl" */ #include #include #include #include #include "epicsTypes.h" #include "seqCom.h" /* Variable declarations */ # line 25 "../sncPhaseControl.stt" static int activate_abstraction = 0; # line 30 "../sncPhaseControl.stt" static double pvs[50] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,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 87 "../sncPhaseControl.stt" static double s29PV = 0; # line 89 "../sncPhaseControl.stt" static double s30PV = 0; # line 91 "../sncPhaseControl.stt" static double klys1PV = 0; # line 93 "../sncPhaseControl.stt" static double klys2PV = 0; # line 108 "../sncPhaseControl.stt" static double data[50] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,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 109 "../sncPhaseControl.stt" static double oldData[50] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,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 110 "../sncPhaseControl.stt" static char chgFlag[50] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,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 112 "../sncPhaseControl.stt" static unsigned int missing_counter = 0; # line 113 "../sncPhaseControl.stt" static unsigned int missing_counter_old = 0; # line 114 "../sncPhaseControl.stt" static unsigned int missing_rate = 0; # line 115 "../sncPhaseControl.stt" static unsigned int event_counter = 0; # line 116 "../sncPhaseControl.stt" static unsigned int event_counter_old = 0; # line 117 "../sncPhaseControl.stt" static unsigned int event_rate = 0; # line 118 "../sncPhaseControl.stt" static unsigned int execution_counter = 0; # line 119 "../sncPhaseControl.stt" static unsigned int execution_counter_old = 0; # line 120 "../sncPhaseControl.stt" static unsigned int execution_rate = 0; # line 128 "../sncPhaseControl.stt" static double pdes_ref = 0; # line 129 "../sncPhaseControl.stt" static double pdes_l2 = 0; # line 130 "../sncPhaseControl.stt" static double phase24_1 = 0; # line 131 "../sncPhaseControl.stt" static double phase24_2 = 0; # line 132 "../sncPhaseControl.stt" static double phase_s29 = 0; # line 133 "../sncPhaseControl.stt" static double phase_s30 = 0; # line 134 "../sncPhaseControl.stt" static double poc_24_1 = 0; # line 135 "../sncPhaseControl.stt" static double poc_24_2 = 0; # line 136 "../sncPhaseControl.stt" static double poc_24_3 = 0; # line 137 "../sncPhaseControl.stt" static double poc_tcav3_0 = 0; # line 138 "../sncPhaseControl.stt" static double poc_tcav3_1 = 0; # line 139 "../sncPhaseControl.stt" static double poc_s29 = 0; # line 140 "../sncPhaseControl.stt" static double poc_s30 = 0; # line 142 "../sncPhaseControl.stt" static unsigned int kly_selector = 0; /* C code definitions */ # line 11 "../sncPhaseControl.stt" #include #include #define TRUE 1 #define FLASE 0 #define M_PI 3.14159265358979323846 /* pi */ #define DEBUG_ #define DEBUG_MONPV #define DEBUG_STATUS_ #define PERFORM_FEEDBACK # line 149 "../sncPhaseControl.stt" void initData(void) { int i; for(i=0; i<50; i++) { oldData[i] = 0.; data[i] = 0.; chgFlag[i] = 0; } missing_counter = 0; missing_counter_old = 0; missing_rate = 0; event_counter = 0; event_counter_old = 0; event_rate =0; execution_counter = 0; execution_counter_old =0; execution_rate = 0; } void loadData(void) { int i; for(i=0;i<50;i++) { oldData[i] = data[i]; data[i] = pvs[i]; if(oldData[i] != data[i]) chgFlag[i] = TRUE; else chgFlag[i] = FALSE; } } void set_feedback_klystrons(double phase12, double eGain, double stationEnergy, double *klys1Phase, double *klys2Phase) { double ex, ph; if(fabs(eGain) > 2.*stationEnergy) { if(eGain>0.) eGain = 2.*stationEnergy; else eGain = -2.*stationEnergy; } ex = eGain/stationEnergy/2.; ph = 180./M_PI * acos(ex); *klys1Phase = phase12 + ph; *klys2Phase = phase12 - ph; } void set_feedback_stations(double phase13, double eGain, double stationEnergy1, double stationEnergy2, double *s29Phase, double *s30Phase) { double ex, ph; if(fabs(eGain) > (stationEnergy1+stationEnergy2)) { if(eGain>0.) eGain = stationEnergy1+stationEnergy2; else eGain = -1.*(stationEnergy1+stationEnergy2); } ex = eGain/(stationEnergy1+stationEnergy2); ph = 180./M_PI * acos(ex); *s29Phase = phase13 - ph; *s30Phase = phase13 + ph; } /* Program init func */ static void G_prog_init(struct UserVar *pVar) { } /****** Code for state "monSelector" in state set "KlySelectControl" ******/ /* Delay function for state "monSelector" in state set "KlySelectControl" */ static void D_KlySelectControl_monSelector(SS_ID ssId, struct UserVar *pVar) { } /* Event function for state "monSelector" in state set "KlySelectControl" */ static seqBool E_KlySelectControl_monSelector(SS_ID ssId, struct UserVar *pVar, int *pTransNum, int *pNextState) { # line 228 "../sncPhaseControl.stt" if (kly_selector == 0) { *pNextState = 1; *pTransNum = 0; return TRUE; } # line 229 "../sncPhaseControl.stt" if (kly_selector == 1) { *pNextState = 2; *pTransNum = 1; return TRUE; } # line 230 "../sncPhaseControl.stt" if (kly_selector == 2) { *pNextState = 3; *pTransNum = 2; return TRUE; } return FALSE; } /* Action function for state "monSelector" in state set "KlySelectControl" */ static void A_KlySelectControl_monSelector(SS_ID ssId, struct UserVar *pVar, int transNum, int *pNextState) { switch(transNum) { case 0: { } return; case 1: { } return; case 2: { } return; } } /****** Code for state "selOneTwo" in state set "KlySelectControl" ******/ /* Entry function for state "selOneTwo" in state set "KlySelectControl" */ static void I_KlySelectControl_selOneTwo(SS_ID ssId, struct UserVar *pVar) { # line 236 "../sncPhaseControl.stt" seq_pvAssign(ssId, 1/*pvs*/ + (VAR_ID)(11), "ACCL:LI24:100:KLY_POC"); # line 236 "../sncPhaseControl.stt" seq_pvMonitor(ssId, 1/*pvs*/ + (VAR_ID)(11)); # line 237 "../sncPhaseControl.stt" seq_pvAssign(ssId, 1/*pvs*/ + (VAR_ID)(12), "ACCL:LI24:200:KLY_POC"); # line 237 "../sncPhaseControl.stt" seq_pvMonitor(ssId, 1/*pvs*/ + (VAR_ID)(12)); # line 238 "../sncPhaseControl.stt" seq_pvAssign(ssId, 1/*pvs*/ + (VAR_ID)(13), "ACCL:LI24:300:KLY_POC"); # line 238 "../sncPhaseControl.stt" seq_pvMonitor(ssId, 1/*pvs*/ + (VAR_ID)(13)); # line 240 "../sncPhaseControl.stt" seq_pvAssign(ssId, 53/*klys1PV*/, "ACCL:LI24:100:KLY_PDES"); # line 241 "../sncPhaseControl.stt" seq_pvAssign(ssId, 54/*klys2PV*/, "ACCL:LI24:200:KLY_PDES"); } /* Delay function for state "selOneTwo" in state set "KlySelectControl" */ static void D_KlySelectControl_selOneTwo(SS_ID ssId, struct UserVar *pVar) { } /* Event function for state "selOneTwo" in state set "KlySelectControl" */ static seqBool E_KlySelectControl_selOneTwo(SS_ID ssId, struct UserVar *pVar, int *pTransNum, int *pNextState) { # line 245 "../sncPhaseControl.stt" if (seq_efTestAndClear(ssId, 4/*kly_selector_flag*/)) { *pNextState = 0; *pTransNum = 0; return TRUE; } return FALSE; } /* Action function for state "selOneTwo" in state set "KlySelectControl" */ static void A_KlySelectControl_selOneTwo(SS_ID ssId, struct UserVar *pVar, int transNum, int *pNextState) { switch(transNum) { case 0: { } return; } } /****** Code for state "selTwoThree" in state set "KlySelectControl" ******/ /* Entry function for state "selTwoThree" in state set "KlySelectControl" */ static void I_KlySelectControl_selTwoThree(SS_ID ssId, struct UserVar *pVar) { # line 251 "../sncPhaseControl.stt" seq_pvAssign(ssId, 1/*pvs*/ + (VAR_ID)(11), "ACCL:LI24:200:KLY_POC"); # line 251 "../sncPhaseControl.stt" seq_pvMonitor(ssId, 1/*pvs*/ + (VAR_ID)(11)); # line 252 "../sncPhaseControl.stt" seq_pvAssign(ssId, 1/*pvs*/ + (VAR_ID)(12), "ACCL:LI24:300:KLY_POC"); # line 252 "../sncPhaseControl.stt" seq_pvMonitor(ssId, 1/*pvs*/ + (VAR_ID)(12)); # line 253 "../sncPhaseControl.stt" seq_pvAssign(ssId, 1/*pvs*/ + (VAR_ID)(13), "ACCL:LI24:100:KLY_POC"); # line 253 "../sncPhaseControl.stt" seq_pvMonitor(ssId, 1/*pvs*/ + (VAR_ID)(13)); # line 255 "../sncPhaseControl.stt" seq_pvAssign(ssId, 53/*klys1PV*/, "ACCL:LI24:200:KLY_PDES"); # line 256 "../sncPhaseControl.stt" seq_pvAssign(ssId, 54/*klys2PV*/, "ACCL:LI24:300:KLY_PDES"); } /* Delay function for state "selTwoThree" in state set "KlySelectControl" */ static void D_KlySelectControl_selTwoThree(SS_ID ssId, struct UserVar *pVar) { } /* Event function for state "selTwoThree" in state set "KlySelectControl" */ static seqBool E_KlySelectControl_selTwoThree(SS_ID ssId, struct UserVar *pVar, int *pTransNum, int *pNextState) { # line 260 "../sncPhaseControl.stt" if (seq_efTestAndClear(ssId, 4/*kly_selector_flag*/)) { *pNextState = 0; *pTransNum = 0; return TRUE; } return FALSE; } /* Action function for state "selTwoThree" in state set "KlySelectControl" */ static void A_KlySelectControl_selTwoThree(SS_ID ssId, struct UserVar *pVar, int transNum, int *pNextState) { switch(transNum) { case 0: { } return; } } /****** Code for state "selOneThree" in state set "KlySelectControl" ******/ /* Entry function for state "selOneThree" in state set "KlySelectControl" */ static void I_KlySelectControl_selOneThree(SS_ID ssId, struct UserVar *pVar) { # line 266 "../sncPhaseControl.stt" seq_pvAssign(ssId, 1/*pvs*/ + (VAR_ID)(11), "ACCL:LI24:100:KLY_POC"); # line 266 "../sncPhaseControl.stt" seq_pvMonitor(ssId, 1/*pvs*/ + (VAR_ID)(11)); # line 267 "../sncPhaseControl.stt" seq_pvAssign(ssId, 1/*pvs*/ + (VAR_ID)(12), "ACCL:LI24:300:KLY_POC"); # line 267 "../sncPhaseControl.stt" seq_pvMonitor(ssId, 1/*pvs*/ + (VAR_ID)(12)); # line 268 "../sncPhaseControl.stt" seq_pvAssign(ssId, 1/*pvs*/ + (VAR_ID)(13), "ACCL:LI24:200:KLY_POC"); # line 268 "../sncPhaseControl.stt" seq_pvMonitor(ssId, 1/*pvs*/ + (VAR_ID)(13)); # line 270 "../sncPhaseControl.stt" seq_pvAssign(ssId, 53/*klys1PV*/, "ACCL:LI24:100:KLY_PDES"); # line 271 "../sncPhaseControl.stt" seq_pvAssign(ssId, 54/*klys2PV*/, "ACCL:LI24:300:KLY_PDES"); } /* Delay function for state "selOneThree" in state set "KlySelectControl" */ static void D_KlySelectControl_selOneThree(SS_ID ssId, struct UserVar *pVar) { } /* Event function for state "selOneThree" in state set "KlySelectControl" */ static seqBool E_KlySelectControl_selOneThree(SS_ID ssId, struct UserVar *pVar, int *pTransNum, int *pNextState) { # line 275 "../sncPhaseControl.stt" if (seq_efTestAndClear(ssId, 4/*kly_selector_flag*/)) { *pNextState = 0; *pTransNum = 0; return TRUE; } return FALSE; } /* Action function for state "selOneThree" in state set "KlySelectControl" */ static void A_KlySelectControl_selOneThree(SS_ID ssId, struct UserVar *pVar, int transNum, int *pNextState) { switch(transNum) { case 0: { } return; } } /****** Code for state "initMon" in state set "MonPhaseControl" ******/ /* Delay function for state "initMon" in state set "MonPhaseControl" */ static void D_MonPhaseControl_initMon(SS_ID ssId, struct UserVar *pVar) { } /* Event function for state "initMon" in state set "MonPhaseControl" */ static seqBool E_MonPhaseControl_initMon(SS_ID ssId, struct UserVar *pVar, int *pTransNum, int *pNextState) { # line 285 "../sncPhaseControl.stt" if (TRUE) { *pNextState = 1; *pTransNum = 0; return TRUE; } return FALSE; } /* Action function for state "initMon" in state set "MonPhaseControl" */ static void A_MonPhaseControl_initMon(SS_ID ssId, struct UserVar *pVar, int transNum, int *pNextState) { switch(transNum) { case 0: { /* C code definitions */ # line 286 "../sncPhaseControl.stt" initData(); # line 287 "../sncPhaseControl.stt" loadData(); # line 288 "../sncPhaseControl.stt" loadData(); } return; } } /****** Code for state "monPhaseControl" in state set "MonPhaseControl" ******/ /* Delay function for state "monPhaseControl" in state set "MonPhaseControl" */ static void D_MonPhaseControl_monPhaseControl(SS_ID ssId, struct UserVar *pVar) { } /* Event function for state "monPhaseControl" in state set "MonPhaseControl" */ static seqBool E_MonPhaseControl_monPhaseControl(SS_ID ssId, struct UserVar *pVar, int *pTransNum, int *pNextState) { # line 293 "../sncPhaseControl.stt" if (seq_efTestAndClear(ssId, 1/*mon_flag*/)) { *pNextState = 2; *pTransNum = 0; return TRUE; } return FALSE; } /* Action function for state "monPhaseControl" in state set "MonPhaseControl" */ static void A_MonPhaseControl_monPhaseControl(SS_ID ssId, struct UserVar *pVar, int transNum, int *pNextState) { switch(transNum) { case 0: { /* C code definitions */ # line 294 "../sncPhaseControl.stt" event_counter++; # line 295 "../sncPhaseControl.stt" loadData(); # line 296 "../sncPhaseControl.stt" seq_efSet(ssId, 2/*drive_flag*/); } return; } } /****** Code for state "waitMon" in state set "MonPhaseControl" ******/ /* Delay function for state "waitMon" in state set "MonPhaseControl" */ static void D_MonPhaseControl_waitMon(SS_ID ssId, struct UserVar *pVar) { } /* Event function for state "waitMon" in state set "MonPhaseControl" */ static seqBool E_MonPhaseControl_waitMon(SS_ID ssId, struct UserVar *pVar, int *pTransNum, int *pNextState) { # line 302 "../sncPhaseControl.stt" if (seq_efTestAndClear(ssId, 3/*done_flag*/)) { *pNextState = 1; *pTransNum = 0; return TRUE; } # line 306 "../sncPhaseControl.stt" if (seq_efTestAndClear(ssId, 1/*mon_flag*/)) { *pNextState = 3; *pTransNum = 1; return TRUE; } return FALSE; } /* Action function for state "waitMon" in state set "MonPhaseControl" */ static void A_MonPhaseControl_waitMon(SS_ID ssId, struct UserVar *pVar, int transNum, int *pNextState) { switch(transNum) { case 0: { /* C code definitions */ # line 303 "../sncPhaseControl.stt" execution_counter ++; } return; case 1: { /* C code definitions */ # line 307 "../sncPhaseControl.stt" event_counter ++; # line 308 "../sncPhaseControl.stt" missing_counter ++; } return; } } /****** Code for state "exceptionPhaseControl" in state set "MonPhaseControl" ******/ /* Delay function for state "exceptionPhaseControl" in state set "MonPhaseControl" */ static void D_MonPhaseControl_exceptionPhaseControl(SS_ID ssId, struct UserVar *pVar) { } /* Event function for state "exceptionPhaseControl" in state set "MonPhaseControl" */ static seqBool E_MonPhaseControl_exceptionPhaseControl(SS_ID ssId, struct UserVar *pVar, int *pTransNum, int *pNextState) { # line 315 "../sncPhaseControl.stt" if (TRUE) { *pNextState = 2; *pTransNum = 0; return TRUE; } return FALSE; } /* Action function for state "exceptionPhaseControl" in state set "MonPhaseControl" */ static void A_MonPhaseControl_exceptionPhaseControl(SS_ID ssId, struct UserVar *pVar, int transNum, int *pNextState) { switch(transNum) { case 0: { } return; } } /****** Code for state "eventRate" in state set "EstEventRate" ******/ /* Delay function for state "eventRate" in state set "EstEventRate" */ static void D_EstEventRate_eventRate(SS_ID ssId, struct UserVar *pVar) { # line 327 "../sncPhaseControl.stt" seq_delayInit(ssId, 0, (1.)); } /* Event function for state "eventRate" in state set "EstEventRate" */ static seqBool E_EstEventRate_eventRate(SS_ID ssId, struct UserVar *pVar, int *pTransNum, int *pNextState) { # line 327 "../sncPhaseControl.stt" if (seq_delay(ssId, 0)) { *pNextState = 0; *pTransNum = 0; return TRUE; } return FALSE; } /* Action function for state "eventRate" in state set "EstEventRate" */ static void A_EstEventRate_eventRate(SS_ID ssId, struct UserVar *pVar, int transNum, int *pNextState) { switch(transNum) { case 0: { /* C code definitions */ # line 328 "../sncPhaseControl.stt" event_rate = event_counter - event_counter_old; # line 329 "../sncPhaseControl.stt" event_counter_old = event_counter; # line 330 "../sncPhaseControl.stt" missing_rate = missing_counter - missing_counter_old; # line 331 "../sncPhaseControl.stt" missing_counter_old = missing_counter; # line 332 "../sncPhaseControl.stt" execution_rate = execution_counter - execution_counter_old; # line 333 "../sncPhaseControl.stt" execution_counter_old = execution_counter; # line 335 "../sncPhaseControl.stt" seq_pvPut(ssId, 56/*event_rate*/, 0); # line 336 "../sncPhaseControl.stt" seq_pvPut(ssId, 55/*missing_rate*/, 0); # line 337 "../sncPhaseControl.stt" seq_pvPut(ssId, 57/*execution_rate*/, 0); #ifdef DEBUG_STATUS epicsPrintf("------------------------------------\n"); epicsPrintf("Feedback Event Rate: %ld\n", event_rate); epicsPrintf("Execution Rate: %ld\n", execution_rate); epicsPrintf("Event Missing Rate: %ld\n", missing_rate); epicsPrintf("------------------------------------\n\n"); #endif { unsigned watchdog = data[0]; watchdog++; data[0] = (double) watchdog; pvs[0] = data[0]; } # line 353 "../sncPhaseControl.stt" seq_pvPut(ssId, 1/*pvs*/ + (VAR_ID)(0), 0); } return; } } /****** Code for state "phaseControl" in state set "phasControl" ******/ /* Delay function for state "phaseControl" in state set "phasControl" */ static void D_phasControl_phaseControl(SS_ID ssId, struct UserVar *pVar) { } /* Event function for state "phaseControl" in state set "phasControl" */ static seqBool E_phasControl_phaseControl(SS_ID ssId, struct UserVar *pVar, int *pTransNum, int *pNextState) { # line 381 "../sncPhaseControl.stt" if (seq_efTestAndClear(ssId, 2/*drive_flag*/)) { *pNextState = 1; *pTransNum = 0; return TRUE; } return FALSE; } /* Action function for state "phaseControl" in state set "phasControl" */ static void A_phasControl_phaseControl(SS_ID ssId, struct UserVar *pVar, int transNum, int *pNextState) { switch(transNum) { case 0: { /* C code definitions */ # line 382 "../sncPhaseControl.stt" double result = 0.; # line 383 "../sncPhaseControl.stt" double mdl_scale = -1./6.; # line 384 "../sncPhaseControl.stt" double l2_scale = 1.; # line 385 "../sncPhaseControl.stt" double tcav3_scale = 1.; # line 386 "../sncPhaseControl.stt" double fb_station_scale = 1.; # line 387 "../sncPhaseControl.stt" double S2930_station_scale = 1.; # line 388 "../sncPhaseControl.stt" double injector_scale = 1.; # line 389 "../sncPhaseControl.stt" double station_energy = 240.; # line 390 "../sncPhaseControl.stt" double s21_2856_scale = -1; # line 391 "../sncPhaseControl.stt" double requested_fb; # line 392 "../sncPhaseControl.stt" double ph24_1_u; # line 393 "../sncPhaseControl.stt" double ph24_2_u; # line 394 "../sncPhaseControl.stt" double ph24_1; # line 395 "../sncPhaseControl.stt" double ph24_2; # line 397 "../sncPhaseControl.stt" double change; # line 398 "../sncPhaseControl.stt" double new_phase; # line 399 "../sncPhaseControl.stt" double new_l2_phase; # line 400 "../sncPhaseControl.stt" double new_tcav3_phase_in; # line 401 "../sncPhaseControl.stt" double new_tcav3_phase_out; # line 402 "../sncPhaseControl.stt" double s21HH; # line 403 "../sncPhaseControl.stt" double s21H; # line 404 "../sncPhaseControl.stt" double s21L; # line 405 "../sncPhaseControl.stt" double s21LL; # line 407 "../sncPhaseControl.stt" double pchange; # line 408 "../sncPhaseControl.stt" double ofchange; # line 409 "../sncPhaseControl.stt" double fb_off[5]; # line 411 "../sncPhaseControl.stt" double S29_new; # line 412 "../sncPhaseControl.stt" double S30_new; # line 413 "../sncPhaseControl.stt" double requested_fb3; # line 414 "../sncPhaseControl.stt" double S29_u; # line 415 "../sncPhaseControl.stt" double S30_u; # line 416 "../sncPhaseControl.stt" double S29; # line 417 "../sncPhaseControl.stt" double S30; # line 419 "../sncPhaseControl.stt" int i; # line 420 "../sncPhaseControl.stt" double newPhase[10]; # line 422 "../sncPhaseControl.stt" if ((chgFlag[1] || chgFlag[2] || chgFlag[22] || chgFlag[23] || chgFlag[43]) && activate_abstraction) { /* C code definitions */ # line 423 "../sncPhaseControl.stt" requested_fb = data[2] - data[22] * data[23]; # line 424 "../sncPhaseControl.stt" if((int)data[1] && ~(int)data[43]) { # line 425 "../sncPhaseControl.stt" set_feedback_klystrons(data[4], requested_fb, station_energy, # line 426 "../sncPhaseControl.stt" &ph24_1_u, &ph24_2_u); # line 427 "../sncPhaseControl.stt" ph24_1 = ph24_1_u * fb_station_scale; # line 428 "../sncPhaseControl.stt" ph24_2 = ph24_2_u * fb_station_scale; # line 430 "../sncPhaseControl.stt" /*-----------------------------------------*/ # line 431 "../sncPhaseControl.stt" #ifdef PERFORM_FEEDBACK # line 432 "../sncPhaseControl.stt" klys1PV = ph24_1; # line 432 "../sncPhaseControl.stt" seq_pvPut(ssId, 53/*klys1PV*/, 0); # line 433 "../sncPhaseControl.stt" klys2PV = ph24_2; # line 433 "../sncPhaseControl.stt" seq_pvPut(ssId, 54/*klys2PV*/, 0); # line 434 "../sncPhaseControl.stt" pvs[48] = ph24_1_u; # line 434 "../sncPhaseControl.stt" seq_pvPut(ssId, 1/*pvs*/ + (VAR_ID)(48), 0); # line 435 "../sncPhaseControl.stt" pvs[49] = ph24_2_u; # line 435 "../sncPhaseControl.stt" seq_pvPut(ssId, 1/*pvs*/ + (VAR_ID)(49), 0); #endif #ifdef DEBUG_MONPV # line 439 "../sncPhaseControl.stt" phase24_1 = ph24_1_u; # line 440 "../sncPhaseControl.stt" phase24_2 = ph24_2_u; # line 441 "../sncPhaseControl.stt" seq_pvPut(ssId, 60/*phase24_1*/, 0); # line 442 "../sncPhaseControl.stt" seq_pvPut(ssId, 61/*phase24_2*/, 0); #endif #ifdef DEBUG # line 446 "../sncPhaseControl.stt" seq_pvGet(ssId, 53/*klys1PV*/, 0); # line 447 "../sncPhaseControl.stt" seq_pvGet(ssId, 54/*klys2PV*/, 0); # line 448 "../sncPhaseControl.stt" epicsPrintf("-------------------\n"); # line 449 "../sncPhaseControl.stt" epicsPrintf("L2 Amplitude Change\n"); # line 450 "../sncPhaseControl.stt" epicsPrintf("-------------------\n"); # line 451 "../sncPhaseControl.stt" epicsPrintf("ph24_1(klys1PV): %lf : %lf\n", ph24_1, klys1PV); # line 452 "../sncPhaseControl.stt" epicsPrintf("ph24_2(klys2PV): %lf : %lf\n", ph24_2, klys2PV); # line 453 "../sncPhaseControl.stt" epicsPrintf("ph24_1_u: %lf : %lf\n", ph24_1_u, pvs[48]); # line 454 "../sncPhaseControl.stt" epicsPrintf("ph24_2_u: %lf : %lf\n", ph24_2_u, pvs[49]); # line 455 "../sncPhaseControl.stt" epicsPrintf("-------------------\n\n"); #endif } } # line 461 "../sncPhaseControl.stt" if (chgFlag[3]) { /* C code definitions */ # line 462 "../sncPhaseControl.stt" change = -1. * (data[3] - oldData[3]); # line 463 "../sncPhaseControl.stt" new_phase = data[9] - change * mdl_scale; # line 464 "../sncPhaseControl.stt" new_l2_phase = data[10] + change *l2_scale; # line 465 "../sncPhaseControl.stt" new_tcav3_phase_in = data[15] + change * tcav3_scale; # line 466 "../sncPhaseControl.stt" new_tcav3_phase_out = data[16] + change * tcav3_scale; # line 467 "../sncPhaseControl.stt" s21HH = data[17] + change * s21_2856_scale; # line 468 "../sncPhaseControl.stt" s21H = data[18] + change * s21_2856_scale; # line 469 "../sncPhaseControl.stt" s21L = data[19] + change * s21_2856_scale; # line 470 "../sncPhaseControl.stt" s21LL = data[20] + change * s21_2856_scale; # line 472 "../sncPhaseControl.stt" /* ----------------------------------------------- */ # line 473 "../sncPhaseControl.stt" #ifdef PERFORM_FEEDBACK # line 474 "../sncPhaseControl.stt" pvs[9] = new_phase; # line 474 "../sncPhaseControl.stt" seq_pvPut(ssId, 1/*pvs*/ + (VAR_ID)(9), 0); # line 475 "../sncPhaseControl.stt" pvs[10] = new_l2_phase; # line 475 "../sncPhaseControl.stt" seq_pvPut(ssId, 1/*pvs*/ + (VAR_ID)(10), 0); # line 476 "../sncPhaseControl.stt" pvs[15] = new_tcav3_phase_in; # line 476 "../sncPhaseControl.stt" seq_pvPut(ssId, 1/*pvs*/ + (VAR_ID)(15), 0); # line 477 "../sncPhaseControl.stt" pvs[16] = new_tcav3_phase_out; # line 477 "../sncPhaseControl.stt" seq_pvPut(ssId, 1/*pvs*/ + (VAR_ID)(16), 0); # line 478 "../sncPhaseControl.stt" pvs[17] = s21HH; # line 478 "../sncPhaseControl.stt" seq_pvPut(ssId, 1/*pvs*/ + (VAR_ID)(17), 0); # line 479 "../sncPhaseControl.stt" pvs[18] = s21H; # line 479 "../sncPhaseControl.stt" seq_pvPut(ssId, 1/*pvs*/ + (VAR_ID)(18), 0); # line 480 "../sncPhaseControl.stt" pvs[19] = s21L; # line 480 "../sncPhaseControl.stt" seq_pvPut(ssId, 1/*pvs*/ + (VAR_ID)(19), 0); # line 481 "../sncPhaseControl.stt" pvs[20] = s21LL; # line 481 "../sncPhaseControl.stt" seq_pvPut(ssId, 1/*pvs*/ + (VAR_ID)(20), 0); #endif #ifdef DEBUG_MONPV # line 485 "../sncPhaseControl.stt" pdes_ref = new_phase; # line 486 "../sncPhaseControl.stt" pdes_l2 = new_l2_phase; # line 487 "../sncPhaseControl.stt" poc_tcav3_0 = new_tcav3_phase_in; # line 488 "../sncPhaseControl.stt" poc_tcav3_1 = new_tcav3_phase_out; # line 489 "../sncPhaseControl.stt" seq_pvPut(ssId, 58/*pdes_ref*/, 0); # line 490 "../sncPhaseControl.stt" seq_pvPut(ssId, 59/*pdes_l2*/, 0); # line 491 "../sncPhaseControl.stt" seq_pvPut(ssId, 67/*poc_tcav3_0*/, 0); # line 492 "../sncPhaseControl.stt" seq_pvPut(ssId, 68/*poc_tcav3_1*/, 0); #endif #ifdef DEBUG # line 497 "../sncPhaseControl.stt" epicsPrintf("---------------------------------------------------------------\n"); # line 498 "../sncPhaseControl.stt" epicsPrintf("BC1 Phase Delay, move MDL and L2 phase shifter, fix tacv3 phase\n"); # line 499 "../sncPhaseControl.stt" epicsPrintf("---------------------------------------------------------------\n"); # line 500 "../sncPhaseControl.stt" epicsPrintf("new_phase: %lf : %lf\n", new_phase, pvs[9]); # line 501 "../sncPhaseControl.stt" epicsPrintf("new_l2_phase: %lf : %lf\n", new_l2_phase, pvs[10]); # line 502 "../sncPhaseControl.stt" epicsPrintf("new_tcav3_phase_in: %lf : %lf\n", new_tcav3_phase_in, pvs[15]); # line 503 "../sncPhaseControl.stt" epicsPrintf("new_tcav3_phase_out: %lf : %lf\n", new_tcav3_phase_out, pvs[16]); # line 504 "../sncPhaseControl.stt" epicsPrintf("s21HH: %lf : %lf\n", s21HH, pvs[17]); # line 505 "../sncPhaseControl.stt" epicsPrintf("s21H: %lf : %lf\n", s21H, pvs[18]); # line 506 "../sncPhaseControl.stt" epicsPrintf("s21L: %lf : %lf\n", s21L, pvs[19]); # line 507 "../sncPhaseControl.stt" epicsPrintf("s21LL: %lf : %lf\n", s21LL, pvs[20]); # line 508 "../sncPhaseControl.stt" epicsPrintf("---------------------------------------------------------------\n\n"); #endif } # line 513 "../sncPhaseControl.stt" if ((chgFlag[4] || chgFlag[5]) && activate_abstraction) { /* C code definitions */ # line 514 "../sncPhaseControl.stt" pchange = data[4] - oldData[4]; # line 515 "../sncPhaseControl.stt" ofchange = data[5] - oldData[5]; # line 516 "../sncPhaseControl.stt" change = pchange + ofchange; # line 517 "../sncPhaseControl.stt" new_phase = data[10] + change * l2_scale; # line 518 "../sncPhaseControl.stt" s21HH = data[17] + change * s21_2856_scale; # line 519 "../sncPhaseControl.stt" s21H = data[18] + change * s21_2856_scale; # line 520 "../sncPhaseControl.stt" s21L = data[19] + change * s21_2856_scale; # line 521 "../sncPhaseControl.stt" s21LL = data[20] + change * s21_2856_scale; # line 522 "../sncPhaseControl.stt" if(kly_selector == 0 || kly_selector == 2) fb_off[1] = data[11] - change * fb_station_scale; # line 523 "../sncPhaseControl.stt" if(kly_selector == 0 || kly_selector == 1) fb_off[2] = data[12] - change * fb_station_scale; # line 524 "../sncPhaseControl.stt" if(kly_selector == 1 || kly_selector == 2) fb_off[3] = data[13] - change * fb_station_scale; # line 526 "../sncPhaseControl.stt" if((pchange != 0.) && (int)data[1] && ~(int)data[43]) { # line 527 "../sncPhaseControl.stt" requested_fb = data[2] - data[22] * data[23]; # line 528 "../sncPhaseControl.stt" set_feedback_klystrons(data[4], requested_fb, station_energy, # line 529 "../sncPhaseControl.stt" &ph24_1_u, &ph24_2_u); # line 530 "../sncPhaseControl.stt" ph24_1 = ph24_1_u * fb_station_scale; # line 531 "../sncPhaseControl.stt" ph24_2 = ph24_2_u * fb_station_scale; # line 533 "../sncPhaseControl.stt" /* ---------------------------------------------- */ # line 534 "../sncPhaseControl.stt" #ifdef PERFORM_FEEDBACK # line 535 "../sncPhaseControl.stt" pvs[10] = new_phase; # line 535 "../sncPhaseControl.stt" seq_pvPut(ssId, 1/*pvs*/ + (VAR_ID)(10), 0); # line 536 "../sncPhaseControl.stt" if (kly_selector == 0 || kly_selector == 2) { # line 536 "../sncPhaseControl.stt" pvs[11] = fb_off[1]; # line 536 "../sncPhaseControl.stt" seq_pvPut(ssId, 1/*pvs*/ + (VAR_ID)(11), 0); } # line 537 "../sncPhaseControl.stt" if (kly_selector == 0 || kly_selector == 1) { # line 537 "../sncPhaseControl.stt" pvs[12] = fb_off[2]; # line 537 "../sncPhaseControl.stt" seq_pvPut(ssId, 1/*pvs*/ + (VAR_ID)(12), 0); } # line 538 "../sncPhaseControl.stt" if (kly_selector == 1 || kly_selector == 2) { # line 538 "../sncPhaseControl.stt" pvs[13] = fb_off[3]; # line 538 "../sncPhaseControl.stt" seq_pvPut(ssId, 1/*pvs*/ + (VAR_ID)(13), 0); } # line 539 "../sncPhaseControl.stt" pvs[17] = s21HH; # line 539 "../sncPhaseControl.stt" seq_pvPut(ssId, 1/*pvs*/ + (VAR_ID)(17), 0); # line 540 "../sncPhaseControl.stt" pvs[18] = s21H; # line 540 "../sncPhaseControl.stt" seq_pvPut(ssId, 1/*pvs*/ + (VAR_ID)(18), 0); # line 541 "../sncPhaseControl.stt" pvs[19] = s21L; # line 541 "../sncPhaseControl.stt" seq_pvPut(ssId, 1/*pvs*/ + (VAR_ID)(19), 0); # line 542 "../sncPhaseControl.stt" pvs[20] = s21LL; # line 542 "../sncPhaseControl.stt" seq_pvPut(ssId, 1/*pvs*/ + (VAR_ID)(20), 0); # line 543 "../sncPhaseControl.stt" klys1PV = ph24_1; # line 543 "../sncPhaseControl.stt" seq_pvPut(ssId, 53/*klys1PV*/, 0); # line 544 "../sncPhaseControl.stt" klys2PV = ph24_2; # line 544 "../sncPhaseControl.stt" seq_pvPut(ssId, 54/*klys2PV*/, 0); # line 545 "../sncPhaseControl.stt" pvs[48] = ph24_1_u; # line 545 "../sncPhaseControl.stt" seq_pvPut(ssId, 1/*pvs*/ + (VAR_ID)(48), 0); # line 546 "../sncPhaseControl.stt" pvs[49] = ph24_2_u; # line 546 "../sncPhaseControl.stt" seq_pvPut(ssId, 1/*pvs*/ + (VAR_ID)(49), 0); #endif #ifdef DEBUG_MONPV # line 550 "../sncPhaseControl.stt" pdes_l2 = new_phase; # line 551 "../sncPhaseControl.stt" poc_24_1 = fb_off[1]; # line 552 "../sncPhaseControl.stt" poc_24_2 = fb_off[2]; # line 553 "../sncPhaseControl.stt" poc_24_3 = fb_off[3]; # line 554 "../sncPhaseControl.stt" phase24_1 = ph24_1_u; # line 555 "../sncPhaseControl.stt" phase24_2 = ph24_2_u; # line 556 "../sncPhaseControl.stt" seq_pvPut(ssId, 59/*pdes_l2*/, 0); # line 557 "../sncPhaseControl.stt" seq_pvPut(ssId, 64/*poc_24_1*/, 0); # line 558 "../sncPhaseControl.stt" seq_pvPut(ssId, 65/*poc_24_2*/, 0); # line 559 "../sncPhaseControl.stt" seq_pvPut(ssId, 66/*poc_24_3*/, 0); # line 560 "../sncPhaseControl.stt" seq_pvPut(ssId, 60/*phase24_1*/, 0); # line 561 "../sncPhaseControl.stt" seq_pvPut(ssId, 61/*phase24_2*/, 0); #endif #ifdef DEBUG # line 565 "../sncPhaseControl.stt" seq_pvGet(ssId, 53/*klys1PV*/, 0); # line 566 "../sncPhaseControl.stt" seq_pvGet(ssId, 54/*klys2PV*/, 0); # line 567 "../sncPhaseControl.stt" epicsPrintf("-------------------------------\n"); # line 568 "../sncPhaseControl.stt" epicsPrintf("L2 Phase or phase offset change\n"); # line 569 "../sncPhaseControl.stt" epicsPrintf("-------------------------------\n"); # line 570 "../sncPhaseControl.stt" epicsPrintf("new_phase: %lf : %lf\n", new_phase, pvs[10]); # line 571 "../sncPhaseControl.stt" epicsPrintf("fb_off[1]: %lf : %lf\n", fb_off[1], pvs[11]); # line 572 "../sncPhaseControl.stt" epicsPrintf("fb_off[2]: %lf : %lf\n", fb_off[2], pvs[12]); # line 573 "../sncPhaseControl.stt" epicsPrintf("fb_off[3]: %lf : %lf\n", fb_off[3], pvs[13]); # line 574 "../sncPhaseControl.stt" epicsPrintf("s21HH: %lf : %lf\n", s21HH, pvs[17]); # line 575 "../sncPhaseControl.stt" epicsPrintf("s21H: %lf : %lf\n", s21H, pvs[18]); # line 576 "../sncPhaseControl.stt" epicsPrintf("s21L: %lf : %lf\n", s21L, pvs[19]); # line 577 "../sncPhaseControl.stt" epicsPrintf("s21LL: %lf : %lf\n", s21LL, pvs[20]); # line 578 "../sncPhaseControl.stt" epicsPrintf("ph24_1: %lf : %lf\n", ph24_1, klys1PV); # line 579 "../sncPhaseControl.stt" epicsPrintf("ph24_2: %lf : %lf\n", ph24_2, klys2PV); # line 580 "../sncPhaseControl.stt" epicsPrintf("ph24_1_u: %lf : %lf\n", ph24_1_u, pvs[48]); # line 581 "../sncPhaseControl.stt" epicsPrintf("ph24_2_u: %lf : %lf\n", ph24_2_u, pvs[49]); # line 582 "../sncPhaseControl.stt" epicsPrintf("-------------------------------\n\n"); #endif } else { #ifdef PERFORM_FEEDBACK # line 586 "../sncPhaseControl.stt" pvs[10] = new_phase; # line 586 "../sncPhaseControl.stt" seq_pvPut(ssId, 1/*pvs*/ + (VAR_ID)(10), 0); # line 587 "../sncPhaseControl.stt" if (kly_selector == 0 || kly_selector == 2) { # line 587 "../sncPhaseControl.stt" pvs[11] = fb_off[1]; # line 587 "../sncPhaseControl.stt" seq_pvPut(ssId, 1/*pvs*/ + (VAR_ID)(11), 0); } # line 588 "../sncPhaseControl.stt" if (kly_selector == 0 || kly_selector == 1) { # line 588 "../sncPhaseControl.stt" pvs[12] = fb_off[2]; # line 588 "../sncPhaseControl.stt" seq_pvPut(ssId, 1/*pvs*/ + (VAR_ID)(12), 0); } # line 589 "../sncPhaseControl.stt" if (kly_selector == 1 || kly_selector == 2) { # line 589 "../sncPhaseControl.stt" pvs[13] = fb_off[3]; # line 589 "../sncPhaseControl.stt" seq_pvPut(ssId, 1/*pvs*/ + (VAR_ID)(13), 0); } # line 590 "../sncPhaseControl.stt" pvs[17] = s21HH; # line 590 "../sncPhaseControl.stt" seq_pvPut(ssId, 1/*pvs*/ + (VAR_ID)(17), 0); # line 591 "../sncPhaseControl.stt" pvs[18] = s21H; # line 591 "../sncPhaseControl.stt" seq_pvPut(ssId, 1/*pvs*/ + (VAR_ID)(18), 0); # line 592 "../sncPhaseControl.stt" pvs[19] = s21L; # line 592 "../sncPhaseControl.stt" seq_pvPut(ssId, 1/*pvs*/ + (VAR_ID)(19), 0); # line 593 "../sncPhaseControl.stt" pvs[20] = s21LL; # line 593 "../sncPhaseControl.stt" seq_pvPut(ssId, 1/*pvs*/ + (VAR_ID)(20), 0); #endif #ifdef DEBUG_MONPV # line 597 "../sncPhaseControl.stt" pdes_l2 = new_phase; # line 598 "../sncPhaseControl.stt" poc_24_1 = fb_off[1]; # line 599 "../sncPhaseControl.stt" poc_24_2 = fb_off[2]; # line 600 "../sncPhaseControl.stt" poc_24_3 = fb_off[3]; # line 601 "../sncPhaseControl.stt" seq_pvPut(ssId, 59/*pdes_l2*/, 0); # line 602 "../sncPhaseControl.stt" seq_pvPut(ssId, 64/*poc_24_1*/, 0); # line 603 "../sncPhaseControl.stt" seq_pvPut(ssId, 65/*poc_24_2*/, 0); # line 604 "../sncPhaseControl.stt" seq_pvPut(ssId, 66/*poc_24_3*/, 0); #endif #ifdef DEBUG # line 608 "../sncPhaseControl.stt" epicsPrintf("-------------------------------\n"); # line 609 "../sncPhaseControl.stt" epicsPrintf("L2 Phase or phase offset change\n"); # line 610 "../sncPhaseControl.stt" epicsPrintf("-------------------------------\n"); # line 611 "../sncPhaseControl.stt" epicsPrintf("new_phase: %lf : %lf\n", new_phase, pvs[10]); # line 612 "../sncPhaseControl.stt" epicsPrintf("fb_off[1]: %lf : %lf\n", fb_off[1], pvs[11]); # line 613 "../sncPhaseControl.stt" epicsPrintf("fb_off[2]: %lf : %lf\n", fb_off[2], pvs[12]); # line 614 "../sncPhaseControl.stt" epicsPrintf("fb_off[3]: %lf : %lf\n", fb_off[3], pvs[13]); # line 615 "../sncPhaseControl.stt" epicsPrintf("s21HH: %lf : %lf\n", s21HH, pvs[17]); # line 616 "../sncPhaseControl.stt" epicsPrintf("s21H: %lf : %lf\n", s21H, pvs[18]); # line 617 "../sncPhaseControl.stt" epicsPrintf("s21L: %lf : %lf\n", s21L, pvs[19]); # line 618 "../sncPhaseControl.stt" epicsPrintf("s21LL: %lf : %lf\n", s21LL, pvs[20]); # line 619 "../sncPhaseControl.stt" epicsPrintf("-------------------------------\n"); #endif } } # line 625 "../sncPhaseControl.stt" if (chgFlag[6]) { /* C code definitions */ # line 626 "../sncPhaseControl.stt" change = -1. * (data[6] - oldData[6]); # line 627 "../sncPhaseControl.stt" new_phase = data[9] - change *mdl_scale; # line 628 "../sncPhaseControl.stt" new_tcav3_phase_in = data[15] + change * tcav3_scale; # line 629 "../sncPhaseControl.stt" new_tcav3_phase_out = data[16] + change * tcav3_scale; # line 631 "../sncPhaseControl.stt" /* --------------------------------------------------- */ # line 632 "../sncPhaseControl.stt" #ifdef PERFORM_FEEDBACK # line 633 "../sncPhaseControl.stt" pvs[9] = new_phase; # line 633 "../sncPhaseControl.stt" seq_pvPut(ssId, 1/*pvs*/ + (VAR_ID)(9), 0); # line 634 "../sncPhaseControl.stt" pvs[15] = new_tcav3_phase_in; # line 634 "../sncPhaseControl.stt" seq_pvPut(ssId, 1/*pvs*/ + (VAR_ID)(15), 0); # line 635 "../sncPhaseControl.stt" pvs[16] = new_tcav3_phase_out; # line 635 "../sncPhaseControl.stt" seq_pvPut(ssId, 1/*pvs*/ + (VAR_ID)(16), 0); #endif #ifdef DEBUG_MONPV # line 639 "../sncPhaseControl.stt" pdes_l2 = new_phase; # line 640 "../sncPhaseControl.stt" poc_tcav3_0 = new_tcav3_phase_in; # line 641 "../sncPhaseControl.stt" poc_tcav3_1 = new_tcav3_phase_out; # line 642 "../sncPhaseControl.stt" seq_pvPut(ssId, 59/*pdes_l2*/, 0); # line 643 "../sncPhaseControl.stt" seq_pvPut(ssId, 67/*poc_tcav3_0*/, 0); # line 644 "../sncPhaseControl.stt" seq_pvPut(ssId, 68/*poc_tcav3_1*/, 0); #endif #ifdef DEBUG # line 648 "../sncPhaseControl.stt" epicsPrintf("----------------------\n"); # line 649 "../sncPhaseControl.stt" epicsPrintf("Change BC2 phase delay\n"); # line 650 "../sncPhaseControl.stt" epicsPrintf("----------------------\n"); # line 651 "../sncPhaseControl.stt" epicsPrintf("new_phase: %lf : %lf\n", new_phase, pvs[9]); # line 652 "../sncPhaseControl.stt" epicsPrintf("new_tcav3_phase_in: %lf : %lf\n", new_tcav3_phase_in, pvs[15]); # line 653 "../sncPhaseControl.stt" epicsPrintf("new_tcav3_phase_out: %lf : %lf\n", new_tcav3_phase_out, pvs[16]); # line 654 "../sncPhaseControl.stt" epicsPrintf("----------------------\n\n"); #endif } # line 659 "../sncPhaseControl.stt" if ((chgFlag[7] || chgFlag[8]) && activate_abstraction) { /* C code definitions */ # line 660 "../sncPhaseControl.stt" pchange = data[7] - oldData[7]; # line 661 "../sncPhaseControl.stt" ofchange = data[8] - oldData[8]; # line 662 "../sncPhaseControl.stt" change = pchange + ofchange; # line 663 "../sncPhaseControl.stt" new_phase = data[9] - change * mdl_scale; # line 664 "../sncPhaseControl.stt" S29_new = data[39] - change * S2930_station_scale; # line 665 "../sncPhaseControl.stt" S30_new = data[40] - change * S2930_station_scale; # line 666 "../sncPhaseControl.stt" if((pchange != 0.) && (int)data[1] && ~(int)data[43]) { # line 667 "../sncPhaseControl.stt" requested_fb3 = data[34] - data[35] * data[36]; # line 668 "../sncPhaseControl.stt" set_feedback_stations(data[7], requested_fb3, data[37], data[38], # line 669 "../sncPhaseControl.stt" &S29_u, &S30_u); # line 670 "../sncPhaseControl.stt" S29 = S29_u * S2930_station_scale; # line 671 "../sncPhaseControl.stt" S30 = S30_u * S2930_station_scale; # line 673 "../sncPhaseControl.stt" /* ------------------------------------------- */ # line 675 "../sncPhaseControl.stt" #ifdef PERFORM_FEEDBACK # line 676 "../sncPhaseControl.stt" pvs[9] = new_phase; # line 676 "../sncPhaseControl.stt" seq_pvPut(ssId, 1/*pvs*/ + (VAR_ID)(9), 0); # line 677 "../sncPhaseControl.stt" pvs[39] = S29_new; # line 677 "../sncPhaseControl.stt" seq_pvPut(ssId, 1/*pvs*/ + (VAR_ID)(39), 0); # line 678 "../sncPhaseControl.stt" pvs[40] = S30_new; # line 678 "../sncPhaseControl.stt" seq_pvPut(ssId, 1/*pvs*/ + (VAR_ID)(40), 0); # line 679 "../sncPhaseControl.stt" s29PV = S29; # line 679 "../sncPhaseControl.stt" seq_pvPut(ssId, 51/*s29PV*/, 0); # line 680 "../sncPhaseControl.stt" s30PV = S30; # line 680 "../sncPhaseControl.stt" seq_pvPut(ssId, 52/*s30PV*/, 0); # line 681 "../sncPhaseControl.stt" pvs[46] = S29_u; # line 681 "../sncPhaseControl.stt" seq_pvPut(ssId, 1/*pvs*/ + (VAR_ID)(46), 0); # line 682 "../sncPhaseControl.stt" pvs[47] = S30_u; # line 682 "../sncPhaseControl.stt" seq_pvPut(ssId, 1/*pvs*/ + (VAR_ID)(47), 0); #endif #ifdef DEBUG_MONPV # line 686 "../sncPhaseControl.stt" pdes_l2 = new_phase; # line 687 "../sncPhaseControl.stt" poc_s29 = S29_new; # line 688 "../sncPhaseControl.stt" poc_s30 = S30_new; # line 689 "../sncPhaseControl.stt" phase_s29 = S29_u; # line 690 "../sncPhaseControl.stt" phase_s30 = S30_u; # line 691 "../sncPhaseControl.stt" seq_pvPut(ssId, 59/*pdes_l2*/, 0); # line 692 "../sncPhaseControl.stt" seq_pvPut(ssId, 69/*poc_s29*/, 0); # line 693 "../sncPhaseControl.stt" seq_pvPut(ssId, 70/*poc_s30*/, 0); # line 694 "../sncPhaseControl.stt" seq_pvPut(ssId, 62/*phase_s29*/, 0); # line 695 "../sncPhaseControl.stt" seq_pvPut(ssId, 63/*phase_s30*/, 0); #endif #ifdef DEBUG # line 699 "../sncPhaseControl.stt" seq_pvGet(ssId, 51/*s29PV*/, 0); # line 700 "../sncPhaseControl.stt" seq_pvGet(ssId, 52/*s30PV*/, 0); # line 701 "../sncPhaseControl.stt" epicsPrintf("-------------------------\n"); # line 702 "../sncPhaseControl.stt" epicsPrintf("L3 phase or offset change\n"); # line 703 "../sncPhaseControl.stt" epicsPrintf("-------------------------\n"); # line 704 "../sncPhaseControl.stt" epicsPrintf("new_phase: %lf : %lf\n", new_phase, pvs[9]); # line 705 "../sncPhaseControl.stt" epicsPrintf("S29_new: %lf : %lf\n", S29_new, pvs[39]); # line 706 "../sncPhaseControl.stt" epicsPrintf("S30_new: %lf : %lf\n", S30_new, pvs[40]); # line 707 "../sncPhaseControl.stt" epicsPrintf("S29: %lf : %lf\n", S29, s29PV); # line 708 "../sncPhaseControl.stt" epicsPrintf("S30: %lf : %lf\n", S30, s30PV); # line 709 "../sncPhaseControl.stt" epicsPrintf("S29_u: %lf : %lf\n", S29_u, pvs[46]); # line 710 "../sncPhaseControl.stt" epicsPrintf("S30_u: %lf : %lf\n", S30_u, pvs[47]); # line 711 "../sncPhaseControl.stt" epicsPrintf("-------------------------\n\n"); #endif } else { #ifdef PERFORM_FEEDBACK # line 716 "../sncPhaseControl.stt" pvs[9] = new_phase; # line 716 "../sncPhaseControl.stt" seq_pvPut(ssId, 1/*pvs*/ + (VAR_ID)(9), 0); # line 717 "../sncPhaseControl.stt" pvs[39] = S29_new; # line 717 "../sncPhaseControl.stt" seq_pvPut(ssId, 1/*pvs*/ + (VAR_ID)(39), 0); # line 718 "../sncPhaseControl.stt" pvs[40] = S30_new; # line 718 "../sncPhaseControl.stt" seq_pvPut(ssId, 1/*pvs*/ + (VAR_ID)(40), 0); #endif #ifdef DEBUG_MONPV # line 722 "../sncPhaseControl.stt" pdes_l2 = new_phase; # line 723 "../sncPhaseControl.stt" phase_s29 = S29_new; # line 724 "../sncPhaseControl.stt" phase_s30 = S30_new; # line 725 "../sncPhaseControl.stt" seq_pvPut(ssId, 59/*pdes_l2*/, 0); # line 726 "../sncPhaseControl.stt" seq_pvPut(ssId, 62/*phase_s29*/, 0); # line 727 "../sncPhaseControl.stt" seq_pvPut(ssId, 63/*phase_s30*/, 0); #endif #ifdef DEBUG # line 731 "../sncPhaseControl.stt" epicsPrintf("-------------------------\n"); # line 732 "../sncPhaseControl.stt" epicsPrintf("L3 phase or offset change\n"); # line 733 "../sncPhaseControl.stt" epicsPrintf("-------------------------\n"); # line 734 "../sncPhaseControl.stt" epicsPrintf("new_phase: %lf : %lf\n", new_phase, pvs[9]); # line 735 "../sncPhaseControl.stt" epicsPrintf("S29_new: %lf : %lf\n", S29_new, pvs[39]); # line 736 "../sncPhaseControl.stt" epicsPrintf("S30_new: %lf : %lf\n", S30_new, pvs[40]); # line 737 "../sncPhaseControl.stt" epicsPrintf("-------------------------\n\n"); #endif } } # line 743 "../sncPhaseControl.stt" if (chgFlag[24]) { /* C code definitions */ # line 744 "../sncPhaseControl.stt" #ifdef DEUG # line 745 "../sncPhaseControl.stt" epicsPrintf("---------------------------------\n"); # line 746 "../sncPhaseControl.stt" epicsPrintf("Laser Heater chicain phase change\n"); # line 747 "../sncPhaseControl.stt" epicsPrintf("---------------------------------\n"); #endif change = data[24] - oldData[24]; for(i=25; i<=33; i++) { newPhase[i-25] = data[i] + change * injector_scale; #ifdef PERFORM_FEEDBACK # line 755 "../sncPhaseControl.stt" pvs[i] = newPhase[i - 25]; # line 755 "../sncPhaseControl.stt" seq_pvPut(ssId, 1/*pvs*/ + (VAR_ID)(i), 0); #endif #ifdef DEBUG # line 759 "../sncPhaseControl.stt" epicsPrintf("newPhase[%d]: %lf : %lf\n", i - 25, newPhase[i - 25], pvs[i]); #endif } #ifdef DEBUG # line 765 "../sncPhaseControl.stt" epicsPrintf("---------------------------------\n\n"); #endif } # line 770 "../sncPhaseControl.stt" if ((chgFlag[1] || chgFlag[34] || chgFlag[35] || chgFlag[36] || chgFlag[37] || chgFlag[38] || chgFlag[43]) && activate_abstraction) { /* C code definitions */ # line 772 "../sncPhaseControl.stt" if((int)data[1] && ~(int)data[43]) { # line 773 "../sncPhaseControl.stt" requested_fb3 = data[34] - data[35] * data[36]; # line 774 "../sncPhaseControl.stt" set_feedback_stations(data[7], requested_fb3, data[37], data[38], # line 775 "../sncPhaseControl.stt" &S29_u, &S30_u); # line 776 "../sncPhaseControl.stt" S29 = S29_u * S2930_station_scale; # line 777 "../sncPhaseControl.stt" S30 = S30_u * S2930_station_scale; # line 779 "../sncPhaseControl.stt" /* ------------------------------------ */ # line 781 "../sncPhaseControl.stt" #ifdef PERFORM_FEEDBACK # line 782 "../sncPhaseControl.stt" s29PV = S29; # line 782 "../sncPhaseControl.stt" seq_pvPut(ssId, 51/*s29PV*/, 0); # line 783 "../sncPhaseControl.stt" s30PV = S30; # line 783 "../sncPhaseControl.stt" seq_pvPut(ssId, 52/*s30PV*/, 0); # line 784 "../sncPhaseControl.stt" pvs[46] = S29_u; # line 784 "../sncPhaseControl.stt" seq_pvPut(ssId, 1/*pvs*/ + (VAR_ID)(46), 0); # line 785 "../sncPhaseControl.stt" pvs[47] = S30_u; # line 785 "../sncPhaseControl.stt" seq_pvPut(ssId, 1/*pvs*/ + (VAR_ID)(47), 0); #endif #ifdef DEBUG_MONPV # line 790 "../sncPhaseControl.stt" phase_s29 = S29_u; # line 791 "../sncPhaseControl.stt" phase_s30 = S30_u; # line 792 "../sncPhaseControl.stt" seq_pvPut(ssId, 62/*phase_s29*/, 0); # line 793 "../sncPhaseControl.stt" seq_pvPut(ssId, 63/*phase_s30*/, 0); #endif #ifdef DEBUG # line 797 "../sncPhaseControl.stt" seq_pvGet(ssId, 51/*s29PV*/, 0); # line 798 "../sncPhaseControl.stt" seq_pvGet(ssId, 52/*s30PV*/, 0); # line 799 "../sncPhaseControl.stt" epicsPrintf("-------------------\n"); # line 800 "../sncPhaseControl.stt" epicsPrintf("Change in L3 energy\n"); # line 801 "../sncPhaseControl.stt" epicsPrintf("-------------------\n"); # line 802 "../sncPhaseControl.stt" epicsPrintf("S29 : %lf : %lf\n", S29, s29PV); # line 803 "../sncPhaseControl.stt" epicsPrintf("S30 : %lf : %lf\n", S30, s30PV); # line 804 "../sncPhaseControl.stt" epicsPrintf("S29_u: %lf : %lf\n", S29_u, pvs[46]); # line 805 "../sncPhaseControl.stt" epicsPrintf("S30_u: %lf : %lf\n", S30_u, pvs[47]); # line 806 "../sncPhaseControl.stt" epicsPrintf("-------------------\n\n"); #endif } } } return; } } /****** Code for state "donePhaseControl" in state set "phasControl" ******/ /* Delay function for state "donePhaseControl" in state set "phasControl" */ static void D_phasControl_donePhaseControl(SS_ID ssId, struct UserVar *pVar) { } /* Event function for state "donePhaseControl" in state set "phasControl" */ static seqBool E_phasControl_donePhaseControl(SS_ID ssId, struct UserVar *pVar, int *pTransNum, int *pNextState) { # line 818 "../sncPhaseControl.stt" if (TRUE) { *pNextState = 0; *pTransNum = 0; return TRUE; } return FALSE; } /* Action function for state "donePhaseControl" in state set "phasControl" */ static void A_phasControl_donePhaseControl(SS_ID ssId, struct UserVar *pVar, int transNum, int *pNextState) { switch(transNum) { case 0: { # line 819 "../sncPhaseControl.stt" seq_efSet(ssId, 3/*done_flag*/); } return; } } /************************ Tables ************************/ /* Channel table */ static seqChan G_channels[] = { /* chName, offset, varName, varType, count, eventNum, efId, monitored, queueSize, queueIndex */ {"{IOC}:ABSTRACTION", (size_t)&activate_abstraction, "activate_abstraction", "int", 1, 5, 0, 1, 0, 0}, {"SIOC:SYS0:ML00:AO057", (size_t)&pvs[0], "pvs[0]", "double", 1, 6, 1, 1, 0, 0}, {"SIOC:SYS0:ML00:AO058", (size_t)&pvs[1], "pvs[1]", "double", 1, 7, 1, 1, 0, 0}, {"SIOC:SYS0:ML00:AO059", (size_t)&pvs[2], "pvs[2]", "double", 1, 8, 1, 1, 0, 0}, {"SIOC:SYS0:ML00:AO060", (size_t)&pvs[3], "pvs[3]", "double", 1, 9, 1, 1, 0, 0}, {"SIOC:SYS0:ML00:AO061", (size_t)&pvs[4], "pvs[4]", "double", 1, 10, 1, 1, 0, 0}, {"SIOC:SYS0:ML00:AO062", (size_t)&pvs[5], "pvs[5]", "double", 1, 11, 1, 1, 0, 0}, {"SIOC:SYS0:ML00:AO063", (size_t)&pvs[6], "pvs[6]", "double", 1, 12, 1, 1, 0, 0}, {"SIOC:SYS0:ML00:AO064", (size_t)&pvs[7], "pvs[7]", "double", 1, 13, 1, 1, 0, 0}, {"SIOC:SYS0:ML00:AO065", (size_t)&pvs[8], "pvs[8]", "double", 1, 14, 1, 1, 0, 0}, {"LLRF:IN20:RH:REF_2_PDES", (size_t)&pvs[9], "pvs[9]", "double", 1, 15, 1, 1, 0, 0}, {"LLRF:IN20:RH:L2_PDES", (size_t)&pvs[10], "pvs[10]", "double", 1, 16, 1, 1, 0, 0}, {"ACCL:LI24:200:KLY_POC", (size_t)&pvs[11], "pvs[11]", "double", 1, 17, 1, 1, 0, 0}, {"TCAV:LI24:800:TC3_PDES", (size_t)&pvs[12], "pvs[12]", "double", 1, 18, 1, 1, 0, 0}, {"TCAV:LI24:800:TC3_0_POC", (size_t)&pvs[13], "pvs[13]", "double", 1, 19, 1, 1, 0, 0}, {"TCAV:LI24:800:TC3_1_POC", (size_t)&pvs[14], "pvs[14]", "double", 1, 20, 1, 1, 0, 0}, {"LLRF:IN20:RH:REF_1_S_PA.HIHI", (size_t)&pvs[15], "pvs[15]", "double", 1, 21, 1, 1, 0, 0}, {"LLRF:IN20:RH:REF_1_S_PA.HIGH", (size_t)&pvs[16], "pvs[16]", "double", 1, 22, 1, 1, 0, 0}, {"LLRF:IN20:RH:REF_1_S_PA.LOW", (size_t)&pvs[17], "pvs[17]", "double", 1, 23, 1, 1, 0, 0}, {"LLRF:IN20:RH:REF_1_S_PA.LOLO", (size_t)&pvs[18], "pvs[18]", "double", 1, 24, 1, 1, 0, 0}, {"SIOC:SYS0:ML00:AO066", (size_t)&pvs[19], "pvs[19]", "double", 1, 25, 1, 1, 0, 0}, {"SIOC:SYS0:ML00:AO278", (size_t)&pvs[20], "pvs[20]", "double", 1, 26, 1, 1, 0, 0}, {"SIOC:SYS0:ML00:AO067", (size_t)&pvs[21], "pvs[21]", "double", 1, 27, 1, 1, 0, 0}, {"SIOC:SYS0:ML00:AO080", (size_t)&pvs[22], "pvs[22]", "double", 1, 28, 1, 1, 0, 0}, {"OSC:LR20:20:POC", (size_t)&pvs[23], "pvs[23]", "double", 1, 29, 1, 1, 0, 0}, {"GUN:IN20:1:GN1_0_POC", (size_t)&pvs[24], "pvs[24]", "double", 1, 30, 1, 1, 0, 0}, {"GUN:IN20:1:GN1_1_POC", (size_t)&pvs[25], "pvs[25]", "double", 1, 31, 1, 1, 0, 0}, {"GUN:IN20:1:GN1_2_POC", (size_t)&pvs[26], "pvs[26]", "double", 1, 32, 1, 1, 0, 0}, {"GUN:IN20:1:GN1_3_POC", (size_t)&pvs[27], "pvs[27]", "double", 1, 33, 1, 1, 0, 0}, {"ACCL:IN20:300:L0A_0_POC", (size_t)&pvs[28], "pvs[28]", "double", 1, 34, 1, 1, 0, 0}, {"ACCL:IN20:300:L0A_1_POC", (size_t)&pvs[29], "pvs[29]", "double", 1, 35, 1, 1, 0, 0}, {"ACCL:IN20:400:L0B_2_POC", (size_t)&pvs[30], "pvs[30]", "double", 1, 36, 1, 1, 0, 0}, {"ACCL:IN20:400:L0B_3_POC", (size_t)&pvs[31], "pvs[31]", "double", 1, 37, 1, 1, 0, 0}, {"SIOC:SYS0:ML00:AO075", (size_t)&pvs[32], "pvs[32]", "double", 1, 38, 1, 1, 0, 0}, {"SIOC:SYS0:ML00:AO079", (size_t)&pvs[33], "pvs[33]", "double", 1, 39, 1, 1, 0, 0}, {"SIOC:SYS0:ML00:AO279", (size_t)&pvs[34], "pvs[34]", "double", 1, 40, 1, 1, 0, 0}, {"SIOC:SYS0:ML00:AO280", (size_t)&pvs[35], "pvs[35]", "double", 1, 41, 1, 1, 0, 0}, {"SIOC:SYS0:ML00:AO281", (size_t)&pvs[36], "pvs[36]", "double", 1, 42, 1, 1, 0, 0}, {"ACCL:LI29:0:KLY_POC", (size_t)&pvs[37], "pvs[37]", "double", 1, 43, 1, 1, 0, 0}, {"ACCL:LI30:0:KLY_POC", (size_t)&pvs[38], "pvs[38]", "double", 1, 44, 1, 1, 0, 0}, {"ACCL:LI29:0:KLY_PDES", (size_t)&pvs[39], "pvs[39]", "double", 1, 45, 1, 1, 0, 0}, {"ACCL:LI30:0:KLY_PDES", (size_t)&pvs[40], "pvs[40]", "double", 1, 46, 1, 1, 0, 0}, {"SIOC:SYS0:ML00:AO017", (size_t)&pvs[41], "pvs[41]", "double", 1, 47, 1, 1, 0, 0}, {"OSC:LR20:10:POC", (size_t)&pvs[42], "pvs[42]", "double", 1, 48, 1, 1, 0, 0}, {"SIOC:SYS0:ML00:AO093", (size_t)&pvs[43], "pvs[43]", "double", 1, 49, 1, 1, 0, 0}, {"SIOC:SYS0:ML00:AO094", (size_t)&pvs[44], "pvs[44]", "double", 1, 50, 1, 1, 0, 0}, {"SIOC:SYS0:ML00:AO095", (size_t)&pvs[45], "pvs[45]", "double", 1, 51, 1, 1, 0, 0}, {"SIOC:SYS0:ML00:AO096", (size_t)&pvs[46], "pvs[46]", "double", 1, 52, 1, 1, 0, 0}, {"SIOC:SYS0:ML00:AO097", (size_t)&pvs[47], "pvs[47]", "double", 1, 53, 1, 1, 0, 0}, {"", (size_t)&pvs[48], "pvs[48]", "double", 1, 54, 1, 1, 0, 0}, {"", (size_t)&pvs[49], "pvs[49]", "double", 1, 55, 1, 1, 0, 0}, {"ACCL:LI29:0:KLY_PDES", (size_t)&s29PV, "s29PV", "double", 1, 56, 0, 0, 0, 0}, {"ACCL:LI30:0:KLY_PDES", (size_t)&s30PV, "s30PV", "double", 1, 57, 0, 0, 0, 0}, {"ACCL:LI24:100:KLY_PDES", (size_t)&klys1PV, "klys1PV", "double", 1, 58, 0, 0, 0, 0}, {"ACCL:LI24:300:KLY_PDES", (size_t)&klys2PV, "klys2PV", "double", 1, 59, 0, 0, 0, 0}, {"{IOC}:MISSING_RATE", (size_t)&missing_rate, "missing_rate", "unsigned int", 1, 60, 0, 0, 0, 0}, {"{IOC}:EVENT_RATE", (size_t)&event_rate, "event_rate", "unsigned int", 1, 61, 0, 0, 0, 0}, {"{IOC}:EXECUTION_RATE", (size_t)&execution_rate, "execution_rate", "unsigned int", 1, 62, 0, 0, 0, 0}, {"{IOC}:PDES:REF", (size_t)&pdes_ref, "pdes_ref", "double", 1, 63, 0, 0, 0, 0}, {"{IOC}:PDES:L2", (size_t)&pdes_l2, "pdes_l2", "double", 1, 64, 0, 0, 0, 0}, {"{IOC}:PHASE:24_1", (size_t)&phase24_1, "phase24_1", "double", 1, 65, 0, 0, 0, 0}, {"{IOC}:PHASE:24_2", (size_t)&phase24_2, "phase24_2", "double", 1, 66, 0, 0, 0, 0}, {"{IOC}:PHASE:S29", (size_t)&phase_s29, "phase_s29", "double", 1, 67, 0, 0, 0, 0}, {"{IOC}:PHASE:S30", (size_t)&phase_s30, "phase_s30", "double", 1, 68, 0, 0, 0, 0}, {"{IOC}:POC:24_1", (size_t)&poc_24_1, "poc_24_1", "double", 1, 69, 0, 0, 0, 0}, {"{IOC}:POC:24_2", (size_t)&poc_24_2, "poc_24_2", "double", 1, 70, 0, 0, 0, 0}, {"{IOC}:POC:24_3", (size_t)&poc_24_3, "poc_24_3", "double", 1, 71, 0, 0, 0, 0}, {"{IOC}:POC:TCAV3_0", (size_t)&poc_tcav3_0, "poc_tcav3_0", "double", 1, 72, 0, 0, 0, 0}, {"{IOC}:POC:TCAV3_1", (size_t)&poc_tcav3_1, "poc_tcav3_1", "double", 1, 73, 0, 0, 0, 0}, {"{IOC}:POC:S29", (size_t)&poc_s29, "poc_s29", "double", 1, 74, 0, 0, 0, 0}, {"{IOC}:POC:S30", (size_t)&poc_s30, "poc_s30", "double", 1, 75, 0, 0, 0, 0}, {"{IOC}:KLY_SELECTOR", (size_t)&kly_selector, "kly_selector", "unsigned int", 1, 76, 4, 1, 0, 0} }; /* Event masks for state set "KlySelectControl" */ static const seqMask EM_KlySelectControl_monSelector[] = { 0x00000000, 0x00000000, 0x00001000, }; static const seqMask EM_KlySelectControl_selOneTwo[] = { 0x00000010, 0x00000000, 0x00000000, }; static const seqMask EM_KlySelectControl_selTwoThree[] = { 0x00000010, 0x00000000, 0x00000000, }; static const seqMask EM_KlySelectControl_selOneThree[] = { 0x00000010, 0x00000000, 0x00000000, }; /* State table for state set "KlySelectControl" */ static seqState G_KlySelectControl_states[] = { { /* state name */ "monSelector", /* action function */ A_KlySelectControl_monSelector, /* event function */ E_KlySelectControl_monSelector, /* delay function */ D_KlySelectControl_monSelector, /* entry function */ 0, /* exit function */ 0, /* event mask array */ EM_KlySelectControl_monSelector, /* state options */ (0) }, { /* state name */ "selOneTwo", /* action function */ A_KlySelectControl_selOneTwo, /* event function */ E_KlySelectControl_selOneTwo, /* delay function */ D_KlySelectControl_selOneTwo, /* entry function */ I_KlySelectControl_selOneTwo, /* exit function */ 0, /* event mask array */ EM_KlySelectControl_selOneTwo, /* state options */ (0) }, { /* state name */ "selTwoThree", /* action function */ A_KlySelectControl_selTwoThree, /* event function */ E_KlySelectControl_selTwoThree, /* delay function */ D_KlySelectControl_selTwoThree, /* entry function */ I_KlySelectControl_selTwoThree, /* exit function */ 0, /* event mask array */ EM_KlySelectControl_selTwoThree, /* state options */ (0) }, { /* state name */ "selOneThree", /* action function */ A_KlySelectControl_selOneThree, /* event function */ E_KlySelectControl_selOneThree, /* delay function */ D_KlySelectControl_selOneThree, /* entry function */ I_KlySelectControl_selOneThree, /* exit function */ 0, /* event mask array */ EM_KlySelectControl_selOneThree, /* state options */ (0) }, }; /* Event masks for state set "MonPhaseControl" */ static const seqMask EM_MonPhaseControl_initMon[] = { 0x00000000, 0x00000000, 0x00000000, }; static const seqMask EM_MonPhaseControl_monPhaseControl[] = { 0x00000002, 0x00000000, 0x00000000, }; static const seqMask EM_MonPhaseControl_waitMon[] = { 0x0000000a, 0x00000000, 0x00000000, }; static const seqMask EM_MonPhaseControl_exceptionPhaseControl[] = { 0x00000000, 0x00000000, 0x00000000, }; /* State table for state set "MonPhaseControl" */ static seqState G_MonPhaseControl_states[] = { { /* state name */ "initMon", /* action function */ A_MonPhaseControl_initMon, /* event function */ E_MonPhaseControl_initMon, /* delay function */ D_MonPhaseControl_initMon, /* entry function */ 0, /* exit function */ 0, /* event mask array */ EM_MonPhaseControl_initMon, /* state options */ (0) }, { /* state name */ "monPhaseControl", /* action function */ A_MonPhaseControl_monPhaseControl, /* event function */ E_MonPhaseControl_monPhaseControl, /* delay function */ D_MonPhaseControl_monPhaseControl, /* entry function */ 0, /* exit function */ 0, /* event mask array */ EM_MonPhaseControl_monPhaseControl, /* state options */ (0) }, { /* state name */ "waitMon", /* action function */ A_MonPhaseControl_waitMon, /* event function */ E_MonPhaseControl_waitMon, /* delay function */ D_MonPhaseControl_waitMon, /* entry function */ 0, /* exit function */ 0, /* event mask array */ EM_MonPhaseControl_waitMon, /* state options */ (0) }, { /* state name */ "exceptionPhaseControl", /* action function */ A_MonPhaseControl_exceptionPhaseControl, /* event function */ E_MonPhaseControl_exceptionPhaseControl, /* delay function */ D_MonPhaseControl_exceptionPhaseControl, /* entry function */ 0, /* exit function */ 0, /* event mask array */ EM_MonPhaseControl_exceptionPhaseControl, /* state options */ (0) }, }; /* Event masks for state set "EstEventRate" */ static const seqMask EM_EstEventRate_eventRate[] = { 0x00000000, 0x00000000, 0x00000000, }; /* State table for state set "EstEventRate" */ static seqState G_EstEventRate_states[] = { { /* state name */ "eventRate", /* action function */ A_EstEventRate_eventRate, /* event function */ E_EstEventRate_eventRate, /* delay function */ D_EstEventRate_eventRate, /* entry function */ 0, /* exit function */ 0, /* event mask array */ EM_EstEventRate_eventRate, /* state options */ (0) }, }; /* Event masks for state set "phasControl" */ static const seqMask EM_phasControl_phaseControl[] = { 0x00000004, 0x00000000, 0x00000000, }; static const seqMask EM_phasControl_donePhaseControl[] = { 0x00000000, 0x00000000, 0x00000000, }; /* State table for state set "phasControl" */ static seqState G_phasControl_states[] = { { /* state name */ "phaseControl", /* action function */ A_phasControl_phaseControl, /* event function */ E_phasControl_phaseControl, /* delay function */ D_phasControl_phaseControl, /* entry function */ 0, /* exit function */ 0, /* event mask array */ EM_phasControl_phaseControl, /* state options */ (0) }, { /* state name */ "donePhaseControl", /* action function */ A_phasControl_donePhaseControl, /* event function */ E_phasControl_donePhaseControl, /* delay function */ D_phasControl_donePhaseControl, /* entry function */ 0, /* exit function */ 0, /* event mask array */ EM_phasControl_donePhaseControl, /* state options */ (0) }, }; /* State set table */ static seqSS G_state_sets[] = { { /* state set name */ "KlySelectControl", /* states */ G_KlySelectControl_states, /* number of states */ 4, /* number of delays */ 0 }, { /* state set name */ "MonPhaseControl", /* states */ G_MonPhaseControl_states, /* number of states */ 4, /* number of delays */ 0 }, { /* state set name */ "EstEventRate", /* states */ G_EstEventRate_states, /* number of states */ 1, /* number of delays */ 1 }, { /* state set name */ "phasControl", /* states */ G_phasControl_states, /* number of states */ 2, /* number of delays */ 0 }, }; /* Program table (global) */ seqProgram RFPhaseControl = { /* magic number */ 2001006, /* program name */ "RFPhaseControl", /* channels */ G_channels, /* num. channels */ 72, /* state sets */ G_state_sets, /* num. state sets */ 4, /* user var size */ 0, /* param */ "", /* num. event flags */ 4, /* 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 RFPhaseControlRegistrar (void) { seqRegisterSequencerCommands(); seqRegisterSequencerProgram (&RFPhaseControl); } epicsExportRegistrar(RFPhaseControlRegistrar);