/* Generated with snc from ../sncTrgControl.stt */ /* Program "pacTrgControl" */ #include #include #include #include #include "epicsTypes.h" #include "seqCom.h" /* Variable declarations */ struct UserVar { # line 17 "../sncTrgControl.stt" long klyMode; # line 21 "../sncTrgControl.stt" long pacTrig; }; /* C code definitions */ # line 11 "../sncTrgControl.stt" #define ENABLE 1 #define DISABLE 0 #define NO_ACCEL_BIT (0x8000) /* Program init func */ static void G_prog_init(struct UserVar *pVar) { static struct UserVar pVarInit = { 0, 0, }; *pVar = pVarInit; } /****** Code for state "init" in state set "trigControl" ******/ /* Delay function for state "init" in state set "trigControl" */ static void D_trigControl_init(SS_ID ssId, struct UserVar *pVar) { } /* Event function for state "init" in state set "trigControl" */ static seqBool E_trigControl_init(SS_ID ssId, struct UserVar *pVar, int *pTransNum, int *pNextState) { # line 28 "../sncTrgControl.stt" if (pVar->klyMode & NO_ACCEL_BIT) { *pNextState = 2; *pTransNum = 0; return TRUE; } # line 29 "../sncTrgControl.stt" if (!(pVar->klyMode & NO_ACCEL_BIT)) { *pNextState = 1; *pTransNum = 1; return TRUE; } return FALSE; } /* Action function for state "init" in state set "trigControl" */ static void A_trigControl_init(SS_ID ssId, struct UserVar *pVar, int transNum, int *pNextState) { switch(transNum) { case 0: { } return; case 1: { } return; } } /****** Code for state "enable" in state set "trigControl" ******/ /* Entry function for state "enable" in state set "trigControl" */ static void I_trigControl_enable(SS_ID ssId, struct UserVar *pVar) { # line 35 "../sncTrgControl.stt" pVar->pacTrig = ENABLE; # line 35 "../sncTrgControl.stt" seq_pvPut(ssId, 1/*pacTrig*/, 0); } /* Delay function for state "enable" in state set "trigControl" */ static void D_trigControl_enable(SS_ID ssId, struct UserVar *pVar) { } /* Event function for state "enable" in state set "trigControl" */ static seqBool E_trigControl_enable(SS_ID ssId, struct UserVar *pVar, int *pTransNum, int *pNextState) { # line 37 "../sncTrgControl.stt" if (pVar->klyMode & NO_ACCEL_BIT) { *pNextState = 2; *pTransNum = 0; return TRUE; } return FALSE; } /* Action function for state "enable" in state set "trigControl" */ static void A_trigControl_enable(SS_ID ssId, struct UserVar *pVar, int transNum, int *pNextState) { switch(transNum) { case 0: { } return; } } /****** Code for state "disable" in state set "trigControl" ******/ /* Entry function for state "disable" in state set "trigControl" */ static void I_trigControl_disable(SS_ID ssId, struct UserVar *pVar) { # line 43 "../sncTrgControl.stt" pVar->pacTrig = DISABLE; # line 43 "../sncTrgControl.stt" seq_pvPut(ssId, 1/*pacTrig*/, 0); } /* Delay function for state "disable" in state set "trigControl" */ static void D_trigControl_disable(SS_ID ssId, struct UserVar *pVar) { } /* Event function for state "disable" in state set "trigControl" */ static seqBool E_trigControl_disable(SS_ID ssId, struct UserVar *pVar, int *pTransNum, int *pNextState) { # line 45 "../sncTrgControl.stt" if (!(pVar->klyMode & NO_ACCEL_BIT)) { *pNextState = 1; *pTransNum = 0; return TRUE; } return FALSE; } /* Action function for state "disable" in state set "trigControl" */ static void A_trigControl_disable(SS_ID ssId, struct UserVar *pVar, int transNum, int *pNextState) { switch(transNum) { case 0: { } return; } } /************************ Tables ************************/ /* Channel table */ static seqChan G_channels[] = { /* chName, offset, varName, varType, count, eventNum, efId, monitored, queueSize, queueIndex */ #if LONG_MAX > 0x7fffffffL # line 17 "../sncTrgControl.stt" #error variable 'long klyMode' cannot be assigned to a PV (on the chosen target system)\ because Channel Access does not support integral types longer than 4 bytes.\ You can use 'int' instead, or the fixed size type 'int32_t'. #endif {"{KLY_MODE}", offsetof(struct UserVar, klyMode), "klyMode", "long", 1, 1, 0, 1, 0, 0}, #if LONG_MAX > 0x7fffffffL # line 21 "../sncTrgControl.stt" #error variable 'long pacTrig' cannot be assigned to a PV (on the chosen target system)\ because Channel Access does not support integral types longer than 4 bytes.\ You can use 'int' instead, or the fixed size type 'int32_t'. #endif {"{PAC_TRIG}", offsetof(struct UserVar, pacTrig), "pacTrig", "long", 1, 2, 0, 0, 0, 0} }; /* Event masks for state set "trigControl" */ static const seqMask EM_trigControl_init[] = { 0x00000002, }; static const seqMask EM_trigControl_enable[] = { 0x00000002, }; static const seqMask EM_trigControl_disable[] = { 0x00000002, }; /* State table for state set "trigControl" */ static seqState G_trigControl_states[] = { { /* state name */ "init", /* action function */ A_trigControl_init, /* event function */ E_trigControl_init, /* delay function */ D_trigControl_init, /* entry function */ 0, /* exit function */ 0, /* event mask array */ EM_trigControl_init, /* state options */ (0) }, { /* state name */ "enable", /* action function */ A_trigControl_enable, /* event function */ E_trigControl_enable, /* delay function */ D_trigControl_enable, /* entry function */ I_trigControl_enable, /* exit function */ 0, /* event mask array */ EM_trigControl_enable, /* state options */ (0) }, { /* state name */ "disable", /* action function */ A_trigControl_disable, /* event function */ E_trigControl_disable, /* delay function */ D_trigControl_disable, /* entry function */ I_trigControl_disable, /* exit function */ 0, /* event mask array */ EM_trigControl_disable, /* state options */ (0) }, }; /* State set table */ static seqSS G_state_sets[] = { { /* state set name */ "trigControl", /* states */ G_trigControl_states, /* number of states */ 3, /* number of delays */ 0 }, }; /* Program table (global) */ seqProgram pacTrgControl = { /* magic number */ 2001006, /* program name */ "pacTrgControl", /* channels */ G_channels, /* num. channels */ 2, /* state sets */ G_state_sets, /* num. state sets */ 1, /* user var size */ sizeof(struct UserVar), /* param */ "", /* num. event flags */ 0, /* encoded options */ (0 | OPT_CONN | OPT_NEWEF | OPT_REENT), /* init func */ G_prog_init, /* entry func */ NULL, /* exit func */ NULL, /* num. queues */ 0 }; /* Register sequencer commands and program */ #include "epicsExport.h" static void pacTrgControlRegistrar (void) { seqRegisterSequencerCommands(); seqRegisterSequencerProgram (&pacTrgControl); } epicsExportRegistrar(pacTrgControlRegistrar);