From 3813c99704c9a841b045f6268ede1b55c1859b77 Mon Sep 17 00:00:00 2001 From: Bernardo Carvalho Date: Thu, 9 Dec 2021 15:07:43 +0000 Subject: [PATCH 1/4] Checking relay output --- .../ISTTOKrpiApp/Db/ISTTOKmachineControl.db | 12 +- .../ISTTOKrpiApp/Db/ISTTOKpcf8574.db | 7 +- .../ISTTOKrpi/ISTTOKrpiApp/Db/ISTTOKstates.db | 4 + .../ISTTOKrpiApp/src/IsttokSeqExec.stt | 336 +++++++++++------- .../iocISTTOKrpi/save/iocISTTOKrpi.sav | 2 +- epics/iocs/RELEASE.local | 4 +- 6 files changed, 225 insertions(+), 140 deletions(-) diff --git a/epics/iocs/ISTTOKrpi/ISTTOKrpiApp/Db/ISTTOKmachineControl.db b/epics/iocs/ISTTOKrpi/ISTTOKrpiApp/Db/ISTTOKmachineControl.db index ae65576..6c45fbf 100644 --- a/epics/iocs/ISTTOKrpi/ISTTOKrpiApp/Db/ISTTOKmachineControl.db +++ b/epics/iocs/ISTTOKrpi/ISTTOKrpiApp/Db/ISTTOKmachineControl.db @@ -228,9 +228,9 @@ record(calc, "$(P)$(R)Emergency" ) { ############### ############### -############################# -# ROTARY1 PUMP # -############################# +################################### +# ROTARY1 PUMP Relay 5 NC # +################################### record( bo, "$(P)$(R)RPump1-Motor" ) { field(DESC,"Power to Rotatory Pump 1. Relay 5") field(OUT, "$(P)$(R)PCF8574:60:REGISTER.B0 PP" ) @@ -240,9 +240,9 @@ record( bo, "$(P)$(R)RPump1-Motor" ) { field(ZSV,"MINOR") } -############################# -# ROTARY1 VALVE # -############################# +#################################### +# ROTARY1 VALVE Relay 4 NC # +#################################### record( bo, "$(P)$(R)RPump1-Valve" ) { field(DESC,"Abre a valvula da bomba rot. Relay 4") field(OUT, "$(P)$(R)PCF8574:60:REGISTER.B1 PP" ) diff --git a/epics/iocs/ISTTOKrpi/ISTTOKrpiApp/Db/ISTTOKpcf8574.db b/epics/iocs/ISTTOKrpi/ISTTOKrpiApp/Db/ISTTOKpcf8574.db index aa02137..ddcd288 100644 --- a/epics/iocs/ISTTOKrpi/ISTTOKrpiApp/Db/ISTTOKpcf8574.db +++ b/epics/iocs/ISTTOKrpi/ISTTOKrpiApp/Db/ISTTOKpcf8574.db @@ -54,9 +54,10 @@ record( mbbiDirect, "$(P)$(R)PCF8574:57:REGISTER:READ" ) { field(FLNK, "$(P)$(R)PCF8574:57:REGISTER:READ:FNOUT") } -##################################################### -# ### Read/Write pcf8574 address 0x3c=60 register ### # -################################################### +################################################################ +# ### Read/Write pcf8574 address 0x3c=60 register # +# I2C power up with output at 1 (Relay coils are de-energized)# +################################################################ record( mbboDirect, "$(P)$(R)PCF8574:60:REGISTER") { field( DTYP, "stream") field( OUT, "@pcf8574.proto wReg(60) $(BUS)") diff --git a/epics/iocs/ISTTOKrpi/ISTTOKrpiApp/Db/ISTTOKstates.db b/epics/iocs/ISTTOKrpi/ISTTOKrpiApp/Db/ISTTOKstates.db index b4a2706..02a55c6 100644 --- a/epics/iocs/ISTTOKrpi/ISTTOKrpiApp/Db/ISTTOKstates.db +++ b/epics/iocs/ISTTOKrpi/ISTTOKrpiApp/Db/ISTTOKstates.db @@ -21,6 +21,7 @@ record(mbbi, "$(P)$(R)OPSTATE") { field(FRVL, "4") field(FVVL, "5") field(SXVL, "6") + field(SVVL, "7") field(ZRST, "Stopped") field(ONST, "Starting") field(TWST, "Idle") @@ -28,6 +29,7 @@ record(mbbi, "$(P)$(R)OPSTATE") { field(FRST, "WaitShot") field(FVST, "Stopping") field(SXST, "Emergency") + field(SVST, "UPSEmergency") field(VAL, "0") } record(mbbo, "$(P)$(R)LASTOPSTATE") { @@ -40,6 +42,7 @@ record(mbbo, "$(P)$(R)LASTOPSTATE") { field(FRVL, "4") field(FVVL, "5") field(SXVL, "6") + field(SVVL, "7") field(ZRST, "Stopped") field(ONST, "Starting") field(TWST, "Idle") @@ -47,6 +50,7 @@ record(mbbo, "$(P)$(R)LASTOPSTATE") { field(FRST, "WaitShot") field(FVST, "Stopping") field(SXST, "Emergency") + field(SVST, "UPSEmergency") # field(VAL, "0") } diff --git a/epics/iocs/ISTTOKrpi/ISTTOKrpiApp/src/IsttokSeqExec.stt b/epics/iocs/ISTTOKrpi/ISTTOKrpiApp/src/IsttokSeqExec.stt index 55372d9..a101e9c 100644 --- a/epics/iocs/ISTTOKrpi/ISTTOKrpiApp/src/IsttokSeqExec.stt +++ b/epics/iocs/ISTTOKrpi/ISTTOKrpiApp/src/IsttokSeqExec.stt @@ -44,17 +44,17 @@ short CLNST_Cleaning5 = 5; short WSHTST_NonShoting = 0; short WSHTST_WaitTrg = 1; -short WSHTST_Shoting2 = 2; -short WSHTST_Shoting3 = 3; -short WSHTST_Shoting4 = 4; -short WSHTST_Shoting5 = 5; -short WSHTST_Shoting6 = 6; -short WSHTST_Shoting7 = 7; -short WSHTST_Shoting8 = 8; -short WSHTST_Shoting9 = 9; -short WSHTST_Shoting10 = 10; -short WSHTST_Shoting11 = 11; -short WSHTST_Shoting12 = 12; +short WSHTST_Shooting2 = 2; +short WSHTST_Shooting3 = 3; +short WSHTST_Shooting4 = 4; +short WSHTST_Shooting5 = 5; +short WSHTST_Shooting6 = 6; +short WSHTST_Shooting7 = 7; +short WSHTST_Shooting8 = 8; +short WSHTST_Shooting9 = 9; +short WSHTST_Shooting10 = 10; +short WSHTST_Shooting11 = 11; +short WSHTST_Shooting12 = 12; short WSHTST_ShotEnd = 13; short STPST_NonStopping = 0; @@ -71,6 +71,7 @@ short POS_Clean =3; short POS_WaitShot=4; short POS_Stopping=5; short POS_Emergency=6; +short POS_UPSEmergency=7; short ON=1; short OFF=0; @@ -263,7 +264,7 @@ assign sendMail to "ISTTOK:central:sendmail"; /* Main Pulse State Set */ ss PulseSequence { state init { - entry { + entry { strcpy(msg, "INIT: Sequence Entry"); pvPut(msg); errlogSevPrintf(NO_ALARM, "%s\n",msg); @@ -338,7 +339,7 @@ ss PulseSequence { pvPut(msg); errlogSevPrintf(NO_ALARM, "%s\n",msg); } - } + } when (delay(5) && IsttokOPREQ == STOP) { strcpy(msg, "State to Stopping"); pvPut(msg); @@ -351,7 +352,7 @@ ss PulseSequence { strcpy(msg, "State to Starting"); pvPut(msg); errlogSevPrintf(NO_ALARM, "%s\n",msg); - /* State change to Starting */ + /* State change to Starting */ // IsttokOPSTATE = POS_Starting; // pvPut(IsttokOPSTATE); } state Starting @@ -359,10 +360,10 @@ ss PulseSequence { /*********** State Stopped ****************** */ state Stopped { - entry{ + entry{ IsttokLastOPSTATE = POS_Stopped; pvPut(IsttokLastOPSTATE); - } + } when(IsttokEmergency == ON){ strcpy(msg, "Emergency from Stopped"); pvPut(msg); @@ -382,10 +383,10 @@ ss PulseSequence { /******** State Starting ***********************/ state Starting { - entry{ + entry{ IsttokOPSTATE = POS_Starting; pvPut(IsttokOPSTATE); - } + } when(IsttokEmergency == ON) { strcpy(msg, "Emergency from Starting"); pvPut(msg); @@ -409,7 +410,7 @@ ss PulseSequence { /********** State Idle ****************************/ state Idle { - entry{ + entry{ IsttokOPSTATE = POS_Idle; pvPut(IsttokOPSTATE); IsttokLastOPSTATE = POS_Idle; @@ -418,17 +419,17 @@ ss PulseSequence { pvPut(IsttokShotShot_TorPSDisable); IsttokProcReq = STOP; pvPut(IsttokProcReq); - } - when (IsttokupsBatteryON == ON) { + } + when (IsttokupsBatteryON == ON) { strcpy(msg, "Power Emergency, go to Stopping"); pvPut(msg); errlogSevPrintf(MAJOR, "%s\n",msg); IsttokOPREQ = STOP; pvPut(IsttokOPREQ); - /* State change to Stopping */ - IsttokOPSTATE = POS_Stopping; + /* State change to Stopping */ + IsttokOPSTATE = POS_UPSEmergency; pvPut(IsttokOPSTATE); - } state Stopping + } state Stopping when(IsttokEmergency == ON){ strcpy(msg, "Emergency from Idle"); @@ -439,12 +440,12 @@ ss PulseSequence { when ( pvStatus(IsttokRPump1_Pressure) != pvStatOK || pvStatus(IsttokTMPump1_Emergency) != pvStatOK ) { //when ( pvStatus(IsttokRPump1_Pressure) != pvStatOK || pvStatus(IsttokRPump2_Pressure) != pvStatOK || - // pvStatus(IsttokTMPump1_Emergency) != pvStatOK || pvStatus(IsttokTMPump2_Emergency) != pvStatOK) { + // pvStatus(IsttokTMPump1_Emergency) != pvStatOK || pvStatus(IsttokTMPump2_Emergency) != pvStatOK) { /* Vacuum emergency: Pulse state change to Stopping */ IsttokOPREQ = STOP; pvPut(IsttokOPREQ); //strcpy(sendMail, "Vacuum Emergency while Idle"); - sprintf(sendMail, "Rpump1:%1.1e TMP1:%d",IsttokRPump1_Pressure,IsttokTMPump1_Emergency); + sprintf(sendMail, "Rpump1:%1.1e TMP1:%d",IsttokRPump1_Pressure,IsttokTMPump1_Emergency); pvPut(sendMail); } state Stopping @@ -474,10 +475,10 @@ ss PulseSequence { /******* State Clean ***************************/ state Clean { - entry{ + entry{ IsttokOPSTATE = POS_Clean; pvPut(IsttokOPSTATE); - } + } when ((IsttokProcReq==STOP) && (CLEANINGSTATE == CLNST_NonCleaning)) { strcpy(msg, "State to Idle From Clean"); pvPut(msg); @@ -488,7 +489,7 @@ ss PulseSequence { when ( pvStatus(IsttokTMPump1_Emergency) != pvStatOK) { //when ( pvStatus(IsttokTMPump1_Emergency) != pvStatOK || - // pvStatus(IsttokTMPump2_Emergency) != pvStatOK) { + // pvStatus(IsttokTMPump2_Emergency) != pvStatOK) { /* Vacuum emergency: Pulse state change to Stopping */ IsttokOPREQ = STOP; pvPut(IsttokOPREQ); @@ -507,7 +508,7 @@ ss PulseSequence { /******** State WaitShot *************************/ state WaitShot { - entry{ + entry{ strcpy(msg, "Toroidal Shot Enable"); pvPut(msg); errlogSevPrintf(NO_ALARM, "%s\n",msg); @@ -515,17 +516,18 @@ ss PulseSequence { pvPut(IsttokShotShot_TorPSDisable); IsttokOPSTATE = POS_WaitShot; pvPut(IsttokOPSTATE); - } - when (IsttokupsBatteryON == ON) { - strcpy(msg, "Power Emergency, go to Stopping"); + } + when (IsttokupsBatteryON == ON) { + strcpy(msg, "Power Emergency, go to UPSEmergency"); pvPut(msg); errlogSevPrintf(MAJOR, "%s\n",msg); IsttokOPREQ = STOP; pvPut(IsttokOPREQ); - /* State change to Stopping */ - IsttokOPSTATE = POS_Stopping; + /* State change to UPSEmergency */ + IsttokOPSTATE = POS_UPSEmergency; pvPut(IsttokOPSTATE); - } state Stopping + } state UpsEmergency + when(IsttokEmergency == ON){ strcpy(msg, "Emergency from WaitShot"); pvPut(msg); @@ -540,11 +542,11 @@ ss PulseSequence { when (IsttokOPREQ == STOP) { /* Pulse state change to Stopping */ - } state Stopping + } state Stopping when ( pvStatus(IsttokTMPump1_Emergency) != pvStatOK) { //when ( pvStatus(IsttokTMPump1_Emergency) != pvStatOK || - // pvStatus(IsttokTMPump2_Emergency) != pvStatOK) { + // pvStatus(IsttokTMPump2_Emergency) != pvStatOK) { /* Vacuum emergency: Pulse state change to Stopping */ IsttokOPREQ = STOP; pvPut(IsttokOPREQ); @@ -556,8 +558,23 @@ ss PulseSequence { /* ************** State Stopping *********** */ state Stopping { - entry{ + entry{ /*Just to be sure */ + IsttokShotShot_TorPSDisable = PCF_RELAY_OFF; + pvPut(IsttokShotShot_TorPSDisable); + + IsttokShotCapBank_Charge = PCF_RELAY_OFF; + pvPut(IsttokShotCapBank_Charge); + + IsttokShotCapBank_Discharge = PCF_RELAY_OFF; + pvPut(IsttokShotCapBank_Discharge); + + IsttokShotGasIS_Valves = PCF_RELAY_OFF; + pvPut(IsttokShotGasIS_Valves); + + IsttokShotVVessel_Filament = PCF_RELAY_OFF; + pvPut(IsttokShotVVessel_Filament); + IsttokProcReq = STOP; pvPut(IsttokProcReq); @@ -565,16 +582,16 @@ ss PulseSequence { pvPut(IsttokOPSTATE); IsttokLastOPSTATE = POS_Stopping; pvPut(IsttokLastOPSTATE); - } + } - when ((IsttokOPREQ == START) && (IsttokupsBatteryON != ON) ) { + when ((IsttokOPREQ == START) && (IsttokupsBatteryON != ON) ) { strcpy(msg, "State to Starting"); pvPut(msg); errlogSevPrintf(NO_ALARM, "%s\n",msg); - /* State change to Starting */ + /* State change to Starting */ IsttokOPSTATE = POS_Starting; pvPut(IsttokOPSTATE); - } state Starting + } state Starting when (STOPPINGSTATE == STPST_StoppingEnd) { IsttokOPSTATE = POS_Stopped; @@ -584,7 +601,7 @@ ss PulseSequence { /*State Emergency*/ state Emergency { - entry { + entry { strcpy(msg, "Emergency Toroidal Shot Disable"); pvPut(msg); errlogSevPrintf(MAJOR, "%s\n",msg); @@ -614,7 +631,7 @@ ss PulseSequence { errlogSevPrintf(MAJOR, "%s\n",msg); IsttokShotVVessel_Filament = PCF_RELAY_OFF; pvPut(IsttokShotVVessel_Filament); - } + } when (delay(1.0) && (IsttokEmergency == OFF) && (IsttokOPSTATE == POS_WaitShot || IsttokOPSTATE==POS_Clean) ){ /* Pulse state change to Idle */ strcpy(msg, "State to Idle"); @@ -655,15 +672,78 @@ ss PulseSequence { pvPut(IsttokOPSTATE); } state Stopped } + + /*State UpsEmergency*/ + state UpsEmergency { + entry { + strcpy(msg, "Emergency Toroidal Shot Disable"); + errlogSevPrintf(MAJOR, "%s\n",msg); + IsttokShotShot_TorPSDisable = PCF_RELAY_OFF; + pvPut(IsttokShotShot_TorPSDisable); + + strcpy(msg, "EMERGENCY: CAPBANK Charge OFF"); + errlogSevPrintf(NO_ALARM, "%s\n",msg); + IsttokShotCapBank_Charge = PCF_RELAY_OFF; + pvPut(IsttokShotCapBank_Charge); + + strcpy(msg, "EMERGENCY: CAPBANK CrowBar Close"); + errlogSevPrintf(NO_ALARM, "%s\n",msg); + IsttokShotCapBank_Discharge = PCF_RELAY_OFF; + pvPut(IsttokShotCapBank_Discharge); + + strcpy(msg, "EMERGENCY: GIS Valves CLOSE"); + errlogSevPrintf(NO_ALARM, "%s\n",msg); + IsttokShotGasIS_Valves = PCF_RELAY_OFF; + pvPut(IsttokShotGasIS_Valves); + + strcpy(msg, "UPS EMERGENCY: Filament OFF"); + pvPut(msg); + errlogSevPrintf(MAJOR, "%s\n",msg); + IsttokShotVVessel_Filament = PCF_RELAY_OFF; + pvPut(IsttokShotVVessel_Filament); + } + when (IsttokupsBatteryON == ON) { + /* Pulse state change to Stopping */ + strcpy(msg, "State to Stopping"); + pvPut(msg); + errlogSevPrintf(NO_ALARM, "%s\n",msg); + IsttokProcReq = STOP; + pvPut(IsttokProcReq); + IsttokOPSTATE = POS_Stopping; + pvPut(IsttokOPSTATE); + } state Stopping + when (delay(6.0) && (IsttokupsBatteryON == OFF) && (IsttokOPSTATE == POS_Idle)){ + /* Pulse state change to Idle */ + strcpy(msg, "State to Idle"); + pvPut(msg); + errlogSevPrintf(NO_ALARM, "%s\n",msg); + IsttokOPSTATE = POS_Idle; + pvPut(IsttokOPSTATE); + } state Idle + /* + when (delay(6.0) && (IsttokupsBatteryON == OFF) && + ((IsttokOPSTATE == POS_Starting)) || (IsttokOPSTATE == POS_Stopping)){ + // TODO Check these 2 transictions + strcpy(msg, "State to Stopping"); + pvPut(msg); + errlogSevPrintf(NO_ALARM, "%s\n",msg); + IsttokOPREQ = STOP; + pvPut(IsttokOPREQ); + // Pulse state change to Stopping + IsttokOPSTATE = POS_Stopping; + pvPut(IsttokOPSTATE); + } state Stopping + */ + } } -/* Starting State Set */ +/*********** Starting SUB-State Set ************/ ss StartingSequence { state NonStarting { - entry { + entry { STARTINGSTATE = STRST_NonStarting; pvPut(STARTINGSTATE); - } + } when (IsttokOPSTATE == POS_Starting) { strcpy(msg, "Rotary Pump1 ON"); pvPut(msg); @@ -737,7 +817,7 @@ ss StartingSequence { errlogSevPrintf(NO_ALARM, "%s\n",msg); // IsttokTMPump2_Motor = PCF_RELAY_ON; // pvPut(IsttokTMPump2_Motor); - STARTINGSTATE = STRST_Starting4; + STARTINGSTATE = STRST_Starting4; pvPut(STARTINGSTATE); } state Starting4 } @@ -767,7 +847,7 @@ ss StartingSequence { ss CleaningSequence{ state NonCleaning{ - entry{ + entry{ strcpy(msg, "GIS Valves CLOSE"); pvPut(msg); IsttokShotGasIS_Valves = PCF_RELAY_OFF; @@ -798,7 +878,7 @@ ss CleaningSequence{ errlogSevPrintf(NO_ALARM, "%s\n",msg); - } + } when(delay(1.0) && CLEANINGMANMODE == 1 && IsttokOPSTATE == POS_Clean){ strcpy(msg, "Initiating Auto Cleaning..."); pvPut(msg); @@ -807,8 +887,8 @@ ss CleaningSequence{ errlogSevPrintf(NO_ALARM, "%s\n",msg); IsttokShotGasIS_Valves = PCF_RELAY_ON; pvPut(IsttokShotGasIS_Valves); - CLEANINGSTATE = CLNST_Cleaning1; - pvPut(CLEANINGSTATE); + CLEANINGSTATE = CLNST_Cleaning1; + pvPut(CLEANINGSTATE); } state Cleaning1 } state Cleaning1 { @@ -827,8 +907,8 @@ ss CleaningSequence{ errlogSevPrintf(NO_ALARM, "%s\n",msg); IsttokShotVVessel_Filament = PCF_RELAY_ON; pvPut(IsttokShotVVessel_Filament); - CLEANINGSTATE = CLNST_Cleaning2; - pvPut(CLEANINGSTATE); + CLEANINGSTATE = CLNST_Cleaning2; + pvPut(CLEANINGSTATE); } state Cleaning2 } state Cleaning2{ @@ -839,8 +919,8 @@ ss CleaningSequence{ errlogSevPrintf(NO_ALARM, "%s\n",msg); IsttokShotVVessel_Filament = PCF_RELAY_OFF; pvPut(IsttokShotVVessel_Filament); - CLEANINGSTATE = CLNST_Cleaning1; - pvPut(CLEANINGSTATE); + CLEANINGSTATE = CLNST_Cleaning1; + pvPut(CLEANINGSTATE); } state Cleaning1 when (delay(2.0) && CLEANINGMANMODE == 1 && IsttokOPSTATE == POS_Clean) { strcpy(msg, "Primary-CT ON"); @@ -848,8 +928,8 @@ ss CleaningSequence{ errlogSevPrintf(NO_ALARM, "%s\n",msg); IsttokShotClean_PrimContactor = PCF_RELAY_ON; pvPut(IsttokShotClean_PrimContactor); - CLEANINGSTATE = CLNST_Cleaning3; - pvPut(CLEANINGSTATE); + CLEANINGSTATE = CLNST_Cleaning3; + pvPut(CLEANINGSTATE); } state Cleaning3 } state Cleaning3{ @@ -859,8 +939,8 @@ ss CleaningSequence{ errlogSevPrintf(NO_ALARM, "%s\n",msg); IsttokShotClean_PrimContactor = PCF_RELAY_OFF; pvPut(IsttokShotClean_PrimContactor); - CLEANINGSTATE = CLNST_Cleaning2; - pvPut(CLEANINGSTATE); + CLEANINGSTATE = CLNST_Cleaning2; + pvPut(CLEANINGSTATE); } state Cleaning2 when(delay(2.0) && CLEANINGMANMODE == 1 && IsttokOPSTATE == POS_Clean){ strcpy(msg, "Toroidal-BK CLOSE"); @@ -868,8 +948,8 @@ ss CleaningSequence{ errlogSevPrintf(NO_ALARM, "%s\n",msg); IsttokShotClean_TorPneuBreaker = PCF_RELAY_ON; pvPut(IsttokShotClean_TorPneuBreaker); - CLEANINGSTATE = CLNST_Cleaning4; - pvPut(CLEANINGSTATE); + CLEANINGSTATE = CLNST_Cleaning4; + pvPut(CLEANINGSTATE); } state Cleaning4 } @@ -880,8 +960,8 @@ ss CleaningSequence{ errlogSevPrintf(NO_ALARM, "%s\n",msg); IsttokShotClean_TorPneuBreaker = PCF_RELAY_OFF; pvPut(IsttokShotClean_TorPneuBreaker); - CLEANINGSTATE = CLNST_Cleaning3; - pvPut(CLEANINGSTATE); + CLEANINGSTATE = CLNST_Cleaning3; + pvPut(CLEANINGSTATE); } state Cleaning3 when (delay(2.0) && CLEANINGMANMODE == 1 && IsttokOPSTATE == POS_Clean){ strcpy(msg, "Toroidal-CT ON"); @@ -889,8 +969,8 @@ ss CleaningSequence{ errlogSevPrintf(NO_ALARM, "%s\n",msg); IsttokShotClean_TorContactor = PCF_RELAY_ON; pvPut(IsttokShotClean_TorContactor); - CLEANINGSTATE = CLNST_Cleaning5; - pvPut(CLEANINGSTATE); + CLEANINGSTATE = CLNST_Cleaning5; + pvPut(CLEANINGSTATE); } state Cleaning5 } @@ -906,8 +986,8 @@ ss CleaningSequence{ /* Close GIS to let Pressure down */ IsttokShotGasIS_Valves = PCF_RELAY_OFF; pvPut(IsttokShotGasIS_Valves); - CLEANINGSTATE = CLNST_Cleaning4; - pvPut(CLEANINGSTATE); + CLEANINGSTATE = CLNST_Cleaning4; + pvPut(CLEANINGSTATE); } state Cleaning4 /* when (pvSeverity(IsttokVVesselTemperature) >= pvSevrMAJOR) { @@ -924,12 +1004,12 @@ ss CleaningSequence{ ss ShotSequence { state NonShoting { - entry { + entry { WSHOTINGSTATE = WSHTST_NonShoting; pvPut(WSHOTINGSTATE); strcpy(IsttokShotCountdownScan, "Passive"); pvPut(IsttokShotCountdownScan); - } + } when( IsttokOPSTATE == POS_WaitShot ){ //strcpy(msg, "Waiting for Trigger..."); // pvPut(msg); @@ -960,15 +1040,15 @@ ss ShotSequence { pvPut(msg); IsttokShotCountdown = -70; pvPut(IsttokShotCountdown); - WSHOTINGSTATE = WSHTST_Shoting2; + WSHOTINGSTATE = WSHTST_Shooting2; pvPut(WSHOTINGSTATE); PulseNumber +=1; pvPut(PulseNumber); - } state Shoting2 + } state Shooting2 } - state Shoting2 { + state Shooting2 { when (IsttokOPSTATE != POS_WaitShot) { - strcpy(msg, "Shoting 2 Out"); + strcpy(msg, "Shooting 2 Out"); pvPut(msg); errlogSevPrintf(NO_ALARM, "%s\n",msg); } state ShotWaitTrg @@ -988,13 +1068,13 @@ ss ShotSequence { errlogSevPrintf(NO_ALARM, "%s\n",msg); IsttokShotLab_WarningLight = PCF_RELAY_ON; pvPut(IsttokShotLab_WarningLight); - WSHOTINGSTATE = WSHTST_Shoting3; + WSHOTINGSTATE = WSHTST_Shooting3; pvPut(WSHOTINGSTATE); - } state Shoting3 + } state Shooting3 } - state Shoting3 { + state Shooting3 { when (IsttokOPSTATE != POS_WaitShot) { - strcpy(msg, "Shoting3 Out"); + strcpy(msg, "Shooting3 Out"); pvPut(msg); errlogSevPrintf(NO_ALARM, "%s\n",msg); } state ShotWaitTrg @@ -1004,26 +1084,26 @@ ss ShotSequence { errlogSevPrintf(NO_ALARM, "%s\n",msg); IsttokShotGasIS_Valves = PCF_RELAY_ON; pvPut(IsttokShotGasIS_Valves); - WSHOTINGSTATE = WSHTST_Shoting4; + WSHOTINGSTATE = WSHTST_Shooting4; pvPut(WSHOTINGSTATE); - } state Shoting4 + } state Shooting4 } - state Shoting4 { + state Shooting4 { when (IsttokOPSTATE != POS_WaitShot ) { - strcpy(msg, "Shoting4 Out"); + strcpy(msg, "Shooting4 Out"); pvPut(msg); errlogSevPrintf(NO_ALARM, "%s\n",msg); WSHOTINGSTATE = WSHTST_NonShoting; pvPut(WSHOTINGSTATE); } state NonShoting when (IsttokShotCountdown == -59) { - WSHOTINGSTATE = WSHTST_Shoting5; + WSHOTINGSTATE = WSHTST_Shooting5; pvPut(WSHOTINGSTATE); - } state Shoting5 + } state Shooting5 } - state Shoting5 { + state Shooting5 { when (IsttokOPSTATE != POS_WaitShot) { - strcpy(msg, "Shoting5 Out"); + strcpy(msg, "Shooting5 Out"); pvPut(msg); errlogSevPrintf(NO_ALARM, "%s\n",msg); WSHOTINGSTATE = WSHTST_NonShoting; @@ -1035,13 +1115,13 @@ ss ShotSequence { errlogSevPrintf(NO_ALARM, "%s\n",msg); IsttokShotCapBank_Charge = PCF_RELAY_ON; pvPut(IsttokShotCapBank_Charge); - WSHOTINGSTATE = WSHTST_Shoting6; + WSHOTINGSTATE = WSHTST_Shooting6; pvPut(WSHOTINGSTATE); - } state Shoting6 + } state Shooting6 } - state Shoting6 { + state Shooting6 { when (IsttokOPSTATE != POS_WaitShot) { - strcpy(msg, "Shoting6 Out"); + strcpy(msg, "Shooting6 Out"); pvPut(msg); errlogSevPrintf(MINOR, "%s\n",msg); WSHOTINGSTATE = WSHTST_NonShoting; @@ -1053,13 +1133,13 @@ ss ShotSequence { errlogSevPrintf(NO_ALARM, "%s\n", msg); IsttokShotCapBank_Charge = PCF_RELAY_OFF; pvPut(IsttokShotCapBank_Charge); - WSHOTINGSTATE = WSHTST_Shoting7; + WSHOTINGSTATE = WSHTST_Shooting7; pvPut(WSHOTINGSTATE); - } state Shoting7 + } state Shooting7 } - state Shoting7 { + state Shooting7 { when (IsttokOPSTATE != POS_WaitShot) { - strcpy(msg, "Shoting7 Out"); + strcpy(msg, "Shooting7 Out"); pvPut(msg); errlogSevPrintf(MINOR, "%s\n",msg); WSHOTINGSTATE = WSHTST_NonShoting; @@ -1076,13 +1156,13 @@ ss ShotSequence { errlogSevPrintf(NO_ALARM, "%s\n",msg); IsttokShotVVessel_Filament = PCF_RELAY_ON; pvPut(IsttokShotVVessel_Filament); - WSHOTINGSTATE = WSHTST_Shoting8; + WSHOTINGSTATE = WSHTST_Shooting8; pvPut(WSHOTINGSTATE); - } state Shoting8 + } state Shooting8 } - state Shoting8 { + state Shooting8 { when (IsttokOPSTATE != POS_WaitShot) { - strcpy(msg, "Shoting8 Out"); + strcpy(msg, "Shooting8 Out"); pvPut(msg); errlogSevPrintf(MINOR, "%s\n",msg); WSHOTINGSTATE = WSHTST_NonShoting; @@ -1095,13 +1175,13 @@ ss ShotSequence { // PS Trigger Pulse IsttokShotShot_TorPSTrigger = ON; pvPut(IsttokShotShot_TorPSTrigger); - WSHOTINGSTATE = WSHTST_Shoting9; + WSHOTINGSTATE = WSHTST_Shooting9; pvPut(WSHOTINGSTATE); - } state Shoting9 + } state Shooting9 } - state Shoting9 { + state Shooting9 { when (IsttokOPSTATE != POS_WaitShot) { - strcpy(msg, "Shoting9 Out"); + strcpy(msg, "Shooting9 Out"); pvPut(msg); errlogSevPrintf(MINOR, "%s\n",msg); WSHOTINGSTATE = WSHTST_NonShoting; @@ -1111,13 +1191,13 @@ ss ShotSequence { strcpy(msg, "Ready for SHOT" ); pvPut(msg); errlogSevPrintf(NO_ALARM, "%s\n", msg); - WSHOTINGSTATE = WSHTST_Shoting10; + WSHOTINGSTATE = WSHTST_Shooting10; pvPut(WSHOTINGSTATE); - } state Shoting10 + } state Shooting10 } - state Shoting10 { + state Shooting10 { when (IsttokOPSTATE != POS_WaitShot) { - strcpy(msg, "Shoting10 Out"); + strcpy(msg, "Shooting10 Out"); pvPut(msg); errlogSevPrintf(MINOR, "%s\n",msg); WSHOTINGSTATE = WSHTST_NonShoting; @@ -1129,13 +1209,13 @@ ss ShotSequence { errlogSevPrintf(NO_ALARM, "%s\n", msg); IsttokShotCapBank_Discharge = PCF_RELAY_OFF; pvPut(IsttokShotCapBank_Discharge); - WSHOTINGSTATE = WSHTST_Shoting11; + WSHOTINGSTATE = WSHTST_Shooting11; pvPut(WSHOTINGSTATE); - } state Shoting11 + } state Shooting11 } - state Shoting11 { + state Shooting11 { when (IsttokOPSTATE != POS_WaitShot) { - strcpy(msg, "Shoting11 Out"); + strcpy(msg, "Shooting11 Out"); pvPut(msg); errlogSevPrintf(MINOR, "%s\n",msg); WSHOTINGSTATE = WSHTST_NonShoting; @@ -1152,13 +1232,13 @@ ss ShotSequence { errlogSevPrintf(NO_ALARM, "%s\n", msg); IsttokShotVVessel_Filament = 1; pvPut(IsttokShotVVessel_Filament); - WSHOTINGSTATE = WSHTST_Shoting12; + WSHOTINGSTATE = WSHTST_Shooting12; pvPut(WSHOTINGSTATE); - } state Shoting12 + } state Shooting12 } - state Shoting12 { + state Shooting12 { when (IsttokOPSTATE != POS_WaitShot) { - strcpy(msg, "Shoting6 Out"); + strcpy(msg, "Shooting6 Out"); pvPut(msg); errlogSevPrintf(MINOR, "%s\n",msg); WSHOTINGSTATE = WSHTST_NonShoting; @@ -1185,10 +1265,10 @@ ss ShotSequence { } } -/* Stopping State Set */ +/* Stopping Sub-State Set */ ss StoppingSequence { state NonStopping { - entry { + entry { STOPPINGSTATE = STPST_NonStopping; pvPut(STOPPINGSTATE); } @@ -1197,10 +1277,10 @@ ss StoppingSequence { pvPut(msg); errlogSevPrintf(NO_ALARM, "%s\n",msg); - IsttokTMPump1_MotorOff = ON; + IsttokTMPump1_MotorOff = ON; pvPut(IsttokTMPump1_MotorOff); - // IsttokTMPump2_Motor = PCF_RELAY_OFF; + // IsttokTMPump2_Motor = PCF_RELAY_OFF; // pvPut(IsttokTMPump2_Motor); STOPPINGSTATE = STPST_Stopping1; pvPut(STOPPINGSTATE); @@ -1214,7 +1294,7 @@ ss StoppingSequence { errlogSevPrintf(NO_ALARM, "%s\n",msg); STOPPINGSTATE = STPST_Stopping2; pvPut(STOPPINGSTATE); - } state Stopping2 + } state Stopping2 } state Stopping2 { when (IsttokOPSTATE != POS_Stopping ) { @@ -1237,7 +1317,7 @@ ss StoppingSequence { state Stopping3 { when (IsttokOPSTATE != POS_Stopping ) { } state NonStopping - when (delay(5)) { + when (delay(5)) { IsttokRPump1_Valve = PCF_RELAY_ON; pvPut(IsttokRPump1_Valve); strcpy(msg, "Rotary Valves 1 & 2 CLOSE"); @@ -1247,7 +1327,7 @@ ss StoppingSequence { pvPut(IsttokRPump2_Valve); STOPPINGSTATE = STPST_StoppingEnd; pvPut(STOPPINGSTATE); - } state StoppingEnd + } state StoppingEnd } state StoppingEnd { when (IsttokOPSTATE != POS_Stopping ) { } state NonStopping @@ -1260,12 +1340,12 @@ ss StoppingSequence { strcpy(msg, "Toroidal Field Recovered" ); pvPut(msg); errlogSevPrintf(NO_ALARM, "%s\n", msg); - WSHOTINGSTATE = WSHTST_Shoting12; + WSHOTINGSTATE = WSHTST_Shooting12; pvPut(WSHOTINGSTATE); - } state Shoting12 - state Shoting12 { + } state Shooting12 + state Shooting12 { when ((IsttokOPSTATE != POS_WaitShot ) && (IsttokShotCountdown == 160) ) { - strcpy(msg, "Shoting12 Out"); + strcpy(msg, "Shooting12 Out"); pvPut(msg); errlogSevPrintf(NO_ALARM, "%s\n", msg); WSHOTINGSTATE = WSHTST_NonShoting; @@ -1284,7 +1364,7 @@ ss StoppingSequence { - entry{ + entry{ IsttokRPump1_Motor = PCF_RELAY_ON; pvPut(IsttokRPump1_Motor); strcpy(msg, "Rotary Pumps 1/2 OFF"); @@ -1294,7 +1374,7 @@ ss StoppingSequence { pvPut(IsttokRPump2_Motor); //IsttokLastOPSTATE = POS_Idle; //pvPut(IsttokLastOPSTATE); - } + } // } state Stopping */ diff --git a/epics/iocs/ISTTOKrpi/iocBoot/iocISTTOKrpi/save/iocISTTOKrpi.sav b/epics/iocs/ISTTOKrpi/iocBoot/iocISTTOKrpi/save/iocISTTOKrpi.sav index 558c939..a3fa10d 100644 --- a/epics/iocs/ISTTOKrpi/iocBoot/iocISTTOKrpi/save/iocISTTOKrpi.sav +++ b/epics/iocs/ISTTOKrpi/iocBoot/iocISTTOKrpi/save/iocISTTOKrpi.sav @@ -1,4 +1,4 @@ -# autosave R5.3 Automatically generated - DO NOT MODIFY - 211129-172335 +# autosave R5.3 Automatically generated - DO NOT MODIFY - 211209-150038 ISTTOK:central:PULSE-NUMBER.VAL 0 ISTTOK:central:LogMessage.VAL ISTTOK:central:LASTOPSTATE.VAL 5 diff --git a/epics/iocs/RELEASE.local b/epics/iocs/RELEASE.local index ff879f5..3bb333b 100644 --- a/epics/iocs/RELEASE.local +++ b/epics/iocs/RELEASE.local @@ -19,7 +19,7 @@ SNCSEQ=$(SUPPORT)/seq-2-2 # # SEQ is required for testIPServer #SNCSEQ=$(SUPPORT)/seq-2-2-5 -SNCSEQ= +#SNCSEQ= ## For sCalcout support in asynOctet - applications include asynCalc.dbd #CALC=$(SUPPORT)/calc-3-7-3 @@ -30,5 +30,5 @@ PCRE= #SSCAN=$(SUPPORT)/sscan-2-11-3 # EPICS_BASE 3.14.6 or later is required -EPICS_BASE=/home/pi/EPICS/epics-base +EPICS_BASE=/home/pi/Apps/epics7/epics-base From 33dd29cd795c72a1f5f9083383eff26cfe2e4fa8 Mon Sep 17 00:00:00 2001 From: Bernardo Carvalho Date: Thu, 9 Dec 2021 16:41:27 +0000 Subject: [PATCH 2/4] Checking relay outputs --- epics/README.md | 12 ++++++------ .../ISTTOKrpiApp/Db/ISTTOKmachineControl.db | 8 ++++---- .../iocBoot/iocISTTOKrpi/save/iocISTTOKrpi.sav | 2 +- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/epics/README.md b/epics/README.md index f68f0e8..21d9262 100644 --- a/epics/README.md +++ b/epics/README.md @@ -194,13 +194,13 @@ Process Variables in this IOC Server: * Connected to PCF8574 Address = 60 (Top Valleman) -|PV Name | PV Type | Bit | +|PV Name | PV Type | Bit | Relay #/(NO/NC)| |:----------|-------|---:| -|ISTTOK:central:RPump1-Motor| bo | 0 | -|ISTTOK:central:RPump1-Valve| bo | 1 | -|ISTTOK:central:RPump2-Motor| bo | 2 | -|ISTTOK:central:RPump2-Valve| bo | 3 | -|ISTTOK:central:VVessel-Filament| bo | 4 | +|ISTTOK:central:RPump1-Motor| bo | 0 | 5 / NC | +|ISTTOK:central:RPump1-Valve| bo | 1 | 4 / NC | +|ISTTOK:central:RPump2-Motor (Not Used/Disabled)| bo | 2 | | +|ISTTOK:central:RPump2-Valve (Not Used/Disabled| bo | 3 | | +|ISTTOK:central:VVessel-Filament| bo | 4 | 1 / NO| |ISTTOK:central:Clean-TorContactor| bo | 7 | ---------- diff --git a/epics/iocs/ISTTOKrpi/ISTTOKrpiApp/Db/ISTTOKmachineControl.db b/epics/iocs/ISTTOKrpi/ISTTOKrpiApp/Db/ISTTOKmachineControl.db index 6c45fbf..8165284 100644 --- a/epics/iocs/ISTTOKrpi/ISTTOKrpiApp/Db/ISTTOKmachineControl.db +++ b/epics/iocs/ISTTOKrpi/ISTTOKrpiApp/Db/ISTTOKmachineControl.db @@ -252,11 +252,11 @@ record( bo, "$(P)$(R)RPump1-Valve" ) { } ############################# -# ROTARY2 PUMP # +# ROTARY2 PUMP NO LONGUER USED (RESERVED) # ############################# record( bo, "$(P)$(R)RPump2-Motor" ) { field(DESC,"Power On Rotatory Pump 2") - field(OUT, "$(P)$(R)PCF8574:60:REGISTER.B2 PP" ) +# field(OUT, "$(P)$(R)PCF8574:60:REGISTER.B2 PP" ) field(ZNAM, "Off" ) field(ONAM, "On" ) field(VAL,"1") @@ -264,11 +264,11 @@ record( bo, "$(P)$(R)RPump2-Motor" ) { } ############################# -# ROTARY2 VALVE # +# ROTARY2 VALVE NO LONGUER USED (RESERVED) # ############################# record( bo, "$(P)$(R)RPump2-Valve" ) { field(DESC," Abre a valvula da bomba rotatoria 2 ") - field(OUT,"$(P)$(R)PCF8574:60:REGISTER.B3 PP" ) +# field(OUT,"$(P)$(R)PCF8574:60:REGISTER.B3 PP" ) field(ZNAM,"Closed" ) field(ONAM,"Open" ) field(VAL,"1") diff --git a/epics/iocs/ISTTOKrpi/iocBoot/iocISTTOKrpi/save/iocISTTOKrpi.sav b/epics/iocs/ISTTOKrpi/iocBoot/iocISTTOKrpi/save/iocISTTOKrpi.sav index a3fa10d..06017a4 100644 --- a/epics/iocs/ISTTOKrpi/iocBoot/iocISTTOKrpi/save/iocISTTOKrpi.sav +++ b/epics/iocs/ISTTOKrpi/iocBoot/iocISTTOKrpi/save/iocISTTOKrpi.sav @@ -1,4 +1,4 @@ -# autosave R5.3 Automatically generated - DO NOT MODIFY - 211209-150038 +# autosave R5.3 Automatically generated - DO NOT MODIFY - 211209-164041 ISTTOK:central:PULSE-NUMBER.VAL 0 ISTTOK:central:LogMessage.VAL ISTTOK:central:LASTOPSTATE.VAL 5 From f5aa69298b3984f45e2084be0639c146b33e953e Mon Sep 17 00:00:00 2001 From: Bernardo Carvalho Date: Tue, 14 Dec 2021 12:28:03 +0000 Subject: [PATCH 3/4] README edit Signed-off-by: Bernardo Carvalho --- epics/README.md | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/epics/README.md b/epics/README.md index 21d9262..65e4af4 100644 --- a/epics/README.md +++ b/epics/README.md @@ -201,7 +201,7 @@ Process Variables in this IOC Server: |ISTTOK:central:RPump2-Motor (Not Used/Disabled)| bo | 2 | | |ISTTOK:central:RPump2-Valve (Not Used/Disabled| bo | 3 | | |ISTTOK:central:VVessel-Filament| bo | 4 | 1 / NO| -|ISTTOK:central:Clean-TorContactor| bo | 7 | +|ISTTOK:central:Clean-TorContactor| bo | 7 | | ---------- @@ -242,8 +242,8 @@ Process Variables in this IOC Server: - Vacuum Pfeiffer Sensors (RS485) #### Hardware Platform -1. A Raspberry Pi 3, running a linux distribution.. - * Has a USB/RS485 port for monitoring pressure sensors +1. A Raspberry Pi 2, running a raspian Buster distribution.. + * Has a USB/RS485 interface for monitoring pressure sensors #### Process Variables Process Variables in this IOC Server: @@ -270,7 +270,8 @@ Process Variables in this IOC Server: ## Download and configure CS-Studio -* Install JAVA JDK (version Java SE Development Kit 8) +* Install JAVA JDK (version Java SE Development Kit 8) or +openjdk-8-jre linux package * Download ISTTOK EPICS Files to a working folder * `git clone https://bernardo@git.ipfn.tecnico.ulisboa.pt/r/ISTTOK.git` * Goto site [CS-Studio](http://download.controlsystemstudio.org/release/4.5/) and download latest version to your OS @@ -289,7 +290,7 @@ Process Variables in this IOC Server: ### EPICS Channel Access Configuration ``` -export EPICS_CA_ADDR_LIST=""192.168.1.110 192.168.1.120 192.168.1.152" +export EPICS_CA_ADDR_LIST="192.168.1.110 192.168.1.120 192.168.1.152" export EPICS_CA_AUTO_ADDR_LIST="NO" ``` From ecae668588f28ff5a90a03836ebb7f377e9d1d95 Mon Sep 17 00:00:00 2001 From: Bernardo Carvalho Date: Tue, 14 Dec 2021 14:19:56 +0000 Subject: [PATCH 4/4] Moved pfeffer sensors to cenrtal IOC --- .../ISTTOKrpiApp/Db/ISTTOKpfeiffer.db | 52 +++++++++---- .../ISTTOKrpi/ISTTOKrpiApp/Db/pfeiffer.proto | 28 ++++++- .../ISTTOKrpiApp/src/IsttokSeqExec.stt | 3 +- .../iocBoot/iocISTTOKrpi/iocISTTOKrpi.req | 2 + .../ISTTOKrpi/iocBoot/iocISTTOKrpi/pvList.txt | 77 +++++++++++-------- .../iocISTTOKrpi/save/iocISTTOKrpi.sav | 4 +- .../ISTTOKrpi/iocBoot/iocISTTOKrpi/st.cmd | 20 ++--- 7 files changed, 123 insertions(+), 63 deletions(-) diff --git a/epics/iocs/ISTTOKrpi/ISTTOKrpiApp/Db/ISTTOKpfeiffer.db b/epics/iocs/ISTTOKrpi/ISTTOKrpiApp/Db/ISTTOKpfeiffer.db index 577e88b..1abf55e 100644 --- a/epics/iocs/ISTTOKrpi/ISTTOKrpiApp/Db/ISTTOKpfeiffer.db +++ b/epics/iocs/ISTTOKrpi/ISTTOKrpiApp/Db/ISTTOKpfeiffer.db @@ -1,31 +1,44 @@ +# 8/5/2021 Only sensor 2 is working. Running with dspIC +# 20/9/2021 sensors 1,2,3 are working. Running with dspIC +# 20/9/2021 sensors 1,2,3 are working. Running with tty USB record (longin, "$(P)$(R)P001:M") { field (DESC, "getPressure001 $(bus)") field (DTYP, "stream") field (INP, "@pfeiffer.proto getPressure001($(P)$(R)P001:E) $(bus)") +# field (SCAN, "I/O Intr") field (SCAN, "1 second") - field (FLNK, "$(P)$(R)VVessel-Pressure") + field (FLNK, "$(P)$(R)TMPump1-PressureAdmission") } record (longin, "$(P)$(R)P001:E") { field (DESC, "Pressure001 exponent $(bus)") } -record (calc, "$(P)$(R)VVessel-Pressure") +record (calc, "$(P)$(R)TMPump1-PressureAdmission") { - field (DESC, "ISTTOK:central:VVessel-Pressure") + field(DESC, "ISTTOK:central:TMPump1-PressureAdmission") field(INPA, "$(P)$(R)P001:M") field(INPB, "$(P)$(R)P001:E") - field(CALC, "(A*0.001)*10.0**(B-20)") + field(CALC, "(A*0.001)* 10.0**(B-20)") field(PREC, "3") field(EGU, "mBar") + field(HIHI,"1.0e-2") + field(HIGH,"1.0e-3") +# field(LOW, "20.0") +# field(LOLO,"0.0") + field(HHSV,"MAJOR") + field(HSV, "MINOR") +# field(LSV, "MINOR") +# field(LLSV,"MAJOR") } - +# out "0020074002=?107"; record (longin, "$(P)$(R)P002:M") { field (DESC, "getPressure002 $(bus)") field (DTYP, "stream") field (INP, "@pfeiffer.proto getPressure002($(P)$(R)P002:E) $(bus)") - field (SCAN, "2 second") +# field (SCAN, "I/O Intr") + field (SCAN, "1 second") field (FLNK, "$(P)$(R)RPump1-Pressure") } record (longin, "$(P)$(R)P002:E") @@ -40,8 +53,8 @@ record (calc, "$(P)$(R)RPump1-Pressure") field(CALC, "(A*0.001)*10.0**(B-20)") field(PREC, "3") field(EGU, "mBar") -# field(HIHI,"1.0e-1") -# field(HIGH,"5.0e-3") + field(HIHI,"1.0e-1") + field(HIGH,"5.0e-2") # field(LOW, "20.0") # field(LOLO,"0.0") field(HHSV,"MAJOR") @@ -50,6 +63,7 @@ record (calc, "$(P)$(R)RPump1-Pressure") # field(LLSV,"MAJOR") } + # out "0030074002=?108"; record (longin, "$(P)$(R)P003:M") { field (DESC, "getPressure003 Mantissa $(bus)") @@ -57,30 +71,36 @@ record (longin, "$(P)$(R)P003:M") field (INP, "@pfeiffer.proto getPressure003($(P)$(R)P003:E) $(bus)") field (SCAN, "1 second") # field (SCAN, "I/O Intr") - field (FLNK, "$(P)$(R)TMPump1-PressureAdmission") + field (FLNK, "$(P)$(R)VVessel-Pressure") } record (longin, "$(P)$(R)P003:E") { field (DESC, "Pressure003 Exponent $(bus)") } -record (calc, "$(P)$(R)TMPump1-PressureAdmission") +record (calc, "$(P)$(R)VVessel-Pressure") { - field(DESC, "ISTTOK:central:TMPump1-PressureAdmission") + field (DESC, "ISTTOK:central:VVessel-Pressure") field(INPA, "$(P)$(R)P003:M") field(INPB, "$(P)$(R)P003:E") - field(CALC, "(A*0.001)* 10.0**(B-20)") + field(CALC, "(A*0.001)*10.0**(B-20)") field(PREC, "3") field(EGU, "mBar") + field(HIHI,"1.0e-1") + field(HIGH,"1.0e-2") + field(HHSV,"MAJOR") + field(HSV, "MINOR") } - + # out "0040074002=?109"; + # NOT connected 26/10/2021 record (longin, "$(P)$(R)P004:M") { field (DESC, "getPressure004 Mantissa $(bus)") field (DTYP, "stream") field (INP, "@pfeiffer.proto getPressure004($(P)$(R)P004:E) $(bus)") - field (SCAN, "1 second") +# field (SCAN, "1 second") +# field (SCAN, "I/O Intr") field (FLNK, "$(P)$(R)RPump2-Pressure") } record (longin, "$(P)$(R)P004:E") @@ -100,8 +120,8 @@ record (calc, "$(P)$(R)RPump2-Pressure") # field(HIGH,"5.0e-3") # field(LOW, "20.0") # field(LOLO,"0.0") - field(HHSV,"MAJOR") - field(HSV, "MINOR") +# field(HHSV,"MAJOR") +# field(HSV, "MINOR") # field(LSV, "MINOR") # field(LLSV,"MAJOR") } diff --git a/epics/iocs/ISTTOKrpi/ISTTOKrpiApp/Db/pfeiffer.proto b/epics/iocs/ISTTOKrpi/ISTTOKrpiApp/Db/pfeiffer.proto index 527ef03..71ea537 100644 --- a/epics/iocs/ISTTOKrpi/ISTTOKrpiApp/Db/pfeiffer.proto +++ b/epics/iocs/ISTTOKrpi/ISTTOKrpiApp/Db/pfeiffer.proto @@ -1,23 +1,43 @@ Terminator=CR; -MaxInput = 20; +# CR and LF are control characters, respectively coded 0x0D (13 decimal) and 0x0A (10 decimal) +# CR and LF are control characters, respectively coded 0x0D (13 decimal) and 0x0A (10 decimal) +MaxInput = 30; +ExtraInput = Ignore; + +# Values in millisecond +LockTimeout = 1000; +# Affects first out command in a protocol. +# If other records currently use the device, how many milliseconds to wait for +# exclusive access to the device before giving up? + +#ReadTimeout = 1500; + +ReplyTimeout = 400; + +#PollPeriod = $ReplyTimeout; +#Integer. Affects first in command in I/O Intr mode (see chapter Record Processing). +PollPeriod = 200; -# in millisecond -#ReadTimeout = 2000; -ReplyTimeout = 250; # Using redirection to read 2 records, mantissa and exponent +# TMPump1-PressureAdmission getPressure001 { out "0010074002=?106"; in "0011074006%4u%(\$1)2u%+"; } + +#RPump1-Pressure getPressure002 { out "0020074002=?107"; in "0021074006%4u%(\$1)2u%+"; } + +#VVessel-Pressure getPressure003 { out "0030074002=?108"; in "0031074006%4u%(\$1)2u%+"; } + getPressure004 { out "0040074002=?109"; in "0041074006%4u%(\$1)2u%+"; diff --git a/epics/iocs/ISTTOKrpi/ISTTOKrpiApp/src/IsttokSeqExec.stt b/epics/iocs/ISTTOKrpi/ISTTOKrpiApp/src/IsttokSeqExec.stt index a101e9c..921f625 100644 --- a/epics/iocs/ISTTOKrpi/ISTTOKrpiApp/src/IsttokSeqExec.stt +++ b/epics/iocs/ISTTOKrpi/ISTTOKrpiApp/src/IsttokSeqExec.stt @@ -178,7 +178,8 @@ monitor IsttokTMPump2_Emergency; */ float IsttokRPump1_Pressure; -assign IsttokRPump1_Pressure to "ISTTOK:vacuum:RPump1-Pressure"; +/*assign IsttokRPump1_Pressure to "ISTTOK:vacuum:RPump1-Pressure";*/ +assign IsttokRPump1_Pressure to "ISTTOK:central:RPump1-Pressure"; monitor IsttokRPump1_Pressure; /* diff --git a/epics/iocs/ISTTOKrpi/iocBoot/iocISTTOKrpi/iocISTTOKrpi.req b/epics/iocs/ISTTOKrpi/iocBoot/iocISTTOKrpi/iocISTTOKrpi.req index ad20912..3463283 100644 --- a/epics/iocs/ISTTOKrpi/iocBoot/iocISTTOKrpi/iocISTTOKrpi.req +++ b/epics/iocs/ISTTOKrpi/iocBoot/iocISTTOKrpi/iocISTTOKrpi.req @@ -12,6 +12,8 @@ ISTTOK:central:Shot-TorPSCurrent ISTTOK:central:UPS-Shutdown #ALARM Limits +ISTTOK:central:RPump1-Pressure.HIGH +ISTTOK:central:RPump1-Pressure.HIHI #ISTTOK:central:RPump2-Pressure.HIGH #ISTTOK:central:RPump2-Pressure.HIHI diff --git a/epics/iocs/ISTTOKrpi/iocBoot/iocISTTOKrpi/pvList.txt b/epics/iocs/ISTTOKrpi/iocBoot/iocISTTOKrpi/pvList.txt index a07ec49..5b503db 100644 --- a/epics/iocs/ISTTOKrpi/iocBoot/iocISTTOKrpi/pvList.txt +++ b/epics/iocs/ISTTOKrpi/iocBoot/iocISTTOKrpi/pvList.txt @@ -1,6 +1,11 @@ -ISTTOK:central:PCF8591:72:ADC_CH1 -ISTTOK:central:PCF8591:72:ADC_CH2 -ISTTOK:central:PCF8591:72:ADC_CH3 +ISTTOK:central:TMPump1-Power +ISTTOK:central:TMPump1-Emergency +ISTTOK:central:TMPump1-Acceleration +ISTTOK:central:TMPump1-NormalOperation +ISTTOK:central:TMPump2-Emergency +ISTTOK:central:TMPump2-Acceleration +ISTTOK:central:TTSystem-tzero +ISTTOK:central:Emergency-PhysButton ISTTOK:central:UPS-OnBattery ISTTOK:central:UPS-Shutdown ISTTOK:central:OPREQ @@ -36,6 +41,14 @@ ISTTOK:SR_heartbeat ISTTOK:SR_i_am_alive ISTTOK:SR_deadIfZero ISTTOK:SR_disable +ISTTOK:central:TMPump1-ControllerOnInv +ISTTOK:central:TMPump1-ControllerOffInv +ISTTOK:central:TMPump1-MotorOnInv +ISTTOK:central:TMPump1-MotorOffInv +ISTTOK:central:BuzzerInv +ISTTOK:central:Shot-TorPSTriggerInv +ISTTOK:central:PCF8574:56:REGISTER:READ:FNOUT +ISTTOK:central:PCF8574:57:REGISTER:READ:FNOUT ISTTOK:central:PULSE-NUMBER ISTTOK:central:PCF8591:72:DAC ISTTOK:central:TDA8444:32:DAC_CH0 @@ -55,8 +68,6 @@ ISTTOK:SR_5_State ISTTOK:SR_6_State ISTTOK:SR_7_State ISTTOK:SR_disableMaxSecs -ISTTOK:central:PCF8574:56:REGISTER:READ:FNOUT -ISTTOK:central:PCF8574:57:REGISTER:READ:FNOUT ISTTOK:central:OPCALCSTATE ISTTOK:central:STARTCALCSTATE ISTTOK:central:STOPPINGCALCSTATE @@ -68,12 +79,22 @@ ISTTOK:central:PCF8591:72:BYTE2_CH1 ISTTOK:central:PCF8591:72:BYTE2_CH2 ISTTOK:central:PCF8591:72:BYTE2_CH3 ISTTOK:central:Emergency -ISTTOK:central:TMPump1-ControllerOnInv -ISTTOK:central:TMPump1-ControllerOffInv -ISTTOK:central:TMPump1-MotorOnInv -ISTTOK:central:TMPump1-MotorOffInv -ISTTOK:central:BuzzerInv -ISTTOK:central:Shot-TorPSTriggerInv +ISTTOK:central:TMPump1-PressureAdmission +ISTTOK:central:RPump1-Pressure +ISTTOK:central:VVessel-Pressure +ISTTOK:central:RPump2-Pressure +ISTTOK:central:TMPump2-Speed +ISTTOK:central:TMPump2-Current +ISTTOK:central:Shot-TorPSCurrentImage +ISTTOK:central:OPSTATE +ISTTOK:central:STARTINGSTATE +ISTTOK:central:CLEANINGSTATE +ISTTOK:central:WSHOTINGSTATE +ISTTOK:central:STOPPINGSTATE +ISTTOK:central:PCF8574:56:REGISTER:READ +ISTTOK:central:PCF8574:57:REGISTER:READ +ISTTOK:central:PCF8574:60:REGISTER:READ +ISTTOK:central:PCF8574:61:REGISTER:READ ISTTOK:central:LASTOPSTATE ISTTOK:SR_rebootStatus ISTTOK:SR_status @@ -85,28 +106,26 @@ ISTTOK:SR_4_Status ISTTOK:SR_5_Status ISTTOK:SR_6_Status ISTTOK:SR_7_Status -ISTTOK:central:TMPump1-Power -ISTTOK:central:TMPump1-Emergency -ISTTOK:central:TMPump1-Acceleration -ISTTOK:central:TMPump1-NormalOperation -ISTTOK:central:TMPump2-Emergency -ISTTOK:central:TMPump2-Acceleration -ISTTOK:central:TTSystem-tzero -ISTTOK:central:Emergency-PhysButton ISTTOK:central:PCF8574:56:REGISTER ISTTOK:central:PCF8574:57:REGISTER ISTTOK:central:PCF8574:60:REGISTER ISTTOK:central:PCF8574:61:REGISTER ISTTOK:central:PCF8591:72:CTRLREGISTER -ISTTOK:central:PCF8574:56:REGISTER:READ -ISTTOK:central:PCF8574:57:REGISTER:READ -ISTTOK:central:PCF8574:60:REGISTER:READ -ISTTOK:central:PCF8574:61:REGISTER:READ -ISTTOK:central:TMPump2-Speed -ISTTOK:central:TMPump2-Current -ISTTOK:central:Shot-TorPSCurrentImage +ISTTOK:central:CurrentTime +ISTTOK:central:PCF8591:72:ADC_CH1 +ISTTOK:central:PCF8591:72:ADC_CH2 +ISTTOK:central:PCF8591:72:ADC_CH3 +ISTTOK:central:P001:M +ISTTOK:central:P001:E +ISTTOK:central:P002:M +ISTTOK:central:P002:E +ISTTOK:central:P003:M +ISTTOK:central:P003:E +ISTTOK:central:P004:M +ISTTOK:central:P004:E ISTTOK:central:TraceMessage ISTTOK:central:LogMessage +ISTTOK:central:RS485Debug ISTTOK:central:sendmail ISTTOK:SR_recentlyStr ISTTOK:SR_rebootStatusStr @@ -136,9 +155,3 @@ ISTTOK:SR_6_Time ISTTOK:SR_7_Name ISTTOK:SR_7_StatusStr ISTTOK:SR_7_Time -ISTTOK:central:OPSTATE -ISTTOK:central:STARTINGSTATE -ISTTOK:central:CLEANINGSTATE -ISTTOK:central:WSHOTINGSTATE -ISTTOK:central:STOPPINGSTATE -ISTTOK:central:CurrentTime diff --git a/epics/iocs/ISTTOKrpi/iocBoot/iocISTTOKrpi/save/iocISTTOKrpi.sav b/epics/iocs/ISTTOKrpi/iocBoot/iocISTTOKrpi/save/iocISTTOKrpi.sav index 06017a4..b4f1cc0 100644 --- a/epics/iocs/ISTTOKrpi/iocBoot/iocISTTOKrpi/save/iocISTTOKrpi.sav +++ b/epics/iocs/ISTTOKrpi/iocBoot/iocISTTOKrpi/save/iocISTTOKrpi.sav @@ -1,4 +1,4 @@ -# autosave R5.3 Automatically generated - DO NOT MODIFY - 211209-164041 +# autosave R5.3 Automatically generated - DO NOT MODIFY - 211214-141949 ISTTOK:central:PULSE-NUMBER.VAL 0 ISTTOK:central:LogMessage.VAL ISTTOK:central:LASTOPSTATE.VAL 5 @@ -9,4 +9,6 @@ ISTTOK:central:Emergency-UserButton.VAL 0 ISTTOK:central:TMPump1-ManualValve.VAL 1 ISTTOK:central:Shot-TorPSCurrent 32 ISTTOK:central:UPS-Shutdown 0 +ISTTOK:central:RPump1-Pressure.HIGH 0.05 +ISTTOK:central:RPump1-Pressure.HIHI 0.1 diff --git a/epics/iocs/ISTTOKrpi/iocBoot/iocISTTOKrpi/st.cmd b/epics/iocs/ISTTOKrpi/iocBoot/iocISTTOKrpi/st.cmd index 643fafd..5ff2d50 100755 --- a/epics/iocs/ISTTOKrpi/iocBoot/iocISTTOKrpi/st.cmd +++ b/epics/iocs/ISTTOKrpi/iocBoot/iocISTTOKrpi/st.cmd @@ -25,18 +25,18 @@ dbLoadRecords("db/ISTTOKtda8444.db","P=ISTTOK:,R=central:,BUS=I2C") dbLoadRecords("db/ISTTOKmachineControl.db","P=ISTTOK:,R=central:") ## Load Serial drivers -#drvAsynSerialPortConfigure("RS0","/dev/ttyUSB0") #drvAsynSerialPortConfigure("RS0","/dev/ttyAMA0") -#asynSetOption("RS0", 0, "baud", "9600") -#asynSetOption("RS0", 0, "bits", "8") -#asynSetOption("RS0", 0, "parity", "none") -#asynSetOption("RS0", 0, "stop", "1") -#asynSetOption("RS0", 0, "clocal", "Y") -#asynSetOption("RS0", 0, "crtscts", "N") +drvAsynSerialPortConfigure("RS0","/dev/ttyUSB0") +asynSetOption("RS0", 0, "baud", "9600") +asynSetOption("RS0", 0, "bits", "8") +asynSetOption("RS0", 0, "parity", "none") +asynSetOption("RS0", 0, "stop", "1") +asynSetOption("RS0", 0, "clocal", "Y") +asynSetOption("RS0", 0, "crtscts", "N") # Pfeiffer sensor are connectoed to other RPI /(192.168.1.120) -#dbLoadRecords("db/ISTTOKpfeiffer.db","P=ISTTOK:,R=central:,bus=RS0") +dbLoadRecords("db/ISTTOKpfeiffer.db","P=ISTTOK:,R=central:,bus=RS0") # connect to the MAIL server mail.ipfn.tecnico.ulisboa.pt # ,priority,noAutoConnect,noProcessEos @@ -45,8 +45,10 @@ drvAsynIPPortConfigure("L0","193.136.136.3:25",0,1,0) dbLoadRecords("db/sendmail.db", "P=ISTTOK:,PORT=L0,R=central:,L=0,A=0") # Uncomment to Debug STREAMDEVICE serial activity +# 2021/12/14 13:11:50.019969 RS0 ISTTOK:central:P002:M: No reply within 200 ms to "0020074002=?107<0d> #var streamError 1 -#var streamDebug 1 +#with this no errors on pfeiffer bus +var streamDebug 1 streamSetLogfile("logfile.txt") ## Run this to trace the stages of iocInit