/* 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 10 #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 TRUE extern struct seqProgram laserPowerControl; /* Variable declarations */ struct UserVar { double laserPowerSetPoint; double cameraPowerSetPoint; char statusStr[MAX_STRING_SIZE]; short fbckEnable; double laserWaveplateAngle_val; short laserWaveplateAngle_dmov; double laserWaveplateAngle_max; double cameraWaveplateAngle_val; short cameraWaveplateAngle_dmov; double cameraWaveplateAngle_max; double newLaserPower; double newCameraPower; double oldLaserPower; double oldCameraPower; double cosLaserAngle; double cosCameraAngle; double newLaserAngle; double newCameraAngle; int ctrlFlag; int exceptionCode; }; /* C code definitions */ # line 40 "../laserPowerControl.st" #include "stdio.h" # line 41 "../laserPowerControl.st" #include "string.h" # line 42 "../laserPowerControl.st" #include "math.h" # line 43 "../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 158 "../laserPowerControl.st" if (0) printf("laserPowerControlFSM:init - entry\n"); # line 160 "../laserPowerControl.st" (pVar->newLaserPower) = 0.0; # line 161 "../laserPowerControl.st" (pVar->newCameraPower) = 0.0; # line 162 "../laserPowerControl.st" (pVar->oldLaserPower) = 0.0; # line 163 "../laserPowerControl.st" (pVar->oldCameraPower) = 0.0; # line 164 "../laserPowerControl.st" (pVar->cosLaserAngle) = 0.0; # line 165 "../laserPowerControl.st" (pVar->cosCameraAngle) = 0.0; # line 166 "../laserPowerControl.st" (pVar->newLaserAngle) = 0.0; # line 167 "../laserPowerControl.st" (pVar->newCameraAngle) = 0.0; # line 168 "../laserPowerControl.st" (pVar->ctrlFlag) = 0; # line 169 "../laserPowerControl.st" (pVar->exceptionCode) = 0; # line 189 "../laserPowerControl.st" if ((pVar->laserPowerSetPoint) <= 0) { if (seq_pvGet(ssId, 4 /* laserWaveplateAngle_val */, 0) == pvStatOK && seq_pvGet(ssId, 7 /* cameraWaveplateAngle_val */, 0) == pvStatOK) { (pVar->cosLaserAngle) = cos(2 * (((pVar->laserWaveplateAngle_val) - (pVar->laserWaveplateAngle_max)) * 3.1415926 / 180.0)); (pVar->cosCameraAngle) = cos(2 * (((pVar->cameraWaveplateAngle_val) - (pVar->cameraWaveplateAngle_max)) * 3.1415926 / 180.0)); (pVar->laserPowerSetPoint) = 100.0 * (pVar->cosLaserAngle) * (pVar->cosLaserAngle); (pVar->cameraPowerSetPoint) = 100.0 * (pVar->cosCameraAngle) * (pVar->cosCameraAngle); (pVar->cameraPowerSetPoint) = (pVar->cameraPowerSetPoint) * (pVar->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", (pVar->laserPowerSetPoint), (pVar->cameraPowerSetPoint)); } } # line 190 "../laserPowerControl.st" printf("Starting position = %lf\n", (pVar->laserWaveplateAngle_val)); } /* Delay function for state "init" in state set "laserPowerControlFSM" */ static void D_laserPowerControlFSM_init(SS_ID ssId, struct UserVar *pVar) { # line 197 "../laserPowerControl.st" # line 201 "../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 197 "../laserPowerControl.st" if (seq_pvConnectCount(ssId) != seq_pvChannelCount(ssId)) { *pNextState = 5; *pTransNum = 0; return TRUE; } # line 201 "../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 195 "../laserPowerControl.st" (pVar->exceptionCode) = 1; if (0) printf("laserPowerControlFSM:init - transient to exceptionHandling\n"); } return; case 1: { # line 200 "../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 211 "../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 211 "../laserPowerControl.st" if ((pVar->fbckEnable) && (seq_efTestAndClear(ssId, eventLaserPowerSetPointChange) || seq_efTestAndClear(ssId, eventCameraPowerSetPointChange)) && (pVar->laserPowerSetPoint) >= 0 && (pVar->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 209 "../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 219 "../laserPowerControl.st" if (0) printf("laserPowerControlFSM:calculation - entry\n"); # line 222 "../laserPowerControl.st" (pVar->ctrlFlag) = 0; # line 225 "../laserPowerControl.st" (pVar->newLaserPower) = (pVar->laserPowerSetPoint); # line 227 "../laserPowerControl.st" if ((pVar->newLaserPower) == 0) (pVar->newCameraPower) = 100.0; # line 228 "../laserPowerControl.st" else (pVar->newCameraPower) = 100.0 * (pVar->cameraPowerSetPoint) / (pVar->newLaserPower); # line 230 "../laserPowerControl.st" (pVar->newLaserPower) = (((100) > ((pVar->newLaserPower))) ? ((pVar->newLaserPower)) : (100)); # line 231 "../laserPowerControl.st" (pVar->newLaserPower) = (((0) < ((pVar->newLaserPower))) ? ((pVar->newLaserPower)) : (0)); # line 232 "../laserPowerControl.st" (pVar->newCameraPower) = (((100) > ((pVar->newCameraPower))) ? ((pVar->newCameraPower)) : (100)); # line 233 "../laserPowerControl.st" (pVar->newCameraPower) = (((0) < ((pVar->newCameraPower))) ? ((pVar->newCameraPower)) : (0)); # line 253 "../laserPowerControl.st" if (seq_pvGet(ssId, 4 /* laserWaveplateAngle_val */, 0) == pvStatOK && seq_pvGet(ssId, 7 /* cameraWaveplateAngle_val */, 0) == pvStatOK) { (pVar->cosLaserAngle) = cos(2 * (((pVar->laserWaveplateAngle_val) - (pVar->laserWaveplateAngle_max)) * 3.1415926 / 180.0)); (pVar->cosCameraAngle) = cos(2 * (((pVar->cameraWaveplateAngle_val) - (pVar->cameraWaveplateAngle_max)) * 3.1415926 / 180.0)); (pVar->oldLaserPower) = 100.0 * (pVar->cosLaserAngle) * (pVar->cosLaserAngle); (pVar->oldCameraPower) = 100.0 * (pVar->cosCameraAngle) * (pVar->cosCameraAngle); (pVar->newLaserAngle) = (pVar->laserWaveplateAngle_max) - 0.5 * ((acos(sqrt((pVar->newLaserPower) / 100.0))) * 180.0 / 3.1415926); (pVar->newCameraAngle) = (pVar->cameraWaveplateAngle_max) - 0.5 * ((acos(sqrt((pVar->newCameraPower) / 100.0))) * 180.0 / 3.1415926); printf("newLaserPower = %lf, oldLaserPower = %lf, currentAngle = %lf\n", (pVar->newLaserPower), (pVar->oldLaserPower), (pVar->laserWaveplateAngle_val)); if ((pVar->newLaserPower) > (pVar->oldLaserPower)) (pVar->ctrlFlag) = 2; else (pVar->ctrlFlag) = 1; } } /* Delay function for state "calcuation" in state set "laserPowerControlFSM" */ static void D_laserPowerControlFSM_calcuation(SS_ID ssId, struct UserVar *pVar) { # line 259 "../laserPowerControl.st" # line 264 "../laserPowerControl.st" # line 270 "../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 259 "../laserPowerControl.st" if ((pVar->ctrlFlag) == 1) { *pNextState = 4; *pTransNum = 0; return TRUE; } # line 264 "../laserPowerControl.st" if ((pVar->ctrlFlag) == 2) { *pNextState = 3; *pTransNum = 1; return TRUE; } # line 270 "../laserPowerControl.st" if ((pVar->ctrlFlag) <= 0 || (pVar->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 258 "../laserPowerControl.st" if (0) printf("laserPowerControlFSM:calculation - transient to laserMotorMoving\n"); } return; case 1: { # line 263 "../laserPowerControl.st" if (0) printf("laserPowerControlFSM:calculation - transient to cameraMotorMoving\n"); } return; case 2: { # line 268 "../laserPowerControl.st" (pVar->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 279 "../laserPowerControl.st" if (0) printf("laserPowerControlFSM:cameraMotorMoving - entry\n"); # line 280 "../laserPowerControl.st" (pVar->cameraWaveplateAngle_val) = (pVar->newCameraAngle); # line 281 "../laserPowerControl.st" seq_pvPut(ssId, 7 /* cameraWaveplateAngle_val */, 0); } /* Delay function for state "cameraMotorMoving" in state set "laserPowerControlFSM" */ static void D_laserPowerControlFSM_cameraMotorMoving(SS_ID ssId, struct UserVar *pVar) { # line 287 "../laserPowerControl.st" # line 293 "../laserPowerControl.st" # line 299 "../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 287 "../laserPowerControl.st" if ((pVar->cameraWaveplateAngle_dmov) == 1 && (pVar->ctrlFlag) == 2) { *pNextState = 4; *pTransNum = 0; return TRUE; } # line 293 "../laserPowerControl.st" if ((pVar->cameraWaveplateAngle_dmov) == 1 && (pVar->ctrlFlag) == 1) { *pNextState = 5; *pTransNum = 1; return TRUE; } # line 299 "../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 286 "../laserPowerControl.st" if (0) printf("laserPowerControlFSM:cameraMotorMoving - transient to laserMotorMoving\n"); } return; case 1: { # line 291 "../laserPowerControl.st" (pVar->exceptionCode) = 0; if (0) printf("laserPowerControlFSM:cameraMotorMoving - transient to exception handling (succeed)\n"); } return; case 2: { # line 297 "../laserPowerControl.st" (pVar->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 308 "../laserPowerControl.st" if (0) printf("laserPowerControlFSM:laserMotorMoving - entry\n"); # line 309 "../laserPowerControl.st" (pVar->laserWaveplateAngle_val) = (pVar->newLaserAngle); # line 310 "../laserPowerControl.st" seq_pvPut(ssId, 4 /* laserWaveplateAngle_val */, 0); } /* Delay function for state "laserMotorMoving" in state set "laserPowerControlFSM" */ static void D_laserPowerControlFSM_laserMotorMoving(SS_ID ssId, struct UserVar *pVar) { # line 316 "../laserPowerControl.st" # line 322 "../laserPowerControl.st" # line 328 "../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 316 "../laserPowerControl.st" if ((pVar->laserWaveplateAngle_dmov) == 1 && (pVar->ctrlFlag) == 1) { *pNextState = 3; *pTransNum = 0; return TRUE; } # line 322 "../laserPowerControl.st" if ((pVar->laserWaveplateAngle_dmov) == 1 && (pVar->ctrlFlag) == 2) { *pNextState = 5; *pTransNum = 1; return TRUE; } # line 328 "../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 315 "../laserPowerControl.st" if (0) printf("laserPowerControlFSM:laserMotorMoving - transient to cameraMotorMoving\n"); } return; case 1: { # line 320 "../laserPowerControl.st" (pVar->exceptionCode) = 0; if (0) printf("laserPowerControlFSM:laserMotorMoving - transient to exception handling (succeed)\n"); } return; case 2: { # line 326 "../laserPowerControl.st" (pVar->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 336 "../laserPowerControl.st" if (0) printf("laserPowerControlFSM:exceptionHandling - entry\n"); # line 342 "../laserPowerControl.st" if ((pVar->exceptionCode) == 0) { sprintf((pVar->statusStr), "OK"); if (0) printf("laserPowerControlFSM:exceptionHandling - Motor move OK\n"); } # line 346 "../laserPowerControl.st" else if ((pVar->exceptionCode) == -1) { sprintf((pVar->statusStr), "Failure"); if (0) printf("laserPowerControlFSM:exceptionHandling - Failure\n"); } # line 350 "../laserPowerControl.st" else if ((pVar->exceptionCode) == 1) { sprintf((pVar->statusStr), "Not all channel connected"); if (0) printf("laserPowerControlFSM:exceptionHandling - Not all channel connected\n"); } # line 354 "../laserPowerControl.st" else if ((pVar->exceptionCode) == 2) { sprintf((pVar->statusStr), "Undfined motor instruction"); if (0) printf("laserPowerControlFSM:exceptionHandling - Undfined motor instruction\n"); } # line 358 "../laserPowerControl.st" else if ((pVar->exceptionCode) == 3) { sprintf((pVar->statusStr), "Laser motor failure"); if (0) printf("laserPowerControlFSM:exceptionHandling - Laser motor failure\n"); } # line 362 "../laserPowerControl.st" else if ((pVar->exceptionCode) == 4) { sprintf((pVar->statusStr), "Camera motor failure"); if (0) printf("laserPowerControlFSM:exceptionHandling - Camera motor failure\n"); } # line 365 "../laserPowerControl.st" else { sprintf((pVar->statusStr), "Unknown exceptions"); if (0) printf("laserPowerControlFSM:exceptionHandling - Unknown exceptions\n"); } # line 367 "../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 372 "../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 372 "../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 371 "../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] = { {"{FBCK}:PCTRL", (void *)OFFSET(struct UserVar, laserPowerSetPoint), "laserPowerSetPoint", "double", 1, 3, 1, 1, 0, 0, 0}, {"{FBCK}:CCTRL", (void *)OFFSET(struct UserVar, cameraPowerSetPoint), "cameraPowerSetPoint", "double", 1, 4, 2, 1, 0, 0, 0}, {"{FBCK}:PCSTATUS", (void *)OFFSET(struct UserVar, statusStr[0]), "statusStr", "string", 1, 5, 0, 0, 0, 0, 0}, {"{ENABLE}", (void *)OFFSET(struct UserVar, fbckEnable), "fbckEnable", "short", 1, 6, 0, 1, 0, 0, 0}, {"{LASR_WPLT}.VAL", (void *)OFFSET(struct UserVar, laserWaveplateAngle_val), "laserWaveplateAngle_val", "double", 1, 7, 0, 0, 0, 0, 0}, {"{LASR_WPLT}.DMOV", (void *)OFFSET(struct UserVar, laserWaveplateAngle_dmov), "laserWaveplateAngle_dmov", "short", 1, 8, 0, 1, 0, 0, 0}, {"{LASR_ANG_MAX}", (void *)OFFSET(struct UserVar, laserWaveplateAngle_max), "laserWaveplateAngle_max", "double", 1, 9, 0, 1, 0, 0, 0}, {"WPLT:IN20:181:VCC_ANGLE.VAL", (void *)OFFSET(struct UserVar, cameraWaveplateAngle_val), "cameraWaveplateAngle_val", "double", 1, 10, 0, 0, 0, 0, 0}, {"WPLT:IN20:181:VCC_ANGLE.DMOV", (void *)OFFSET(struct UserVar, cameraWaveplateAngle_dmov), "cameraWaveplateAngle_dmov", "short", 1, 11, 0, 1, 0, 0, 0}, {"WPLT:IN20:181:ANG_MAX", (void *)OFFSET(struct UserVar, cameraWaveplateAngle_max), "cameraWaveplateAngle_max", "double", 1, 12, 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[] = { 0x0000005e, }; /* Event mask for state calcuation: */ static bitMask EM_laserPowerControlFSM_calcuation[] = { 0x00000000, }; /* Event mask for state cameraMotorMoving: */ static bitMask EM_laserPowerControlFSM_cameraMotorMoving[] = { 0x00000800, }; /* Event mask for state laserMotorMoving: */ static bitMask EM_laserPowerControlFSM_laserMotorMoving[] = { 0x00000100, }; /* 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 */ sizeof(struct UserVar), /* *pParams */ prog_param, /* numEvents */ NUM_EVENTS, /* encoded options */ (0 | OPT_CONN | OPT_DEBUG | OPT_NEWEF | OPT_REENT), /* 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);