/* Generated with snc from laserPowerControl.i */ /* Program "laserPowerControl" */ #include #include #include #include #include "epicsTypes.h" #include "seqCom.h" /* Variable declarations */ # line 71 "../laserPowerControl.st" static double laserPowerSetPoint = 0; # line 75 "../laserPowerControl.st" static double cameraPowerSetPoint = 0; # line 79 "../laserPowerControl.st" static string statusStr = ""; # line 83 "../laserPowerControl.st" static double laserWaveplateAngle_val = 0; # line 86 "../laserPowerControl.st" static short laserWaveplateAngle_dmov = 0; # line 90 "../laserPowerControl.st" static double laserWaveplateAngle_max = 0; # line 95 "../laserPowerControl.st" static double cameraWaveplateAngle_val = 0; # line 98 "../laserPowerControl.st" static short cameraWaveplateAngle_dmov = 0; # line 102 "../laserPowerControl.st" static double cameraWaveplateAngle_max = 0; # line 118 "../laserPowerControl.st" static double newLaserPower = 0; # line 119 "../laserPowerControl.st" static double newCameraPower = 0; # line 121 "../laserPowerControl.st" static double oldLaserPower = 0; # line 122 "../laserPowerControl.st" static double oldCameraPower = 0; # line 124 "../laserPowerControl.st" static double cosLaserAngle = 0; # line 125 "../laserPowerControl.st" static double cosCameraAngle = 0; # line 127 "../laserPowerControl.st" static double newLaserAngle = 0; # line 128 "../laserPowerControl.st" static double newCameraAngle = 0; # line 130 "../laserPowerControl.st" static int ctrlFlag = 0; # line 135 "../laserPowerControl.st" static int exceptionCode = 0; /* C code definitions */ # line 38 "../laserPowerControl.st" #include "stdio.h" # line 39 "../laserPowerControl.st" #include "string.h" # line 40 "../laserPowerControl.st" #include "math.h" # line 41 "../laserPowerControl.st" #include "epicsTime.h" /* Program init func */ static void G_prog_init(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) { # line 153 "../laserPowerControl.st" if (0) # line 153 "../laserPowerControl.st" 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 167 "../laserPowerControl.st" if (laserPowerSetPoint <= 0) { # line 168 "../laserPowerControl.st" if (seq_pvGet(ssId, 3/*laserWaveplateAngle_val*/, 0) == pvStatOK && seq_pvGet(ssId, 6/*cameraWaveplateAngle_val*/, 0) == pvStatOK) { # line 170 "../laserPowerControl.st" cosLaserAngle = cos(2 * ((laserWaveplateAngle_val - laserWaveplateAngle_max) * 3.1415926 / 180.0)); # line 171 "../laserPowerControl.st" cosCameraAngle = cos(2 * ((cameraWaveplateAngle_val - cameraWaveplateAngle_max) * 3.1415926 / 180.0)); # line 173 "../laserPowerControl.st" laserPowerSetPoint = 100.0 * cosLaserAngle * cosLaserAngle; # line 174 "../laserPowerControl.st" cameraPowerSetPoint = 100.0 * cosCameraAngle * cosCameraAngle; # line 177 "../laserPowerControl.st" cameraPowerSetPoint = cameraPowerSetPoint * laserPowerSetPoint / 100.0; # line 179 "../laserPowerControl.st" seq_pvPut(ssId, 0/*laserPowerSetPoint*/, 0); # line 180 "../laserPowerControl.st" seq_pvPut(ssId, 1/*cameraPowerSetPoint*/, 0); # line 182 "../laserPowerControl.st" 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) { } /* Event function for state "init" in state set "laserPowerControlFSM" */ static seqBool E_laserPowerControlFSM_init(SS_ID ssId, struct UserVar *pVar, int *pTransNum, int *pNextState) { # line 188 "../laserPowerControl.st" if (seq_pvConnectCount(ssId) != seq_pvChannelCount(ssId)) { *pNextState = 5; *pTransNum = 0; return TRUE; } # line 193 "../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, int transNum, int *pNextState) { switch(transNum) { case 0: { # line 189 "../laserPowerControl.st" exceptionCode = 1; # line 190 "../laserPowerControl.st" if (0) # line 190 "../laserPowerControl.st" printf("laserPowerControlFSM:init - transient to exceptionHandling\n"); } return; case 1: { # line 194 "../laserPowerControl.st" if (0) # line 194 "../laserPowerControl.st" 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) { } /* Event function for state "idle" in state set "laserPowerControlFSM" */ static seqBool E_laserPowerControlFSM_idle(SS_ID ssId, struct UserVar *pVar, int *pTransNum, int *pNextState) { # line 203 "../laserPowerControl.st" if ((seq_efTestAndClear(ssId, 1/*eventLaserPowerSetPointChange*/) || seq_efTestAndClear(ssId, 2/*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, int transNum, int *pNextState) { switch(transNum) { case 0: { # line 204 "../laserPowerControl.st" if (0) # line 204 "../laserPowerControl.st" 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) { # line 213 "../laserPowerControl.st" if (0) # line 213 "../laserPowerControl.st" printf("laserPowerControlFSM:calculation - entry\n"); # line 216 "../laserPowerControl.st" ctrlFlag = 0; # line 219 "../laserPowerControl.st" newLaserPower = laserPowerSetPoint; # line 221 "../laserPowerControl.st" if (newLaserPower == 0) # line 221 "../laserPowerControl.st" newCameraPower = 100.0; else # line 222 "../laserPowerControl.st" 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 230 "../laserPowerControl.st" if (seq_pvGet(ssId, 3/*laserWaveplateAngle_val*/, 0) == pvStatOK && seq_pvGet(ssId, 6/*cameraWaveplateAngle_val*/, 0) == pvStatOK) { # line 232 "../laserPowerControl.st" cosLaserAngle = cos(2 * ((laserWaveplateAngle_val - laserWaveplateAngle_max) * 3.1415926 / 180.0)); # line 233 "../laserPowerControl.st" cosCameraAngle = cos(2 * ((cameraWaveplateAngle_val - cameraWaveplateAngle_max) * 3.1415926 / 180.0)); # line 235 "../laserPowerControl.st" oldLaserPower = 100.0 * cosLaserAngle * cosLaserAngle; # line 236 "../laserPowerControl.st" oldCameraPower = 100.0 * cosCameraAngle * cosCameraAngle; # line 239 "../laserPowerControl.st" newLaserAngle = laserWaveplateAngle_max - 0.5 * ((acos(sqrt(newLaserPower / 100.0))) * 180.0 / 3.1415926); # line 240 "../laserPowerControl.st" newCameraAngle = cameraWaveplateAngle_max - 0.5 * ((acos(sqrt(newCameraPower / 100.0))) * 180.0 / 3.1415926); # line 242 "../laserPowerControl.st" printf("newLaserPower = %lf, oldLaserPower = %lf\n", newLaserPower, oldLaserPower); # line 245 "../laserPowerControl.st" if (newLaserPower > oldLaserPower) # line 245 "../laserPowerControl.st" ctrlFlag = 2; else # line 246 "../laserPowerControl.st" ctrlFlag = 1; } } /* Delay function for state "calcuation" in state set "laserPowerControlFSM" */ static void D_laserPowerControlFSM_calcuation(SS_ID ssId, struct UserVar *pVar) { } /* Event function for state "calcuation" in state set "laserPowerControlFSM" */ static seqBool E_laserPowerControlFSM_calcuation(SS_ID ssId, struct UserVar *pVar, int *pTransNum, int *pNextState) { # line 251 "../laserPowerControl.st" if (ctrlFlag == 1) { *pNextState = 4; *pTransNum = 0; return TRUE; } # line 256 "../laserPowerControl.st" if (ctrlFlag == 2) { *pNextState = 3; *pTransNum = 1; return TRUE; } # line 261 "../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, int transNum, int *pNextState) { switch(transNum) { case 0: { # line 252 "../laserPowerControl.st" if (0) # line 252 "../laserPowerControl.st" printf("laserPowerControlFSM:calculation - transient to laserMotorMoving\n"); } return; case 1: { # line 257 "../laserPowerControl.st" if (0) # line 257 "../laserPowerControl.st" printf("laserPowerControlFSM:calculation - transient to cameraMotorMoving\n"); } return; case 2: { # line 262 "../laserPowerControl.st" exceptionCode = 2; # line 263 "../laserPowerControl.st" if (0) # line 263 "../laserPowerControl.st" 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) { # line 273 "../laserPowerControl.st" if (0) # line 273 "../laserPowerControl.st" 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 290 "../laserPowerControl.st" seq_delayInit(ssId, 0, (60)); } /* Event function for state "cameraMotorMoving" in state set "laserPowerControlFSM" */ static seqBool E_laserPowerControlFSM_cameraMotorMoving(SS_ID ssId, struct UserVar *pVar, int *pTransNum, int *pNextState) { # line 279 "../laserPowerControl.st" if (cameraWaveplateAngle_dmov == 1 && ctrlFlag == 2) { *pNextState = 4; *pTransNum = 0; return TRUE; } # line 284 "../laserPowerControl.st" if (cameraWaveplateAngle_dmov == 1 && ctrlFlag == 1) { *pNextState = 5; *pTransNum = 1; return TRUE; } # line 290 "../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, int transNum, int *pNextState) { switch(transNum) { case 0: { # line 280 "../laserPowerControl.st" if (0) # line 280 "../laserPowerControl.st" printf("laserPowerControlFSM:cameraMotorMoving - transient to laserMotorMoving\n"); } return; case 1: { # line 285 "../laserPowerControl.st" exceptionCode = 0; # line 286 "../laserPowerControl.st" if (0) # line 286 "../laserPowerControl.st" printf("laserPowerControlFSM:cameraMotorMoving - transient to exception handling (succeed)\n"); } return; case 2: { # line 291 "../laserPowerControl.st" exceptionCode = 4; # line 292 "../laserPowerControl.st" if (0) # line 292 "../laserPowerControl.st" 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) { # line 302 "../laserPowerControl.st" if (0) # line 302 "../laserPowerControl.st" 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 319 "../laserPowerControl.st" seq_delayInit(ssId, 0, (60)); } /* Event function for state "laserMotorMoving" in state set "laserPowerControlFSM" */ static seqBool E_laserPowerControlFSM_laserMotorMoving(SS_ID ssId, struct UserVar *pVar, int *pTransNum, int *pNextState) { # line 308 "../laserPowerControl.st" if (laserWaveplateAngle_dmov == 1 && ctrlFlag == 1) { *pNextState = 3; *pTransNum = 0; return TRUE; } # line 313 "../laserPowerControl.st" if (laserWaveplateAngle_dmov == 1 && ctrlFlag == 2) { *pNextState = 5; *pTransNum = 1; return TRUE; } # line 319 "../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, int transNum, int *pNextState) { switch(transNum) { case 0: { # line 309 "../laserPowerControl.st" if (0) # line 309 "../laserPowerControl.st" printf("laserPowerControlFSM:laserMotorMoving - transient to cameraMotorMoving\n"); } return; case 1: { # line 314 "../laserPowerControl.st" exceptionCode = 0; # line 315 "../laserPowerControl.st" if (0) # line 315 "../laserPowerControl.st" printf("laserPowerControlFSM:laserMotorMoving - transient to exception handling (succeed)\n"); } return; case 2: { # line 320 "../laserPowerControl.st" exceptionCode = 3; # line 321 "../laserPowerControl.st" if (0) # line 321 "../laserPowerControl.st" 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) { # line 330 "../laserPowerControl.st" if (0) # line 330 "../laserPowerControl.st" printf("laserPowerControlFSM:exceptionHandling - entry\n"); # line 332 "../laserPowerControl.st" if (exceptionCode == 0) { # line 333 "../laserPowerControl.st" sprintf(statusStr, "OK"); # line 334 "../laserPowerControl.st" if (0) # line 334 "../laserPowerControl.st" printf("laserPowerControlFSM:exceptionHandling - Motor move OK\n"); } else # line 336 "../laserPowerControl.st" if (exceptionCode == -1) { # line 337 "../laserPowerControl.st" sprintf(statusStr, "Failure"); # line 338 "../laserPowerControl.st" if (0) # line 338 "../laserPowerControl.st" printf("laserPowerControlFSM:exceptionHandling - Failure\n"); } else # line 340 "../laserPowerControl.st" if (exceptionCode == 1) { # line 341 "../laserPowerControl.st" sprintf(statusStr, "Not all channel connected"); # line 342 "../laserPowerControl.st" if (0) # line 342 "../laserPowerControl.st" printf("laserPowerControlFSM:exceptionHandling - Not all channel connected\n"); } else # line 344 "../laserPowerControl.st" if (exceptionCode == 2) { # line 345 "../laserPowerControl.st" sprintf(statusStr, "Undfined motor instruction"); # line 346 "../laserPowerControl.st" if (0) # line 346 "../laserPowerControl.st" printf("laserPowerControlFSM:exceptionHandling - Undfined motor instruction\n"); } else # line 348 "../laserPowerControl.st" if (exceptionCode == 3) { # line 349 "../laserPowerControl.st" sprintf(statusStr, "Laser motor failure"); # line 350 "../laserPowerControl.st" if (0) # line 350 "../laserPowerControl.st" printf("laserPowerControlFSM:exceptionHandling - Laser motor failure\n"); } else # line 352 "../laserPowerControl.st" if (exceptionCode == 4) { # line 353 "../laserPowerControl.st" sprintf(statusStr, "Camera motor failure"); # line 354 "../laserPowerControl.st" if (0) # line 354 "../laserPowerControl.st" printf("laserPowerControlFSM:exceptionHandling - Camera motor failure\n"); } else { # line 357 "../laserPowerControl.st" sprintf(statusStr, "Unknown exceptions"); # line 358 "../laserPowerControl.st" if (0) # line 358 "../laserPowerControl.st" 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) { } /* Event function for state "exceptionHandling" in state set "laserPowerControlFSM" */ static seqBool E_laserPowerControlFSM_exceptionHandling(SS_ID ssId, struct UserVar *pVar, int *pTransNum, int *pNextState) { 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, int transNum, int *pNextState) { switch(transNum) { case 0: { # line 365 "../laserPowerControl.st" if (0) # line 365 "../laserPowerControl.st" printf("laserPowerControlFSM:exceptionHandling - transient to idle\n"); } return; } } /************************ Tables ************************/ /* Channel table */ static seqChan G_channels[] = { /* chName, offset, varName, varType, count, eventNum, efId, monitored, queueSize, queueIndex */ {"IOC:IN20:LS11:PCTRL", (size_t)&laserPowerSetPoint, "laserPowerSetPoint", "double", 1, 3, 1, 1, 0, 0}, {"IOC:IN20:LS11:CCTRL", (size_t)&cameraPowerSetPoint, "cameraPowerSetPoint", "double", 1, 4, 2, 1, 0, 0}, {"IOC:IN20:LS11:PCSTATUS", (size_t)&statusStr, "statusStr", "string", 1, 5, 0, 0, 0, 0}, {"WPLT:LR20:116:WP2_ANGLE.VAL", (size_t)&laserWaveplateAngle_val, "laserWaveplateAngle_val", "double", 1, 6, 0, 0, 0, 0}, {"WPLT:LR20:116:WP2_ANGLE.DMOV", (size_t)&laserWaveplateAngle_dmov, "laserWaveplateAngle_dmov", "short", 1, 7, 0, 1, 0, 0}, {"WPLT:LR20:116:ANG_MAX", (size_t)&laserWaveplateAngle_max, "laserWaveplateAngle_max", "double", 1, 8, 0, 1, 0, 0}, {"WPLT:IN20:181:VCC_ANGLE.VAL", (size_t)&cameraWaveplateAngle_val, "cameraWaveplateAngle_val", "double", 1, 9, 0, 0, 0, 0}, {"WPLT:IN20:181:VCC_ANGLE.DMOV", (size_t)&cameraWaveplateAngle_dmov, "cameraWaveplateAngle_dmov", "short", 1, 10, 0, 1, 0, 0}, {"WPLT:IN20:181:ANG_MAX", (size_t)&cameraWaveplateAngle_max, "cameraWaveplateAngle_max", "double", 1, 11, 0, 1, 0, 0} }; /* Event masks for state set "laserPowerControlFSM" */ static const seqMask EM_laserPowerControlFSM_init[] = { 0x00000000, }; static const seqMask EM_laserPowerControlFSM_idle[] = { 0x0000001e, }; static const seqMask EM_laserPowerControlFSM_calcuation[] = { 0x00000000, }; static const seqMask EM_laserPowerControlFSM_cameraMotorMoving[] = { 0x00000400, }; static const seqMask EM_laserPowerControlFSM_laserMotorMoving[] = { 0x00000080, }; static const seqMask EM_laserPowerControlFSM_exceptionHandling[] = { 0x00000000, }; /* State table for state set "laserPowerControlFSM" */ static seqState G_laserPowerControlFSM_states[] = { { /* state name */ "init", /* action function */ A_laserPowerControlFSM_init, /* event function */ E_laserPowerControlFSM_init, /* delay function */ D_laserPowerControlFSM_init, /* entry function */ I_laserPowerControlFSM_init, /* exit function */ 0, /* event mask array */ EM_laserPowerControlFSM_init, /* state options */ (0) }, { /* state name */ "idle", /* action function */ A_laserPowerControlFSM_idle, /* event function */ E_laserPowerControlFSM_idle, /* delay function */ D_laserPowerControlFSM_idle, /* entry function */ 0, /* exit function */ 0, /* event mask array */ EM_laserPowerControlFSM_idle, /* state options */ (0) }, { /* state name */ "calcuation", /* action function */ A_laserPowerControlFSM_calcuation, /* event function */ E_laserPowerControlFSM_calcuation, /* delay function */ D_laserPowerControlFSM_calcuation, /* entry function */ I_laserPowerControlFSM_calcuation, /* exit function */ 0, /* event mask array */ EM_laserPowerControlFSM_calcuation, /* state options */ (0) }, { /* state name */ "cameraMotorMoving", /* action function */ A_laserPowerControlFSM_cameraMotorMoving, /* event function */ E_laserPowerControlFSM_cameraMotorMoving, /* delay function */ D_laserPowerControlFSM_cameraMotorMoving, /* entry function */ I_laserPowerControlFSM_cameraMotorMoving, /* exit function */ 0, /* event mask array */ EM_laserPowerControlFSM_cameraMotorMoving, /* state options */ (0) }, { /* state name */ "laserMotorMoving", /* action function */ A_laserPowerControlFSM_laserMotorMoving, /* event function */ E_laserPowerControlFSM_laserMotorMoving, /* delay function */ D_laserPowerControlFSM_laserMotorMoving, /* entry function */ I_laserPowerControlFSM_laserMotorMoving, /* exit function */ 0, /* event mask array */ EM_laserPowerControlFSM_laserMotorMoving, /* state options */ (0) }, { /* state name */ "exceptionHandling", /* action function */ A_laserPowerControlFSM_exceptionHandling, /* event function */ E_laserPowerControlFSM_exceptionHandling, /* delay function */ D_laserPowerControlFSM_exceptionHandling, /* entry function */ I_laserPowerControlFSM_exceptionHandling, /* exit function */ 0, /* event mask array */ EM_laserPowerControlFSM_exceptionHandling, /* state options */ (0) }, }; /* State set table */ static seqSS G_state_sets[] = { { /* state set name */ "laserPowerControlFSM", /* states */ G_laserPowerControlFSM_states, /* number of states */ 6, /* number of delays */ 1 }, }; /* Program table (global) */ seqProgram laserPowerControl = { /* magic number */ 2001006, /* program name */ "laserPowerControl", /* channels */ G_channels, /* num. channels */ 9, /* state sets */ G_state_sets, /* num. state sets */ 1, /* user var size */ 0, /* param */ "", /* num. event flags */ 2, /* encoded options */ (0 | OPT_CONN | OPT_DEBUG | 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 laserPowerControlRegistrar (void) { seqRegisterSequencerCommands(); seqRegisterSequencerProgram (&laserPowerControl); } epicsExportRegistrar(laserPowerControlRegistrar);