/* C code for program rfResStep, generated by snc from ../rfResStep.st */ #include #include #include #include #include "seq_snc.h" # line 33 "../rfResStep.st" void debugPrintFull(char *pCM, char *pCAV, char *debug_msg, int inhib, int otto, int hAbort, int sgnLim, int absLim, int limA, int dirA, int limB); void debugPrint(char *pCM, char *pCAV, char *debug_msg); /* Variable declarations */ struct seqg_vars { # line 43 "../rfResStep.st" short debug_on; # line 47 "../rfResStep.st" string debug_msg; # line 49 "../rfResStep.st" int stat_msg; # line 66 "../rfResStep.st" char *stat_strings[13]; # line 77 "../rfResStep.st" int uGoPos; # line 82 "../rfResStep.st" int uGoNeg; # line 87 "../rfResStep.st" int uGoSteps; # line 92 "../rfResStep.st" int uAbort; # line 97 "../rfResStep.st" int uClear; # line 106 "../rfResStep.st" int hSteps; # line 110 "../rfResStep.st" int hGo; # line 114 "../rfResStep.st" int hAbort; # line 119 "../rfResStep.st" int hClrDone; # line 125 "../rfResStep.st" int dirAA; # line 130 "../rfResStep.st" int otto; # line 137 "../rfResStep.st" int moving; # line 141 "../rfResStep.st" int dirA; # line 145 "../rfResStep.st" int limB; # line 149 "../rfResStep.st" int limA; # line 153 "../rfResStep.st" int inhib; # line 157 "../rfResStep.st" int sgnLim; # line 161 "../rfResStep.st" int absLim; # line 172 "../rfResStep.st" char *pCM; # line 173 "../rfResStep.st" char *pCAV; # line 175 "../rfResStep.st" int movReqDir; }; /* Function declarations */ #define seqg_var (*(struct seqg_vars *const *)seqg_env) /* Program init func */ static void seqg_init(PROG_ID seqg_env) { { # line 67 "../rfResStep.st" static char *seqg_initvar_stat_strings[13] = {"Await req", "Move req", "Move cmd", "Abort cmd", "Clear cmd", "Moving", "Inhibit", "Auto mode", "Abort", "Sign lim", "Abs lim", "Lim A", "Lim B"}; memcpy(&seqg_var->stat_strings, &seqg_initvar_stat_strings, sizeof(seqg_initvar_stat_strings)); } } /****** Code for state "Init" in state set "RES_HI_HW_LINK" ******/ /* Event function for state "Init" in state set "RES_HI_HW_LINK" */ static seqBool seqg_event_RES_HI_HW_LINK_0_Init(SS_ID seqg_env, int *seqg_ptrn, int *seqg_pnst) { if (TRUE) { *seqg_pnst = 1; *seqg_ptrn = 0; return TRUE; } return FALSE; } /* Action function for state "Init" in state set "RES_HI_HW_LINK" */ static void seqg_action_RES_HI_HW_LINK_0_Init(SS_ID seqg_env, int seqg_trn, int *seqg_pnst) { switch(seqg_trn) { case 0: { # line 185 "../rfResStep.st" seqg_var->pCM = seq_macValueGet(seqg_env, "CM"); # line 186 "../rfResStep.st" seqg_var->pCAV = seq_macValueGet(seqg_env, "CAV"); # line 187 "../rfResStep.st" printf("%s%s0: Entered rfResStep\n", seqg_var->pCM, seqg_var->pCAV); # line 188 "../rfResStep.st" seqg_var->hGo = 0; # line 188 "../rfResStep.st" seq_pvPutTmo(seqg_env, 8/*hGo*/, DEFAULT, DEFAULT_TIMEOUT); # line 189 "../rfResStep.st" seqg_var->hAbort = 0; # line 189 "../rfResStep.st" seq_pvPutTmo(seqg_env, 9/*hAbort*/, DEFAULT, DEFAULT_TIMEOUT); # line 190 "../rfResStep.st" seqg_var->hClrDone = 0; # line 190 "../rfResStep.st" seq_pvPutTmo(seqg_env, 10/*hClrDone*/, DEFAULT, DEFAULT_TIMEOUT); # line 191 "../rfResStep.st" seqg_var->movReqDir = 0; } return; } } /****** Code for state "WaitForButton" in state set "RES_HI_HW_LINK" ******/ /* Event function for state "WaitForButton" in state set "RES_HI_HW_LINK" */ static seqBool seqg_event_RES_HI_HW_LINK_0_WaitForButton(SS_ID seqg_env, int *seqg_ptrn, int *seqg_pnst) { # line 196 "../rfResStep.st" if ((seqg_var->uGoPos != 0) && (seqg_var->uGoNeg != 0)) { *seqg_pnst = 8; *seqg_ptrn = 0; return TRUE; } # line 203 "../rfResStep.st" if (seqg_var->uGoPos != 0) { *seqg_pnst = 2; *seqg_ptrn = 1; return TRUE; } # line 213 "../rfResStep.st" if (seqg_var->uGoNeg != 0) { *seqg_pnst = 2; *seqg_ptrn = 2; return TRUE; } # line 223 "../rfResStep.st" if (seqg_var->uAbort != 0) { *seqg_pnst = 9; *seqg_ptrn = 3; return TRUE; } # line 235 "../rfResStep.st" if (seqg_var->uClear != 0) { *seqg_pnst = 10; *seqg_ptrn = 4; return TRUE; } return FALSE; } /* Action function for state "WaitForButton" in state set "RES_HI_HW_LINK" */ static void seqg_action_RES_HI_HW_LINK_0_WaitForButton(SS_ID seqg_env, int seqg_trn, int *seqg_pnst) { switch(seqg_trn) { case 0: { # line 197 "../rfResStep.st" if (seqg_var->debug_on) { # line 198 "../rfResStep.st" sprintf(seqg_var->debug_msg, "Pos and Neg move requests. Abort"); # line 199 "../rfResStep.st" debugPrintFull(seqg_var->pCM, seqg_var->pCAV, seqg_var->debug_msg, seqg_var->inhib, seqg_var->otto, seqg_var->hAbort, seqg_var->sgnLim, seqg_var->absLim, seqg_var->limA, seqg_var->dirA, seqg_var->limB); } } return; case 1: { # line 204 "../rfResStep.st" seqg_var->stat_msg = 1; # line 205 "../rfResStep.st" seq_pvPutTmo(seqg_env, 1/*stat_msg*/, DEFAULT, DEFAULT_TIMEOUT); # line 206 "../rfResStep.st" if (seqg_var->debug_on) { # line 207 "../rfResStep.st" sprintf(seqg_var->debug_msg, "Received positive move request"); # line 208 "../rfResStep.st" debugPrintFull(seqg_var->pCM, seqg_var->pCAV, seqg_var->debug_msg, seqg_var->inhib, seqg_var->otto, seqg_var->hAbort, seqg_var->sgnLim, seqg_var->absLim, seqg_var->limA, seqg_var->dirA, seqg_var->limB); } # line 210 "../rfResStep.st" seqg_var->movReqDir = 1; } return; case 2: { # line 214 "../rfResStep.st" seqg_var->stat_msg = 1; # line 215 "../rfResStep.st" seq_pvPutTmo(seqg_env, 1/*stat_msg*/, DEFAULT, DEFAULT_TIMEOUT); # line 216 "../rfResStep.st" if (seqg_var->debug_on) { # line 217 "../rfResStep.st" sprintf(seqg_var->debug_msg, "Received negative move request"); # line 218 "../rfResStep.st" debugPrintFull(seqg_var->pCM, seqg_var->pCAV, seqg_var->debug_msg, seqg_var->inhib, seqg_var->otto, seqg_var->hAbort, seqg_var->sgnLim, seqg_var->absLim, seqg_var->limA, seqg_var->dirA, seqg_var->limB); } # line 220 "../rfResStep.st" seqg_var->movReqDir = -1; } return; case 3: { # line 224 "../rfResStep.st" if (seqg_var->debug_on) { # line 225 "../rfResStep.st" sprintf(seqg_var->debug_msg, "Abort request. Set/clear abort bit"); # line 226 "../rfResStep.st" debugPrint(seqg_var->pCM, seqg_var->pCAV, seqg_var->debug_msg); } # line 228 "../rfResStep.st" seqg_var->hAbort = 1; # line 228 "../rfResStep.st" seq_pvPutTmo(seqg_env, 9/*hAbort*/, DEFAULT, DEFAULT_TIMEOUT); # line 229 "../rfResStep.st" epicsThreadSleep((0.1)); # line 230 "../rfResStep.st" seqg_var->hAbort = 0; # line 230 "../rfResStep.st" seq_pvPutTmo(seqg_env, 9/*hAbort*/, DEFAULT, DEFAULT_TIMEOUT); # line 231 "../rfResStep.st" seqg_var->stat_msg = 3; # line 232 "../rfResStep.st" seq_pvPutTmo(seqg_env, 1/*stat_msg*/, DEFAULT, DEFAULT_TIMEOUT); } return; case 4: { # line 236 "../rfResStep.st" if (seqg_var->debug_on) { # line 237 "../rfResStep.st" sprintf(seqg_var->debug_msg, "Clear request. Set/clear clear bit"); # line 238 "../rfResStep.st" debugPrint(seqg_var->pCM, seqg_var->pCAV, seqg_var->debug_msg); } # line 240 "../rfResStep.st" seqg_var->hClrDone = 1; # line 240 "../rfResStep.st" seq_pvPutTmo(seqg_env, 10/*hClrDone*/, DEFAULT, DEFAULT_TIMEOUT); # line 241 "../rfResStep.st" epicsThreadSleep((0.1)); # line 242 "../rfResStep.st" seqg_var->hClrDone = 0; # line 242 "../rfResStep.st" seq_pvPutTmo(seqg_env, 10/*hClrDone*/, DEFAULT, DEFAULT_TIMEOUT); # line 243 "../rfResStep.st" seqg_var->stat_msg = 4; # line 244 "../rfResStep.st" seq_pvPutTmo(seqg_env, 1/*stat_msg*/, DEFAULT, DEFAULT_TIMEOUT); } return; } } /****** Code for state "GoButtonPushed" in state set "RES_HI_HW_LINK" ******/ /* Event function for state "GoButtonPushed" in state set "RES_HI_HW_LINK" */ static seqBool seqg_event_RES_HI_HW_LINK_0_GoButtonPushed(SS_ID seqg_env, int *seqg_ptrn, int *seqg_pnst) { # line 252 "../rfResStep.st" if (seqg_var->moving || seqg_var->inhib || seqg_var->otto || seqg_var->hAbort || (seqg_var->limB && (seqg_var->movReqDir == 1)) || (seqg_var->limA && (seqg_var->movReqDir == -1))) { *seqg_pnst = 8; *seqg_ptrn = 0; return TRUE; } # line 284 "../rfResStep.st" if (seq_delay(seqg_env, (0.1))) { *seqg_pnst = 3; *seqg_ptrn = 1; return TRUE; } return FALSE; } /* Action function for state "GoButtonPushed" in state set "RES_HI_HW_LINK" */ static void seqg_action_RES_HI_HW_LINK_0_GoButtonPushed(SS_ID seqg_env, int seqg_trn, int *seqg_pnst) { switch(seqg_trn) { case 0: { # line 253 "../rfResStep.st" if (seqg_var->moving) # line 254 "../rfResStep.st" seqg_var->stat_msg = 5; else # line 255 "../rfResStep.st" if (seqg_var->inhib) # line 256 "../rfResStep.st" seqg_var->stat_msg = 6; else # line 257 "../rfResStep.st" if (seqg_var->otto) # line 258 "../rfResStep.st" seqg_var->stat_msg = 7; else # line 259 "../rfResStep.st" if (seqg_var->hAbort) { # line 260 "../rfResStep.st" seqg_var->stat_msg = 8; # line 261 "../rfResStep.st" seqg_var->hAbort = 0; # line 261 "../rfResStep.st" seq_pvPutTmo(seqg_env, 9/*hAbort*/, DEFAULT, DEFAULT_TIMEOUT); } else # line 273 "../rfResStep.st" if (seqg_var->limB && (seqg_var->movReqDir == 1)) # line 274 "../rfResStep.st" seqg_var->stat_msg = 11; else # line 275 "../rfResStep.st" if (seqg_var->limA && (seqg_var->movReqDir == -1)) # line 276 "../rfResStep.st" seqg_var->stat_msg = 12; # line 278 "../rfResStep.st" seq_pvPutTmo(seqg_env, 1/*stat_msg*/, DEFAULT, DEFAULT_TIMEOUT); # line 279 "../rfResStep.st" if (seqg_var->debug_on) { # line 280 "../rfResStep.st" printf("Move failed: %s\n", seqg_var->stat_strings[seqg_var->stat_msg]); } } return; case 1: { # line 285 "../rfResStep.st" if (seqg_var->debug_on) { # line 286 "../rfResStep.st" sprintf(seqg_var->debug_msg, "Move command.uGoPos %i, uGoNeg %i, movReqDir %i", seqg_var->uGoPos, seqg_var->uGoNeg, seqg_var->movReqDir); # line 287 "../rfResStep.st" debugPrint(seqg_var->pCM, seqg_var->pCAV, seqg_var->debug_msg); } } return; } } /****** Code for state "Step0" in state set "RES_HI_HW_LINK" ******/ /* Event function for state "Step0" in state set "RES_HI_HW_LINK" */ static seqBool seqg_event_RES_HI_HW_LINK_0_Step0(SS_ID seqg_env, int *seqg_ptrn, int *seqg_pnst) { if (TRUE) { *seqg_pnst = 4; *seqg_ptrn = 0; return TRUE; } return FALSE; } /* Action function for state "Step0" in state set "RES_HI_HW_LINK" */ static void seqg_action_RES_HI_HW_LINK_0_Step0(SS_ID seqg_env, int seqg_trn, int *seqg_pnst) { switch(seqg_trn) { case 0: { # line 295 "../rfResStep.st" seqg_var->hSteps = seqg_var->uGoSteps; # line 295 "../rfResStep.st" seq_pvPutTmo(seqg_env, 7/*hSteps*/, DEFAULT, DEFAULT_TIMEOUT); # line 297 "../rfResStep.st" if (seqg_var->movReqDir >= 0.0) { # line 298 "../rfResStep.st" if (seqg_var->debug_on) { # line 299 "../rfResStep.st" sprintf(seqg_var->debug_msg, "Positive move. Set direction/steps"); } # line 301 "../rfResStep.st" seqg_var->dirAA = 0; # line 301 "../rfResStep.st" seq_pvPutTmo(seqg_env, 11/*dirAA*/, DEFAULT, DEFAULT_TIMEOUT); # line 302 "../rfResStep.st" seqg_var->uGoNeg = 0; # line 302 "../rfResStep.st" seq_pvPutTmo(seqg_env, 3/*uGoNeg*/, DEFAULT, DEFAULT_TIMEOUT); } else { # line 305 "../rfResStep.st" if (seqg_var->debug_on) { # line 306 "../rfResStep.st" sprintf(seqg_var->debug_msg, "Negative move. Set direction/steps"); } # line 308 "../rfResStep.st" seqg_var->dirAA = 1; # line 308 "../rfResStep.st" seq_pvPutTmo(seqg_env, 11/*dirAA*/, DEFAULT, DEFAULT_TIMEOUT); # line 309 "../rfResStep.st" seqg_var->uGoPos = 0; # line 309 "../rfResStep.st" seq_pvPutTmo(seqg_env, 2/*uGoPos*/, DEFAULT, DEFAULT_TIMEOUT); } # line 312 "../rfResStep.st" if (seqg_var->debug_on) { # line 313 "../rfResStep.st" printf("%s%s0: %s\n", seqg_var->pCM, seqg_var->pCAV, seqg_var->debug_msg); # line 314 "../rfResStep.st" printf("%s%s0: %d %d %i\n", seqg_var->pCM, seqg_var->pCAV, seqg_var->uGoSteps, seqg_var->hSteps, seqg_var->dirAA); } } return; } } /****** Code for state "Step1" in state set "RES_HI_HW_LINK" ******/ /* Event function for state "Step1" in state set "RES_HI_HW_LINK" */ static seqBool seqg_event_RES_HI_HW_LINK_0_Step1(SS_ID seqg_env, int *seqg_ptrn, int *seqg_pnst) { # line 320 "../rfResStep.st" if (seq_delay(seqg_env, (0.1))) { *seqg_pnst = 5; *seqg_ptrn = 0; return TRUE; } return FALSE; } /* Action function for state "Step1" in state set "RES_HI_HW_LINK" */ static void seqg_action_RES_HI_HW_LINK_0_Step1(SS_ID seqg_env, int seqg_trn, int *seqg_pnst) { switch(seqg_trn) { case 0: { # line 321 "../rfResStep.st" if (seqg_var->debug_on) { # line 322 "../rfResStep.st" sprintf(seqg_var->debug_msg, "Set/reset clear bit"); # line 323 "../rfResStep.st" debugPrint(seqg_var->pCM, seqg_var->pCAV, seqg_var->debug_msg); } # line 325 "../rfResStep.st" seqg_var->hClrDone = 1; # line 325 "../rfResStep.st" seq_pvPutTmo(seqg_env, 10/*hClrDone*/, DEFAULT, DEFAULT_TIMEOUT); } return; } } /****** Code for state "Step2" in state set "RES_HI_HW_LINK" ******/ /* Event function for state "Step2" in state set "RES_HI_HW_LINK" */ static seqBool seqg_event_RES_HI_HW_LINK_0_Step2(SS_ID seqg_env, int *seqg_ptrn, int *seqg_pnst) { # line 330 "../rfResStep.st" if (seq_delay(seqg_env, (0.1))) { *seqg_pnst = 6; *seqg_ptrn = 0; return TRUE; } return FALSE; } /* Action function for state "Step2" in state set "RES_HI_HW_LINK" */ static void seqg_action_RES_HI_HW_LINK_0_Step2(SS_ID seqg_env, int seqg_trn, int *seqg_pnst) { switch(seqg_trn) { case 0: { # line 331 "../rfResStep.st" seqg_var->hClrDone = 0; # line 331 "../rfResStep.st" seq_pvPutTmo(seqg_env, 10/*hClrDone*/, DEFAULT, DEFAULT_TIMEOUT); } return; } } /****** Code for state "Step3" in state set "RES_HI_HW_LINK" ******/ /* Event function for state "Step3" in state set "RES_HI_HW_LINK" */ static seqBool seqg_event_RES_HI_HW_LINK_0_Step3(SS_ID seqg_env, int *seqg_ptrn, int *seqg_pnst) { # line 336 "../rfResStep.st" if (seq_delay(seqg_env, (0.1))) { *seqg_pnst = 7; *seqg_ptrn = 0; return TRUE; } return FALSE; } /* Action function for state "Step3" in state set "RES_HI_HW_LINK" */ static void seqg_action_RES_HI_HW_LINK_0_Step3(SS_ID seqg_env, int seqg_trn, int *seqg_pnst) { switch(seqg_trn) { case 0: { # line 337 "../rfResStep.st" seqg_var->stat_msg = 2; # line 338 "../rfResStep.st" seq_pvPutTmo(seqg_env, 1/*stat_msg*/, DEFAULT, DEFAULT_TIMEOUT); # line 339 "../rfResStep.st" if (seqg_var->debug_on) { # line 340 "../rfResStep.st" sprintf(seqg_var->debug_msg, "Set/reset go bit"); # line 341 "../rfResStep.st" debugPrint(seqg_var->pCM, seqg_var->pCAV, seqg_var->debug_msg); } # line 343 "../rfResStep.st" seqg_var->stat_msg = 2; # line 344 "../rfResStep.st" seq_pvPutTmo(seqg_env, 1/*stat_msg*/, DEFAULT, DEFAULT_TIMEOUT); # line 345 "../rfResStep.st" seqg_var->hGo = 1; # line 345 "../rfResStep.st" seq_pvPutTmo(seqg_env, 8/*hGo*/, DEFAULT, DEFAULT_TIMEOUT); } return; } } /****** Code for state "Step4" in state set "RES_HI_HW_LINK" ******/ /* Event function for state "Step4" in state set "RES_HI_HW_LINK" */ static seqBool seqg_event_RES_HI_HW_LINK_0_Step4(SS_ID seqg_env, int *seqg_ptrn, int *seqg_pnst) { # line 350 "../rfResStep.st" if (seq_delay(seqg_env, (0.1))) { *seqg_pnst = 8; *seqg_ptrn = 0; return TRUE; } return FALSE; } /* Action function for state "Step4" in state set "RES_HI_HW_LINK" */ static void seqg_action_RES_HI_HW_LINK_0_Step4(SS_ID seqg_env, int seqg_trn, int *seqg_pnst) { switch(seqg_trn) { case 0: { # line 351 "../rfResStep.st" seqg_var->hGo = 0; # line 351 "../rfResStep.st" seq_pvPutTmo(seqg_env, 8/*hGo*/, DEFAULT, DEFAULT_TIMEOUT); } return; } } /****** Code for state "GoDelay" in state set "RES_HI_HW_LINK" ******/ /* Event function for state "GoDelay" in state set "RES_HI_HW_LINK" */ static seqBool seqg_event_RES_HI_HW_LINK_0_GoDelay(SS_ID seqg_env, int *seqg_ptrn, int *seqg_pnst) { # line 356 "../rfResStep.st" if (seq_delay(seqg_env, (0.1))) { *seqg_pnst = 1; *seqg_ptrn = 0; return TRUE; } return FALSE; } /* Action function for state "GoDelay" in state set "RES_HI_HW_LINK" */ static void seqg_action_RES_HI_HW_LINK_0_GoDelay(SS_ID seqg_env, int seqg_trn, int *seqg_pnst) { switch(seqg_trn) { case 0: { # line 357 "../rfResStep.st" if (seqg_var->debug_on) { # line 358 "../rfResStep.st" sprintf(seqg_var->debug_msg, "Clear all requests. Await next request\n"); # line 359 "../rfResStep.st" debugPrint(seqg_var->pCM, seqg_var->pCAV, seqg_var->debug_msg); } # line 361 "../rfResStep.st" seqg_var->movReqDir = 0; # line 362 "../rfResStep.st" seqg_var->uGoPos = 0; # line 362 "../rfResStep.st" seq_pvPutTmo(seqg_env, 2/*uGoPos*/, DEFAULT, DEFAULT_TIMEOUT); # line 363 "../rfResStep.st" seqg_var->uGoNeg = 0; # line 363 "../rfResStep.st" seq_pvPutTmo(seqg_env, 3/*uGoNeg*/, DEFAULT, DEFAULT_TIMEOUT); } return; } } /****** Code for state "AbortDelay" in state set "RES_HI_HW_LINK" ******/ /* Event function for state "AbortDelay" in state set "RES_HI_HW_LINK" */ static seqBool seqg_event_RES_HI_HW_LINK_0_AbortDelay(SS_ID seqg_env, int *seqg_ptrn, int *seqg_pnst) { # line 368 "../rfResStep.st" if (seq_delay(seqg_env, (0.1))) { *seqg_pnst = 1; *seqg_ptrn = 0; return TRUE; } return FALSE; } /* Action function for state "AbortDelay" in state set "RES_HI_HW_LINK" */ static void seqg_action_RES_HI_HW_LINK_0_AbortDelay(SS_ID seqg_env, int seqg_trn, int *seqg_pnst) { switch(seqg_trn) { case 0: { # line 369 "../rfResStep.st" if (seqg_var->debug_on) { # line 370 "../rfResStep.st" sprintf(seqg_var->debug_msg, "Clear abort request\n"); # line 371 "../rfResStep.st" debugPrint(seqg_var->pCM, seqg_var->pCAV, seqg_var->debug_msg); } # line 373 "../rfResStep.st" seqg_var->uAbort = 0; # line 373 "../rfResStep.st" seq_pvPutTmo(seqg_env, 5/*uAbort*/, DEFAULT, DEFAULT_TIMEOUT); } return; } } /****** Code for state "ClearDelay" in state set "RES_HI_HW_LINK" ******/ /* Event function for state "ClearDelay" in state set "RES_HI_HW_LINK" */ static seqBool seqg_event_RES_HI_HW_LINK_0_ClearDelay(SS_ID seqg_env, int *seqg_ptrn, int *seqg_pnst) { # line 378 "../rfResStep.st" if (seq_delay(seqg_env, (0.1))) { *seqg_pnst = 1; *seqg_ptrn = 0; return TRUE; } return FALSE; } /* Action function for state "ClearDelay" in state set "RES_HI_HW_LINK" */ static void seqg_action_RES_HI_HW_LINK_0_ClearDelay(SS_ID seqg_env, int seqg_trn, int *seqg_pnst) { switch(seqg_trn) { case 0: { # line 379 "../rfResStep.st" if (seqg_var->debug_on) { # line 380 "../rfResStep.st" sprintf(seqg_var->debug_msg, "Clear clear request\n"); # line 381 "../rfResStep.st" debugPrint(seqg_var->pCM, seqg_var->pCAV, seqg_var->debug_msg); } # line 383 "../rfResStep.st" seqg_var->uClear = 0; # line 383 "../rfResStep.st" seq_pvPutTmo(seqg_env, 6/*uClear*/, DEFAULT, DEFAULT_TIMEOUT); } return; } } #undef seqg_var /************************ Tables ************************/ /* Channel table */ static seqChan seqg_chans[] = { /* chName, offset, varName, varType, count, eventNum, efId, monitored, queueSize, queueIndex */ {"{CM}{CAV}0:STEP:DBGCTRL", offsetof(struct seqg_vars, debug_on), "debug_on", P_SHORT, 1, 1, 0, 1, 0, 0}, {"{CM}{CAV}0:STEP:STATMSG", offsetof(struct seqg_vars, stat_msg), "stat_msg", P_INT, 1, 2, 0, 0, 0, 0}, {"{CM}{CAV}0:STEP:MOV_REQ_POS", offsetof(struct seqg_vars, uGoPos), "uGoPos", P_INT, 1, 3, 0, 1, 0, 0}, {"{CM}{CAV}0:STEP:MOV_REQ_NEG", offsetof(struct seqg_vars, uGoNeg), "uGoNeg", P_INT, 1, 4, 0, 1, 0, 0}, {"{CM}{CAV}0:STEP:NSTEPS", offsetof(struct seqg_vars, uGoSteps), "uGoSteps", P_INT, 1, 5, 0, 1, 0, 0}, {"{CM}{CAV}0:STEP:ABORT_REQ", offsetof(struct seqg_vars, uAbort), "uAbort", P_INT, 1, 6, 0, 1, 0, 0}, {"{CM}{CAV}0:STEP:CLEAR_REQ", offsetof(struct seqg_vars, uClear), "uClear", P_INT, 1, 7, 0, 1, 0, 0}, {"{CM}{CAV}0:STEP:REG_NSTEPS", offsetof(struct seqg_vars, hSteps), "hSteps", P_INT, 1, 8, 0, 0, 0, 0}, {"{CM}{CAV}0:STEP:CTRLWRD.B0", offsetof(struct seqg_vars, hGo), "hGo", P_INT, 1, 9, 0, 0, 0, 0}, {"{CM}{CAV}0:STEP:CTRLWRD.B3", offsetof(struct seqg_vars, hAbort), "hAbort", P_INT, 1, 10, 0, 1, 0, 0}, {"{CM}{CAV}0:STEP:CTRLWRD.B4", offsetof(struct seqg_vars, hClrDone), "hClrDone", P_INT, 1, 11, 0, 0, 0, 0}, {"{CM}{CAV}0:STEP:CTRLWRD.B5", offsetof(struct seqg_vars, dirAA), "dirAA", P_INT, 1, 12, 0, 1, 0, 0}, {"{CM}{CAV}0:STEP:CTRLWRD.B7", offsetof(struct seqg_vars, otto), "otto", P_INT, 1, 13, 0, 1, 0, 0}, {"{CM}{CAV}0:STEP:STATWRD.B0", offsetof(struct seqg_vars, moving), "moving", P_INT, 1, 14, 0, 1, 0, 0}, {"{CM}{CAV}0:STEP:STATWRD.B1", offsetof(struct seqg_vars, dirA), "dirA", P_INT, 1, 15, 0, 1, 0, 0}, {"{CM}{CAV}0:STEP:STATWRD.B3", offsetof(struct seqg_vars, limB), "limB", P_INT, 1, 16, 0, 1, 0, 0}, {"{CM}{CAV}0:STEP:STATWRD.B4", offsetof(struct seqg_vars, limA), "limA", P_INT, 1, 17, 0, 1, 0, 0}, {"{CM}{CAV}0:STEP:STATWRD.B6", offsetof(struct seqg_vars, inhib), "inhib", P_INT, 1, 18, 0, 1, 0, 0}, {"{CM}{CAV}0:STEP:STATWRD.B8", offsetof(struct seqg_vars, sgnLim), "sgnLim", P_INT, 1, 19, 0, 1, 0, 0}, {"{CM}{CAV}0:STEP:STATWRD.B9", offsetof(struct seqg_vars, absLim), "absLim", P_INT, 1, 20, 0, 1, 0, 0}, }; /* Event masks for state set "RES_HI_HW_LINK" */ static const seqMask seqg_mask_RES_HI_HW_LINK_0_Init[] = { 0x00000000, }; static const seqMask seqg_mask_RES_HI_HW_LINK_0_WaitForButton[] = { 0x000000d8, }; static const seqMask seqg_mask_RES_HI_HW_LINK_0_GoButtonPushed[] = { 0x00076400, }; static const seqMask seqg_mask_RES_HI_HW_LINK_0_Step0[] = { 0x00000000, }; static const seqMask seqg_mask_RES_HI_HW_LINK_0_Step1[] = { 0x00000000, }; static const seqMask seqg_mask_RES_HI_HW_LINK_0_Step2[] = { 0x00000000, }; static const seqMask seqg_mask_RES_HI_HW_LINK_0_Step3[] = { 0x00000000, }; static const seqMask seqg_mask_RES_HI_HW_LINK_0_Step4[] = { 0x00000000, }; static const seqMask seqg_mask_RES_HI_HW_LINK_0_GoDelay[] = { 0x00000000, }; static const seqMask seqg_mask_RES_HI_HW_LINK_0_AbortDelay[] = { 0x00000000, }; static const seqMask seqg_mask_RES_HI_HW_LINK_0_ClearDelay[] = { 0x00000000, }; /* State table for state set "RES_HI_HW_LINK" */ static seqState seqg_states_RES_HI_HW_LINK[] = { { /* state name */ "Init", /* action function */ seqg_action_RES_HI_HW_LINK_0_Init, /* event function */ seqg_event_RES_HI_HW_LINK_0_Init, /* entry function */ 0, /* exit function */ 0, /* event mask array */ seqg_mask_RES_HI_HW_LINK_0_Init, /* state options */ (0) }, { /* state name */ "WaitForButton", /* action function */ seqg_action_RES_HI_HW_LINK_0_WaitForButton, /* event function */ seqg_event_RES_HI_HW_LINK_0_WaitForButton, /* entry function */ 0, /* exit function */ 0, /* event mask array */ seqg_mask_RES_HI_HW_LINK_0_WaitForButton, /* state options */ (0) }, { /* state name */ "GoButtonPushed", /* action function */ seqg_action_RES_HI_HW_LINK_0_GoButtonPushed, /* event function */ seqg_event_RES_HI_HW_LINK_0_GoButtonPushed, /* entry function */ 0, /* exit function */ 0, /* event mask array */ seqg_mask_RES_HI_HW_LINK_0_GoButtonPushed, /* state options */ (0) }, { /* state name */ "Step0", /* action function */ seqg_action_RES_HI_HW_LINK_0_Step0, /* event function */ seqg_event_RES_HI_HW_LINK_0_Step0, /* entry function */ 0, /* exit function */ 0, /* event mask array */ seqg_mask_RES_HI_HW_LINK_0_Step0, /* state options */ (0) }, { /* state name */ "Step1", /* action function */ seqg_action_RES_HI_HW_LINK_0_Step1, /* event function */ seqg_event_RES_HI_HW_LINK_0_Step1, /* entry function */ 0, /* exit function */ 0, /* event mask array */ seqg_mask_RES_HI_HW_LINK_0_Step1, /* state options */ (0) }, { /* state name */ "Step2", /* action function */ seqg_action_RES_HI_HW_LINK_0_Step2, /* event function */ seqg_event_RES_HI_HW_LINK_0_Step2, /* entry function */ 0, /* exit function */ 0, /* event mask array */ seqg_mask_RES_HI_HW_LINK_0_Step2, /* state options */ (0) }, { /* state name */ "Step3", /* action function */ seqg_action_RES_HI_HW_LINK_0_Step3, /* event function */ seqg_event_RES_HI_HW_LINK_0_Step3, /* entry function */ 0, /* exit function */ 0, /* event mask array */ seqg_mask_RES_HI_HW_LINK_0_Step3, /* state options */ (0) }, { /* state name */ "Step4", /* action function */ seqg_action_RES_HI_HW_LINK_0_Step4, /* event function */ seqg_event_RES_HI_HW_LINK_0_Step4, /* entry function */ 0, /* exit function */ 0, /* event mask array */ seqg_mask_RES_HI_HW_LINK_0_Step4, /* state options */ (0) }, { /* state name */ "GoDelay", /* action function */ seqg_action_RES_HI_HW_LINK_0_GoDelay, /* event function */ seqg_event_RES_HI_HW_LINK_0_GoDelay, /* entry function */ 0, /* exit function */ 0, /* event mask array */ seqg_mask_RES_HI_HW_LINK_0_GoDelay, /* state options */ (0) }, { /* state name */ "AbortDelay", /* action function */ seqg_action_RES_HI_HW_LINK_0_AbortDelay, /* event function */ seqg_event_RES_HI_HW_LINK_0_AbortDelay, /* entry function */ 0, /* exit function */ 0, /* event mask array */ seqg_mask_RES_HI_HW_LINK_0_AbortDelay, /* state options */ (0) }, { /* state name */ "ClearDelay", /* action function */ seqg_action_RES_HI_HW_LINK_0_ClearDelay, /* event function */ seqg_event_RES_HI_HW_LINK_0_ClearDelay, /* entry function */ 0, /* exit function */ 0, /* event mask array */ seqg_mask_RES_HI_HW_LINK_0_ClearDelay, /* state options */ (0) }, }; /* State set table */ static seqSS seqg_statesets[] = { { /* state set name */ "RES_HI_HW_LINK", /* states */ seqg_states_RES_HI_HW_LINK, /* number of states */ 11 }, }; /* Program table (global) */ seqProgram rfResStep = { /* magic number */ 2002004, /* program name */ "rfResStep", /* channels */ seqg_chans, /* num. channels */ 20, /* state sets */ seqg_statesets, /* num. state sets */ 1, /* user var size */ sizeof(struct seqg_vars), /* param */ "", /* num. event flags */ 0, /* encoded options */ (0 | OPT_CONN | OPT_NEWEF | OPT_REENT), /* init func */ seqg_init, /* entry func */ 0, /* exit func */ 0, /* num. queues */ 0 }; # line 390 "../rfResStep.st" void debugPrintFull(char *pCM, char *pCAV, char *debug_msg, int inhib, int otto, int hAbort, int sgnLim, int absLim, int limA, int dirA, int limB) { printf("%s%s0: %s\n", pCM, pCAV, debug_msg); printf("%s%s0: %d %d %d %d %d %d %d %d %d\n", pCM, pCAV, inhib, otto, hAbort, sgnLim, absLim, limA, dirA, limB, !dirA); } void debugPrint(char *pCM, char *pCAV, char *debug_msg) { printf("%s%s0: %s\n", pCM, pCAV, debug_msg); } /* Register sequencer commands and program */ #include "epicsExport.h" static void rfResStepRegistrar (void) { seqRegisterSequencerCommands(); seqRegisterSequencerProgram (&rfResStep); } epicsExportRegistrar(rfResStepRegistrar);