/* SNC Version 2.0.11: Wed Nov 2 19:48:22 2011: laserPowerControl.i */ /* Event flags */ #define eventLaserPowerSetPointChange 1 #define eventCameraPowerSetPointChange 2 /* Program "laserPowerControl" */ #include "seqCom.h" #define NUM_SS 1 #define NUM_CHANNELS 9 #define NUM_EVENTS 2 #define NUM_QUEUES 0 #define MAX_STRING_SIZE 40 #define ASYNC_OPT FALSE #define CONN_OPT TRUE #define DEBUG_OPT TRUE #define MAIN_OPT FALSE #define NEWEF_OPT TRUE #define REENT_OPT FALSE extern struct seqProgram laserPowerControl; /* Variable declarations */ static double laserPowerSetPoint; static double cameraPowerSetPoint; static char statusStr[MAX_STRING_SIZE]; static double laserWaveplateAngle_val; static short laserWaveplateAngle_dmov; static double laserWaveplateAngle_max; static double cameraWaveplateAngle_val; static short cameraWaveplateAngle_dmov; static double cameraWaveplateAngle_max; static double newLaserPower; static double newCameraPower; static double oldLaserPower; static double oldCameraPower; static double cosLaserAngle; static double cosCameraAngle; static double newLaserAngle; static double newCameraAngle; static int ctrlFlag; static int exceptionCode; /* Not used (avoids compilation warnings) */ struct UserVar { int dummy; }; /* C code definitions */ # line 39 "../laserPowerControl.st" #include "stdio.h" # line 40 "../laserPowerControl.st" #include "string.h" # line 41 "../laserPowerControl.st" #include "math.h" # line 42 "../laserPowerControl.st" #include "epicsTime.h" /* Entry handler */ static void entry_handler(SS_ID ssId, struct UserVar *pVar) { } /* Code for state "init" in state set "laserPowerControlFSM" */ /* Entry function for state "init" in state set "laserPowerControlFSM" */ static void I_laserPowerControlFSM_init(SS_ID ssId, struct UserVar *pVar) { /* Entry 1: */ # line 153 "../laserPowerControl.st" if (0) printf("laserPowerControlFSM:init - entry\n"); # line 155 "../laserPowerControl.st" newLaserPower = 0.0; # line 156 "../laserPowerControl.st" newCameraPower = 0.0; # line 157 "../laserPowerControl.st" oldLaserPower = 0.0; # line 158 "../laserPowerControl.st" oldCameraPower = 0.0; # line 159 "../laserPowerControl.st" cosLaserAngle = 0.0; # line 160 "../laserPowerControl.st" cosCameraAngle = 0.0; # line 161 "../laserPowerControl.st" newLaserAngle = 0.0; # line 162 "../laserPowerControl.st" newCameraAngle = 0.0; # line 163 "../laserPowerControl.st" ctrlFlag = 0; # line 164 "../laserPowerControl.st" exceptionCode = 0; # line 184 "../laserPowerControl.st" if (laserPowerSetPoint <= 0) { if (seq_pvGet(ssId, 3 /* laserWaveplateAngle_val */, 0) == pvStatOK && seq_pvGet(ssId, 6 /* cameraWaveplateAngle_val */, 0) == pvStatOK) { cosLaserAngle = cos(2 * ((laserWaveplateAngle_val - laserWaveplateAngle_max) * 3.1415926 / 180.0)); cosCameraAngle = cos(2 * ((cameraWaveplateAngle_val - cameraWaveplateAngle_max) * 3.1415926 / 180.0)); laserPowerSetPoint = 100.0 * cosLaserAngle * cosLaserAngle; cameraPowerSetPoint = 100.0 * cosCameraAngle * cosCameraAngle; cameraPowerSetPoint = cameraPowerSetPoint * laserPowerSetPoint / 100.0; seq_pvPut(ssId, 0 /* laserPowerSetPoint */, 0); seq_pvPut(ssId, 1 /* cameraPowerSetPoint */, 0); printf("Set the power sp values from the angles: laserPower = %lf, cameraPower = %lf\n", laserPowerSetPoint, cameraPowerSetPoint); } } } /* Delay function for state "init" in state set "laserPowerControlFSM" */ static void D_laserPowerControlFSM_init(SS_ID ssId, struct UserVar *pVar) { # line 191 "../laserPowerControl.st" # line 195 "../laserPowerControl.st" } /* Event function for state "init" in state set "laserPowerControlFSM" */ static long E_laserPowerControlFSM_init(SS_ID ssId, struct UserVar *pVar, short *pTransNum, short *pNextState) { # line 191 "../laserPowerControl.st" if (seq_pvConnectCount(ssId) != seq_pvChannelCount(ssId)) { *pNextState = 5; *pTransNum = 0; return TRUE; } # line 195 "../laserPowerControl.st" if (seq_pvConnectCount(ssId) == seq_pvChannelCount(ssId)) { *pNextState = 1; *pTransNum = 1; return TRUE; } return FALSE; } /* Action function for state "init" in state set "laserPowerControlFSM" */ static void A_laserPowerControlFSM_init(SS_ID ssId, struct UserVar *pVar, short transNum) { switch(transNum) { case 0: { # line 189 "../laserPowerControl.st" exceptionCode = 1; if (0) printf("laserPowerControlFSM:init - transient to exceptionHandling\n"); } return; case 1: { # line 194 "../laserPowerControl.st" if (0) printf("laserPowerControlFSM:init - transient to idle\n"); } return; } } /* Code for state "idle" in state set "laserPowerControlFSM" */ /* Delay function for state "idle" in state set "laserPowerControlFSM" */ static void D_laserPowerControlFSM_idle(SS_ID ssId, struct UserVar *pVar) { # line 205 "../laserPowerControl.st" } /* Event function for state "idle" in state set "laserPowerControlFSM" */ static long E_laserPowerControlFSM_idle(SS_ID ssId, struct UserVar *pVar, short *pTransNum, short *pNextState) { # line 205 "../laserPowerControl.st" if ((seq_efTestAndClear(ssId, eventLaserPowerSetPointChange) || seq_efTestAndClear(ssId, eventCameraPowerSetPointChange)) && laserPowerSetPoint >= 0 && cameraPowerSetPoint >= 0) { *pNextState = 2; *pTransNum = 0; return TRUE; } return FALSE; } /* Action function for state "idle" in state set "laserPowerControlFSM" */ static void A_laserPowerControlFSM_idle(SS_ID ssId, struct UserVar *pVar, short transNum) { switch(transNum) { case 0: { # line 204 "../laserPowerControl.st" if (0) printf("laserPowerControlFSM:idle - transient to calculation\n"); } return; } } /* Code for state "calcuation" in state set "laserPowerControlFSM" */ /* Entry function for state "calcuation" in state set "laserPowerControlFSM" */ static void I_laserPowerControlFSM_calcuation(SS_ID ssId, struct UserVar *pVar) { /* Entry 1: */ # line 213 "../laserPowerControl.st" if (0) printf("laserPowerControlFSM:calculation - entry\n"); # line 216 "../laserPowerControl.st" ctrlFlag = 0; # line 219 "../laserPowerControl.st" newLaserPower = laserPowerSetPoint; # line 221 "../laserPowerControl.st" if (newLaserPower == 0) newCameraPower = 100.0; # line 222 "../laserPowerControl.st" else newCameraPower = 100.0 * cameraPowerSetPoint / newLaserPower; # line 224 "../laserPowerControl.st" newLaserPower = (((100) > (newLaserPower)) ? (newLaserPower) : (100)); # line 225 "../laserPowerControl.st" newLaserPower = (((0) < (newLaserPower)) ? (newLaserPower) : (0)); # line 226 "../laserPowerControl.st" newCameraPower = (((100) > (newCameraPower)) ? (newCameraPower) : (100)); # line 227 "../laserPowerControl.st" newCameraPower = (((0) < (newCameraPower)) ? (newCameraPower) : (0)); # line 247 "../laserPowerControl.st" if (seq_pvGet(ssId, 3 /* laserWaveplateAngle_val */, 0) == pvStatOK && seq_pvGet(ssId, 6 /* cameraWaveplateAngle_val */, 0) == pvStatOK) { cosLaserAngle = cos(2 * ((laserWaveplateAngle_val - laserWaveplateAngle_max) * 3.1415926 / 180.0)); cosCameraAngle = cos(2 * ((cameraWaveplateAngle_val - cameraWaveplateAngle_max) * 3.1415926 / 180.0)); oldLaserPower = 100.0 * cosLaserAngle * cosLaserAngle; oldCameraPower = 100.0 * cosCameraAngle * cosCameraAngle; newLaserAngle = laserWaveplateAngle_max - 0.5 * ((acos(sqrt(newLaserPower / 100.0))) * 180.0 / 3.1415926); newCameraAngle = cameraWaveplateAngle_max - 0.5 * ((acos(sqrt(newCameraPower / 100.0))) * 180.0 / 3.1415926); printf("newLaserPower = %lf, oldLaserPower = %lf\n", newLaserPower, oldLaserPower); if (newLaserPower > oldLaserPower) ctrlFlag = 2; else ctrlFlag = 1; } } /* Delay function for state "calcuation" in state set "laserPowerControlFSM" */ static void D_laserPowerControlFSM_calcuation(SS_ID ssId, struct UserVar *pVar) { # line 253 "../laserPowerControl.st" # line 258 "../laserPowerControl.st" # line 264 "../laserPowerControl.st" } /* Event function for state "calcuation" in state set "laserPowerControlFSM" */ static long E_laserPowerControlFSM_calcuation(SS_ID ssId, struct UserVar *pVar, short *pTransNum, short *pNextState) { # line 253 "../laserPowerControl.st" if (ctrlFlag == 1) { *pNextState = 4; *pTransNum = 0; return TRUE; } # line 258 "../laserPowerControl.st" if (ctrlFlag == 2) { *pNextState = 3; *pTransNum = 1; return TRUE; } # line 264 "../laserPowerControl.st" if (ctrlFlag <= 0 || ctrlFlag > 2) { *pNextState = 5; *pTransNum = 2; return TRUE; } return FALSE; } /* Action function for state "calcuation" in state set "laserPowerControlFSM" */ static void A_laserPowerControlFSM_calcuation(SS_ID ssId, struct UserVar *pVar, short transNum) { switch(transNum) { case 0: { # line 252 "../laserPowerControl.st" if (0) printf("laserPowerControlFSM:calculation - transient to laserMotorMoving\n"); } return; case 1: { # line 257 "../laserPowerControl.st" if (0) printf("laserPowerControlFSM:calculation - transient to cameraMotorMoving\n"); } return; case 2: { # line 262 "../laserPowerControl.st" exceptionCode = 2; if (0) printf("laserPowerControlFSM:calculation - transient to exceptionHandling\n"); } return; } } /* Code for state "cameraMotorMoving" in state set "laserPowerControlFSM" */ /* Entry function for state "cameraMotorMoving" in state set "laserPowerControlFSM" */ static void I_laserPowerControlFSM_cameraMotorMoving(SS_ID ssId, struct UserVar *pVar) { /* Entry 1: */ # line 273 "../laserPowerControl.st" if (0) printf("laserPowerControlFSM:cameraMotorMoving - entry\n"); # line 274 "../laserPowerControl.st" cameraWaveplateAngle_val = newCameraAngle; # line 275 "../laserPowerControl.st" seq_pvPut(ssId, 6 /* cameraWaveplateAngle_val */, 0); } /* Delay function for state "cameraMotorMoving" in state set "laserPowerControlFSM" */ static void D_laserPowerControlFSM_cameraMotorMoving(SS_ID ssId, struct UserVar *pVar) { # line 281 "../laserPowerControl.st" # line 287 "../laserPowerControl.st" # line 293 "../laserPowerControl.st" seq_delayInit(ssId, 0, (60)); } /* Event function for state "cameraMotorMoving" in state set "laserPowerControlFSM" */ static long E_laserPowerControlFSM_cameraMotorMoving(SS_ID ssId, struct UserVar *pVar, short *pTransNum, short *pNextState) { # line 281 "../laserPowerControl.st" if (cameraWaveplateAngle_dmov == 1 && ctrlFlag == 2) { *pNextState = 4; *pTransNum = 0; return TRUE; } # line 287 "../laserPowerControl.st" if (cameraWaveplateAngle_dmov == 1 && ctrlFlag == 1) { *pNextState = 5; *pTransNum = 1; return TRUE; } # line 293 "../laserPowerControl.st" if (seq_delay(ssId, 0)) { *pNextState = 5; *pTransNum = 2; return TRUE; } return FALSE; } /* Action function for state "cameraMotorMoving" in state set "laserPowerControlFSM" */ static void A_laserPowerControlFSM_cameraMotorMoving(SS_ID ssId, struct UserVar *pVar, short transNum) { switch(transNum) { case 0: { # line 280 "../laserPowerControl.st" if (0) printf("laserPowerControlFSM:cameraMotorMoving - transient to laserMotorMoving\n"); } return; case 1: { # line 285 "../laserPowerControl.st" exceptionCode = 0; if (0) printf("laserPowerControlFSM:cameraMotorMoving - transient to exception handling (succeed)\n"); } return; case 2: { # line 291 "../laserPowerControl.st" exceptionCode = 4; if (0) printf("laserPowerControlFSM:cameraMotorMoving - transient to exception handling (failed)\n"); } return; } } /* Code for state "laserMotorMoving" in state set "laserPowerControlFSM" */ /* Entry function for state "laserMotorMoving" in state set "laserPowerControlFSM" */ static void I_laserPowerControlFSM_laserMotorMoving(SS_ID ssId, struct UserVar *pVar) { /* Entry 1: */ # line 302 "../laserPowerControl.st" if (0) printf("laserPowerControlFSM:laserMotorMoving - entry\n"); # line 303 "../laserPowerControl.st" laserWaveplateAngle_val = newLaserAngle; # line 304 "../laserPowerControl.st" seq_pvPut(ssId, 3 /* laserWaveplateAngle_val */, 0); } /* Delay function for state "laserMotorMoving" in state set "laserPowerControlFSM" */ static void D_laserPowerControlFSM_laserMotorMoving(SS_ID ssId, struct UserVar *pVar) { # line 310 "../laserPowerControl.st" # line 316 "../laserPowerControl.st" # line 322 "../laserPowerControl.st" seq_delayInit(ssId, 0, (60)); } /* Event function for state "laserMotorMoving" in state set "laserPowerControlFSM" */ static long E_laserPowerControlFSM_laserMotorMoving(SS_ID ssId, struct UserVar *pVar, short *pTransNum, short *pNextState) { # line 310 "../laserPowerControl.st" if (laserWaveplateAngle_dmov == 1 && ctrlFlag == 1) { *pNextState = 3; *pTransNum = 0; return TRUE; } # line 316 "../laserPowerControl.st" if (laserWaveplateAngle_dmov == 1 && ctrlFlag == 2) { *pNextState = 5; *pTransNum = 1; return TRUE; } # line 322 "../laserPowerControl.st" if (seq_delay(ssId, 0)) { *pNextState = 5; *pTransNum = 2; return TRUE; } return FALSE; } /* Action function for state "laserMotorMoving" in state set "laserPowerControlFSM" */ static void A_laserPowerControlFSM_laserMotorMoving(SS_ID ssId, struct UserVar *pVar, short transNum) { switch(transNum) { case 0: { # line 309 "../laserPowerControl.st" if (0) printf("laserPowerControlFSM:laserMotorMoving - transient to cameraMotorMoving\n"); } return; case 1: { # line 314 "../laserPowerControl.st" exceptionCode = 0; if (0) printf("laserPowerControlFSM:laserMotorMoving - transient to exception handling (succeed)\n"); } return; case 2: { # line 320 "../laserPowerControl.st" exceptionCode = 3; if (0) printf("laserPowerControlFSM:laserMotorMoving - transient to exception handling (failed)\n"); } return; } } /* Code for state "exceptionHandling" in state set "laserPowerControlFSM" */ /* Entry function for state "exceptionHandling" in state set "laserPowerControlFSM" */ static void I_laserPowerControlFSM_exceptionHandling(SS_ID ssId, struct UserVar *pVar) { /* Entry 1: */ # line 330 "../laserPowerControl.st" if (0) printf("laserPowerControlFSM:exceptionHandling - entry\n"); # line 336 "../laserPowerControl.st" if (exceptionCode == 0) { sprintf(statusStr, "OK"); if (0) printf("laserPowerControlFSM:exceptionHandling - Motor move OK\n"); } # line 340 "../laserPowerControl.st" else if (exceptionCode == -1) { sprintf(statusStr, "Failure"); if (0) printf("laserPowerControlFSM:exceptionHandling - Failure\n"); } # line 344 "../laserPowerControl.st" else if (exceptionCode == 1) { sprintf(statusStr, "Not all channel connected"); if (0) printf("laserPowerControlFSM:exceptionHandling - Not all channel connected\n"); } # line 348 "../laserPowerControl.st" else if (exceptionCode == 2) { sprintf(statusStr, "Undfined motor instruction"); if (0) printf("laserPowerControlFSM:exceptionHandling - Undfined motor instruction\n"); } # line 352 "../laserPowerControl.st" else if (exceptionCode == 3) { sprintf(statusStr, "Laser motor failure"); if (0) printf("laserPowerControlFSM:exceptionHandling - Laser motor failure\n"); } # line 356 "../laserPowerControl.st" else if (exceptionCode == 4) { sprintf(statusStr, "Camera motor failure"); if (0) printf("laserPowerControlFSM:exceptionHandling - Camera motor failure\n"); } # line 359 "../laserPowerControl.st" else { sprintf(statusStr, "Unknown exceptions"); if (0) printf("laserPowerControlFSM:exceptionHandling - Unknown exceptions\n"); } # line 361 "../laserPowerControl.st" seq_pvPut(ssId, 2 /* statusStr */, 0); } /* Delay function for state "exceptionHandling" in state set "laserPowerControlFSM" */ static void D_laserPowerControlFSM_exceptionHandling(SS_ID ssId, struct UserVar *pVar) { # line 366 "../laserPowerControl.st" } /* Event function for state "exceptionHandling" in state set "laserPowerControlFSM" */ static long E_laserPowerControlFSM_exceptionHandling(SS_ID ssId, struct UserVar *pVar, short *pTransNum, short *pNextState) { # line 366 "../laserPowerControl.st" if (TRUE) { *pNextState = 1; *pTransNum = 0; return TRUE; } return FALSE; } /* Action function for state "exceptionHandling" in state set "laserPowerControlFSM" */ static void A_laserPowerControlFSM_exceptionHandling(SS_ID ssId, struct UserVar *pVar, short transNum) { switch(transNum) { case 0: { # line 365 "../laserPowerControl.st" if (0) printf("laserPowerControlFSM:exceptionHandling - transient to idle\n"); } return; } } /* Exit handler */ static void exit_handler(SS_ID ssId, struct UserVar *pVar) { } /************************ Tables ***********************/ /* Database Blocks */ static struct seqChan seqChan[NUM_CHANNELS] = { {"IOC:IN20:LS11:PCTRL", (void *)&laserPowerSetPoint, "laserPowerSetPoint", "double", 1, 3, 1, 1, 0, 0, 0}, {"IOC:IN20:LS11:CCTRL", (void *)&cameraPowerSetPoint, "cameraPowerSetPoint", "double", 1, 4, 2, 1, 0, 0, 0}, {"IOC:IN20:LS11:PCSTATUS", (void *)&statusStr[0], "statusStr", "string", 1, 5, 0, 0, 0, 0, 0}, {"WPLT:LR20:116:WP2_ANGLE.VAL", (void *)&laserWaveplateAngle_val, "laserWaveplateAngle_val", "double", 1, 6, 0, 0, 0, 0, 0}, {"WPLT:LR20:116:WP2_ANGLE.DMOV", (void *)&laserWaveplateAngle_dmov, "laserWaveplateAngle_dmov", "short", 1, 7, 0, 1, 0, 0, 0}, {"WPLT:LR20:116:ANG_MAX", (void *)&laserWaveplateAngle_max, "laserWaveplateAngle_max", "double", 1, 8, 0, 1, 0, 0, 0}, {"WPLT:IN20:181:VCC_ANGLE.VAL", (void *)&cameraWaveplateAngle_val, "cameraWaveplateAngle_val", "double", 1, 9, 0, 0, 0, 0, 0}, {"WPLT:IN20:181:VCC_ANGLE.DMOV", (void *)&cameraWaveplateAngle_dmov, "cameraWaveplateAngle_dmov", "short", 1, 10, 0, 1, 0, 0, 0}, {"WPLT:IN20:181:ANG_MAX", (void *)&cameraWaveplateAngle_max, "cameraWaveplateAngle_max", "double", 1, 11, 0, 1, 0, 0, 0}, }; /* Event masks for state set laserPowerControlFSM */ /* Event mask for state init: */ static bitMask EM_laserPowerControlFSM_init[] = { 0x00000000, }; /* Event mask for state idle: */ static bitMask EM_laserPowerControlFSM_idle[] = { 0x0000001e, }; /* Event mask for state calcuation: */ static bitMask EM_laserPowerControlFSM_calcuation[] = { 0x00000000, }; /* Event mask for state cameraMotorMoving: */ static bitMask EM_laserPowerControlFSM_cameraMotorMoving[] = { 0x00000400, }; /* Event mask for state laserMotorMoving: */ static bitMask EM_laserPowerControlFSM_laserMotorMoving[] = { 0x00000080, }; /* Event mask for state exceptionHandling: */ static bitMask EM_laserPowerControlFSM_exceptionHandling[] = { 0x00000000, }; /* State Blocks */ static struct seqState state_laserPowerControlFSM[] = { /* State "init" */ { /* state name */ "init", /* action function */ (ACTION_FUNC) A_laserPowerControlFSM_init, /* event function */ (EVENT_FUNC) E_laserPowerControlFSM_init, /* delay function */ (DELAY_FUNC) D_laserPowerControlFSM_init, /* entry function */ (ENTRY_FUNC) I_laserPowerControlFSM_init, /* exit function */ (EXIT_FUNC) 0, /* event mask array */ EM_laserPowerControlFSM_init, /* state options */ (0)}, /* State "idle" */ { /* state name */ "idle", /* action function */ (ACTION_FUNC) A_laserPowerControlFSM_idle, /* event function */ (EVENT_FUNC) E_laserPowerControlFSM_idle, /* delay function */ (DELAY_FUNC) D_laserPowerControlFSM_idle, /* entry function */ (ENTRY_FUNC) 0, /* exit function */ (EXIT_FUNC) 0, /* event mask array */ EM_laserPowerControlFSM_idle, /* state options */ (0)}, /* State "calcuation" */ { /* state name */ "calcuation", /* action function */ (ACTION_FUNC) A_laserPowerControlFSM_calcuation, /* event function */ (EVENT_FUNC) E_laserPowerControlFSM_calcuation, /* delay function */ (DELAY_FUNC) D_laserPowerControlFSM_calcuation, /* entry function */ (ENTRY_FUNC) I_laserPowerControlFSM_calcuation, /* exit function */ (EXIT_FUNC) 0, /* event mask array */ EM_laserPowerControlFSM_calcuation, /* state options */ (0)}, /* State "cameraMotorMoving" */ { /* state name */ "cameraMotorMoving", /* action function */ (ACTION_FUNC) A_laserPowerControlFSM_cameraMotorMoving, /* event function */ (EVENT_FUNC) E_laserPowerControlFSM_cameraMotorMoving, /* delay function */ (DELAY_FUNC) D_laserPowerControlFSM_cameraMotorMoving, /* entry function */ (ENTRY_FUNC) I_laserPowerControlFSM_cameraMotorMoving, /* exit function */ (EXIT_FUNC) 0, /* event mask array */ EM_laserPowerControlFSM_cameraMotorMoving, /* state options */ (0)}, /* State "laserMotorMoving" */ { /* state name */ "laserMotorMoving", /* action function */ (ACTION_FUNC) A_laserPowerControlFSM_laserMotorMoving, /* event function */ (EVENT_FUNC) E_laserPowerControlFSM_laserMotorMoving, /* delay function */ (DELAY_FUNC) D_laserPowerControlFSM_laserMotorMoving, /* entry function */ (ENTRY_FUNC) I_laserPowerControlFSM_laserMotorMoving, /* exit function */ (EXIT_FUNC) 0, /* event mask array */ EM_laserPowerControlFSM_laserMotorMoving, /* state options */ (0)}, /* State "exceptionHandling" */ { /* state name */ "exceptionHandling", /* action function */ (ACTION_FUNC) A_laserPowerControlFSM_exceptionHandling, /* event function */ (EVENT_FUNC) E_laserPowerControlFSM_exceptionHandling, /* delay function */ (DELAY_FUNC) D_laserPowerControlFSM_exceptionHandling, /* entry function */ (ENTRY_FUNC) I_laserPowerControlFSM_exceptionHandling, /* exit function */ (EXIT_FUNC) 0, /* event mask array */ EM_laserPowerControlFSM_exceptionHandling, /* state options */ (0)}, }; /* State Set Blocks */ static struct seqSS seqSS[NUM_SS] = { /* State set "laserPowerControlFSM" */ { /* ss name */ "laserPowerControlFSM", /* ptr to state block */ state_laserPowerControlFSM, /* number of states */ 6, /* error state */ -1}, }; /* Program parameter list */ static char prog_param[] = ""; /* State Program table (global) */ struct seqProgram laserPowerControl = { /* magic number */ 20000315, /* *name */ "laserPowerControl", /* *pChannels */ seqChan, /* numChans */ NUM_CHANNELS, /* *pSS */ seqSS, /* numSS */ NUM_SS, /* user variable size */ 0, /* *pParams */ prog_param, /* numEvents */ NUM_EVENTS, /* encoded options */ (0 | OPT_CONN | OPT_DEBUG | OPT_NEWEF), /* entry handler */ (ENTRY_FUNC) entry_handler, /* exit handler */ (EXIT_FUNC) exit_handler, /* numQueues */ NUM_QUEUES, }; /* Register sequencer commands and program */ void laserPowerControlRegistrar (void) { seqRegisterSequencerCommands(); seqRegisterSequencerProgram (&laserPowerControl); } epicsExportRegistrar(laserPowerControlRegistrar);