/* Generated with snc from chirpUpdate.i */ /* Program "chirpUpdate" */ #include #include #include #include #include "epicsTypes.h" #include "seqCom.h" /* Variable declarations */ # line 3 "../chirpUpdate.st" static short chirpState = 0; # line 7 "../chirpUpdate.st" static double chirpValue = 0; # line 10 "../chirpUpdate.st" static double chirpDesired = 0; /* Program init func */ static void G_prog_init(struct UserVar *pVar) { } /****** Code for state "INIT" in state set "chirpUpdate" ******/ /* Delay function for state "INIT" in state set "chirpUpdate" */ static void D_chirpUpdate_INIT(SS_ID ssId, struct UserVar *pVar) { } /* Event function for state "INIT" in state set "chirpUpdate" */ static seqBool E_chirpUpdate_INIT(SS_ID ssId, struct UserVar *pVar, int *pTransNum, int *pNextState) { if (TRUE) { *pNextState = 1; *pTransNum = 0; return TRUE; } return FALSE; } /* Action function for state "INIT" in state set "chirpUpdate" */ static void A_chirpUpdate_INIT(SS_ID ssId, struct UserVar *pVar, int transNum, int *pNextState) { switch(transNum) { case 0: { # line 16 "../chirpUpdate.st" seq_pvGet(ssId, 1/*chirpValue*/, 2); } return; } } /****** Code for state "CHIRP_UPDATE" in state set "chirpUpdate" ******/ /* Entry function for state "CHIRP_UPDATE" in state set "chirpUpdate" */ static void I_chirpUpdate_CHIRP_UPDATE(SS_ID ssId, struct UserVar *pVar) { # line 22 "../chirpUpdate.st" seq_pvGet(ssId, 1/*chirpValue*/, 2); # line 23 "../chirpUpdate.st" seq_pvGet(ssId, 0/*chirpState*/, 2); } /* Exit function for state "CHIRP_UPDATE" in state set "chirpUpdate" */ static void O_chirpUpdate_CHIRP_UPDATE(SS_ID ssId, struct UserVar *pVar) { # line 36 "../chirpUpdate.st" seq_pvGet(ssId, 0/*chirpState*/, 2); # line 37 "../chirpUpdate.st" seq_pvGet(ssId, 1/*chirpValue*/, 2); } /* Delay function for state "CHIRP_UPDATE" in state set "chirpUpdate" */ static void D_chirpUpdate_CHIRP_UPDATE(SS_ID ssId, struct UserVar *pVar) { # line 26 "../chirpUpdate.st" seq_delayInit(ssId, 0, (1.)); } /* Event function for state "CHIRP_UPDATE" in state set "chirpUpdate" */ static seqBool E_chirpUpdate_CHIRP_UPDATE(SS_ID ssId, struct UserVar *pVar, int *pTransNum, int *pNextState) { # line 26 "../chirpUpdate.st" if (seq_delay(ssId, 0)) { *pNextState = 1; *pTransNum = 0; return TRUE; } return FALSE; } /* Action function for state "CHIRP_UPDATE" in state set "chirpUpdate" */ static void A_chirpUpdate_CHIRP_UPDATE(SS_ID ssId, struct UserVar *pVar, int transNum, int *pNextState) { switch(transNum) { case 0: { # line 27 "../chirpUpdate.st" if (chirpState < 1) { # line 28 "../chirpUpdate.st" seq_pvGet(ssId, 1/*chirpValue*/, 2); # line 29 "../chirpUpdate.st" chirpDesired = chirpValue; # line 30 "../chirpUpdate.st" seq_pvPut(ssId, 2/*chirpDesired*/, 2); } } return; } } /************************ Tables ************************/ /* Channel table */ static seqChan G_channels[] = { /* chName, offset, varName, varType, count, eventNum, efId, monitored, queueSize, queueIndex */ {"FBCK:{IOC}:{LOOP}:CHIRPSTATE", (size_t)&chirpState, "chirpState", "short", 1, 1, 0, 1, 0, 0}, {"FBCK:LI22:1:CHIRP", (size_t)&chirpValue, "chirpValue", "double", 1, 2, 0, 0, 0, 0}, {"FBCK:{IOC}:{LOOP}:CHIRPDES", (size_t)&chirpDesired, "chirpDesired", "double", 1, 3, 0, 0, 0, 0} }; /* Event masks for state set "chirpUpdate" */ static const seqMask EM_chirpUpdate_INIT[] = { 0x00000000, }; static const seqMask EM_chirpUpdate_CHIRP_UPDATE[] = { 0x00000000, }; /* State table for state set "chirpUpdate" */ static seqState G_chirpUpdate_states[] = { { /* state name */ "INIT", /* action function */ A_chirpUpdate_INIT, /* event function */ E_chirpUpdate_INIT, /* delay function */ D_chirpUpdate_INIT, /* entry function */ 0, /* exit function */ 0, /* event mask array */ EM_chirpUpdate_INIT, /* state options */ (0) }, { /* state name */ "CHIRP_UPDATE", /* action function */ A_chirpUpdate_CHIRP_UPDATE, /* event function */ E_chirpUpdate_CHIRP_UPDATE, /* delay function */ D_chirpUpdate_CHIRP_UPDATE, /* entry function */ I_chirpUpdate_CHIRP_UPDATE, /* exit function */ O_chirpUpdate_CHIRP_UPDATE, /* event mask array */ EM_chirpUpdate_CHIRP_UPDATE, /* state options */ (0) }, }; /* State set table */ static seqSS G_state_sets[] = { { /* state set name */ "chirpUpdate", /* states */ G_chirpUpdate_states, /* number of states */ 2, /* number of delays */ 1 }, }; /* Program table (global) */ seqProgram chirpUpdate = { /* magic number */ 2001003, /* program name */ "chirpUpdate", /* channels */ G_channels, /* num. channels */ 3, /* state sets */ G_state_sets, /* num. state sets */ 1, /* user var size */ 0, /* param */ "", /* num. event flags */ 0, /* encoded options */ (0 | OPT_CONN | OPT_NEWEF), /* init func */ G_prog_init, /* entry func */ NULL, /* exit func */ NULL, /* num. queues */ 0 }; /* Register sequencer commands and program */ #include "epicsExport.h" static void chirpUpdateRegistrar (void) { seqRegisterSequencerCommands(); seqRegisterSequencerProgram (&chirpUpdate); } epicsExportRegistrar(chirpUpdateRegistrar);