diff --git a/epics/iocs/ISTTOKrpi/ISTTOKrpiApp/Db/ISTTOKpcf8591.db b/epics/iocs/ISTTOKrpi/ISTTOKrpiApp/Db/ISTTOKpcf8591.db index 00ff57a..0aad50b 100644 --- a/epics/iocs/ISTTOKrpi/ISTTOKrpiApp/Db/ISTTOKpcf8591.db +++ b/epics/iocs/ISTTOKrpi/ISTTOKrpiApp/Db/ISTTOKpcf8591.db @@ -10,7 +10,7 @@ # ### macros: ID I2C address of ADC ### # # ### Description: ### # # ### This DB file is using ### # -# ### stream(asynI2C) to read/write ### # +# ### stream(asynI2C) to read/write ### # # ### an PCF8591 ADDA chip ### # ####################################################### @@ -40,7 +40,7 @@ record( ai, "$(P)$(R)TMPump2-Speed" ) { field(DESC, "TMPump2-Speed") field(DTYP, "Raw Soft Channel" ) field(INP, "$(P)$(R)PCF8591:72:BYTE2_CH1 PP NMS") - field(SCAN, "1 second") +# field(SCAN, "1 second") field(ASLO, "16" ) field(AOFF, "0" ) field(EGU, "RPM" ) @@ -66,7 +66,7 @@ record( ai, "$(P)$(R)TMPump2-Current" ) { field(DESC, "TMPump2-Current") field(DTYP, "Raw Soft Channel" ) field(INP, "$(P)$(R)PCF8591:72:BYTE2_CH2 PP NMS") - field(SCAN, "1 second") + # field(SCAN, "1 second") field(ASLO, "0.1" ) field(AOFF, "0" ) field(EGU, "mA" ) @@ -93,7 +93,7 @@ record(ai, "$(P)$(R)Shot-TorPSCurrentImage" ) { field(DESC, "Toroidal Current Image") field(DTYP, "Raw Soft Channel" ) field(INP, "$(P)$(R)PCF8591:72:BYTE2_CH3 PP NMS") - field(SCAN, ".2 second") + # field(SCAN, ".2 second") field(ASLO, "39.215686275" ) field(AOFF, "0.0" ) field(EGU, "A" ) diff --git a/epics/iocs/ISTTOKrpi/ISTTOKrpiApp/Db/ISTTOKtda8444.db b/epics/iocs/ISTTOKrpi/ISTTOKrpiApp/Db/ISTTOKtda8444.db index 1977cf6..00a5a3a 100644 --- a/epics/iocs/ISTTOKrpi/ISTTOKrpiApp/Db/ISTTOKtda8444.db +++ b/epics/iocs/ISTTOKrpi/ISTTOKrpiApp/Db/ISTTOKtda8444.db @@ -7,7 +7,7 @@ # ### ### # # ### Ref 2.0; 2019-10-14 ### # # ### ### # -# ### macros: ID I2C address of ADC ### # +# ### macros: ID I2C address of DAC ### # # ### Description: ### # # ### This DB file is using ### # # ### stream(asynI2C) to write ### # diff --git a/epics/iocs/ISTTOKrpi/ISTTOKrpiApp/Db/Makefile b/epics/iocs/ISTTOKrpi/ISTTOKrpiApp/Db/Makefile index a72cea7..642dba3 100644 --- a/epics/iocs/ISTTOKrpi/ISTTOKrpiApp/Db/Makefile +++ b/epics/iocs/ISTTOKrpi/ISTTOKrpiApp/Db/Makefile @@ -11,6 +11,11 @@ DB += ISTTOKpcf8591.db DB += ISTTOKpfeiffer.db DB += ISTTOKtda8444.db DB += sendmail.db +DB += pcf8591.proto +DB += tda8444.proto +DB += sendmail.proto +DB += pcf8574.proto +DB += pfeiffer.proto # If .db template is not named *.template add # _TEMPLATE = diff --git a/epics/iocs/ISTTOKrpi/protocols/pcf8574.proto b/epics/iocs/ISTTOKrpi/ISTTOKrpiApp/Db/pcf8574.proto similarity index 100% rename from epics/iocs/ISTTOKrpi/protocols/pcf8574.proto rename to epics/iocs/ISTTOKrpi/ISTTOKrpiApp/Db/pcf8574.proto diff --git a/epics/iocs/ISTTOKrpi/protocols/pcf8591.proto b/epics/iocs/ISTTOKrpi/ISTTOKrpiApp/Db/pcf8591.proto similarity index 98% rename from epics/iocs/ISTTOKrpi/protocols/pcf8591.proto rename to epics/iocs/ISTTOKrpi/ISTTOKrpiApp/Db/pcf8591.proto index d136f30..d66da3e 100644 --- a/epics/iocs/ISTTOKrpi/protocols/pcf8591.proto +++ b/epics/iocs/ISTTOKrpi/ISTTOKrpiApp/Db/pcf8591.proto @@ -5,7 +5,7 @@ ReadTimeout = 100; WriteTimeout = 100; MaxInput = 2; ExtraInput = Error; - + rReg { out ${1}; in "%.1r"; @@ -17,7 +17,7 @@ rReg { # Bits 4,5 ADC configuration . 00 = four single ended channels # Bits 6 : DAC Output enable bit # Bits 7 : =0 - + rConvAdc0 { out ${1} 64; in "%02r"; @@ -34,15 +34,14 @@ rConvAdc3 { out ${1} 67; in "%02r"; } - + ## @init { rReg; } ## wReg { out ${1} "%.1r"; } - + wDac { out ${1} 64 "%.1r"; } - diff --git a/epics/iocs/ISTTOKrpi/protocols/pfeiffer.proto b/epics/iocs/ISTTOKrpi/ISTTOKrpiApp/Db/pfeiffer.proto similarity index 100% rename from epics/iocs/ISTTOKrpi/protocols/pfeiffer.proto rename to epics/iocs/ISTTOKrpi/ISTTOKrpiApp/Db/pfeiffer.proto diff --git a/epics/iocs/ISTTOKrpi/protocols/sendmail.proto b/epics/iocs/ISTTOKrpi/ISTTOKrpiApp/Db/sendmail.proto similarity index 100% rename from epics/iocs/ISTTOKrpi/protocols/sendmail.proto rename to epics/iocs/ISTTOKrpi/ISTTOKrpiApp/Db/sendmail.proto diff --git a/epics/iocs/ISTTOKrpi/protocols/tda8444.proto b/epics/iocs/ISTTOKrpi/ISTTOKrpiApp/Db/tda8444.proto similarity index 100% rename from epics/iocs/ISTTOKrpi/protocols/tda8444.proto rename to epics/iocs/ISTTOKrpi/ISTTOKrpiApp/Db/tda8444.proto diff --git a/epics/iocs/ISTTOKrpi/ISTTOKrpiApp/src/IsttokSeqExec.stt b/epics/iocs/ISTTOKrpi/ISTTOKrpiApp/src/IsttokSeqExec.stt index 54c0a5b..74e679d 100644 --- a/epics/iocs/ISTTOKrpi/ISTTOKrpiApp/src/IsttokSeqExec.stt +++ b/epics/iocs/ISTTOKrpi/ISTTOKrpiApp/src/IsttokSeqExec.stt @@ -11,12 +11,14 @@ * Copyright (c) : (IPFN-IST) * * Created 5-Mar-2013 - * Revised 01-07-2019 + * Revised 07-May-2021 * Modified 18-Nov-2019 * **/ +//%% #include "errlog.h" program IsttokSeqExec +%{#include "errlog.h"}% /* CONSTANT DECLARATION*/ /*Relays and INPUT (Valleman Board) have negative Logic!*/ short PCF_RELAY_ON = 0; @@ -166,18 +168,22 @@ monitor IsttokTMPump1_Emergency; short IsttokTMPump1_ManualValve; assign IsttokTMPump1_ManualValve to "ISTTOK:central:TMPump1-ManualValve"; monitor IsttokTMPump1_ManualValve; - + +/* short IsttokTMPump2_Emergency; assign IsttokTMPump2_Emergency to "ISTTOK:central:TMPump2-Emergency"; monitor IsttokTMPump2_Emergency; - +*/ + float IsttokRPump1_Pressure; -assign IsttokRPump1_Pressure to "ISTTOK:central:RPump1-Pressure"; +assign IsttokRPump1_Pressure to "ISTTOK:vacuum:RPump1-Pressure"; monitor IsttokRPump1_Pressure; +/* float IsttokRPump2_Pressure; assign IsttokRPump2_Pressure to "ISTTOK:central:RPump2-Pressure"; monitor IsttokRPump2_Pressure; +*/ float IsttokVVesselTemperature; assign IsttokVVesselTemperature to "ISTTOK:temperature:VVessel-Temperature"; @@ -406,13 +412,14 @@ ss PulseSequence { /* Pulse state change to Emergency*/ } state Emergency - when ( pvStatus(IsttokRPump1_Pressure) != pvStatOK || pvStatus(IsttokRPump2_Pressure) != pvStatOK || - pvStatus(IsttokTMPump1_Emergency) != pvStatOK || pvStatus(IsttokTMPump2_Emergency) != pvStatOK) { + 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) { /* Vacuum emergency: Pulse state change to Stopping */ IsttokOPREQ = STOP; pvPut(IsttokOPREQ); //strcpy(sendMail, "Vacuum Emergency while Process"); - sprintf(sendMail, "R1:%1.1e R2:%.1e T1:%d T2:%d",IsttokRPump1_Pressure,IsttokRPump2_Pressure,IsttokTMPump1_Emergency,IsttokTMPump2_Emergency); + sprintf(sendMail, "R1:%1.1e T1:%d",IsttokRPump1_Pressure,IsttokTMPump1_Emergency); pvPut(sendMail); } state Stopping @@ -453,8 +460,9 @@ ss PulseSequence { when (IsttokOPREQ == STOP) {} state Stopping - when ( pvStatus(IsttokTMPump1_Emergency) != pvStatOK || - pvStatus(IsttokTMPump2_Emergency) != pvStatOK) { + when ( pvStatus(IsttokTMPump1_Emergency) != pvStatOK) { + //when ( pvStatus(IsttokTMPump1_Emergency) != pvStatOK || + // pvStatus(IsttokTMPump2_Emergency) != pvStatOK) { /* Vacuum emergency: Pulse state change to Stopping */ IsttokOPREQ = STOP; pvPut(IsttokOPREQ); @@ -497,8 +505,9 @@ ss PulseSequence { /* Pulse state change to Stopping */ } state Stopping - when ( pvStatus(IsttokTMPump1_Emergency) != pvStatOK || - pvStatus(IsttokTMPump2_Emergency) != pvStatOK) { + when ( pvStatus(IsttokTMPump1_Emergency) != pvStatOK) { + //when ( pvStatus(IsttokTMPump1_Emergency) != pvStatOK || + // pvStatus(IsttokTMPump2_Emergency) != pvStatOK) { /* Vacuum emergency: Pulse state change to Stopping */ IsttokOPREQ = STOP; pvPut(IsttokOPREQ); @@ -677,7 +686,8 @@ ss StartingSequence { STARTINGSTATE = STRST_NonStarting; pvPut(STARTINGSTATE); } state NonStarting - when ( (pvStatus(IsttokRPump1_Pressure) == pvStatOK) && (pvStatus(IsttokRPump2_Pressure) == pvStatOK)) { + //when ( (pvStatus(IsttokRPump1_Pressure) == pvStatOK) && (pvStatus(IsttokRPump2_Pressure) == pvStatOK)) { + when ( pvStatus(IsttokRPump1_Pressure) == pvStatOK) { strcpy(msg, "TMP1 MotorOn ON" ); pvPut(msg); diff --git a/epics/iocs/ISTTOKrpi/ISTTOKrpiApp/src/Makefile b/epics/iocs/ISTTOKrpi/ISTTOKrpiApp/src/Makefile index 82c5d9c..f4d05bc 100644 --- a/epics/iocs/ISTTOKrpi/ISTTOKrpiApp/src/Makefile +++ b/epics/iocs/ISTTOKrpi/ISTTOKrpiApp/src/Makefile @@ -4,18 +4,38 @@ include $(TOP)/configure/CONFIG #---------------------------------------- # ADD MACRO DEFINITIONS BELOW HERE +# Use typed rset structure (see 3.16.1 release notes) +USR_CPPFLAGS += -DUSE_TYPED_RSET + +# xxxRecord.h will be created from xxxRecord.dbd +#DBDINC += xxxRecord + +# Install xxxSupport.dbd into /dbd +#DBD += xxxSupport.dbd + # Build an IOC support library LIBRARY_IOC += ISTTOKrpiSupport -# Compile and add the code to the support library +# Compile and add code to the support library +#ISTTOKrpiSupport_SRCS += xxxRecord.c +#ISTTOKrpiSupport_SRCS += devXxxSoft.c # Link locally-provided code into the support library, -# rather than directly into the IOC application. -# This is required for Windows DLL builds. +# rather than directly into the IOC application, that +# causes problems on Windows DLL builds +#ISTTOKrpiSupport_SRCS += dbSubExample.c +#ISTTOKrpiSupport_SRCS += devISTTOKrpiVersion.c +#ISTTOKrpiSupport_SRCS += ISTTOKrpiHello.c ISTTOKrpiSupport_SRCS += initTrace.c ISTTOKrpiSupport_LIBS += $(EPICS_BASE_IOC_LIBS) +# Auto-generate a header file containing a version string. +# Version comes from the VCS if available, else date+time. +#GENVERSION = ISTTOKrpiVersion.h +# Macro name +#GENVERSIONMACRO = ISTTOKrpiVERSION + # Build the IOC application PROD_IOC = ISTTOKrpi @@ -27,6 +47,7 @@ ISTTOKrpi_DBD += base.dbd ISTTOKrpi_DBD += initTrace.dbd # Include dbd files from all support applications: ISTTOKrpi_DBD += asyn.dbd +#ISTTOKrpi_DBD += calc.dbd ISTTOKrpi_DBD += stream.dbd ISTTOKrpi_DBD += drvAsynI2C.dbd ISTTOKrpi_DBD += drvAsynSerialPort.dbd @@ -35,6 +56,7 @@ ISTTOKrpi_DBD += asSupport.dbd # Add all the support libraries needed by this IOC ISTTOKrpi_LIBS += asyn +#ISTTOKrpi_LIBS += calc ISTTOKrpi_LIBS += stream ISTTOKrpi_LIBS += drvAsynI2C ISTTOKrpi_LIBS += autosave @@ -52,14 +74,21 @@ ISTTOKrpi_LIBS += ISTTOKrpiSupport # To build SNL programs, SNCSEQ must be defined # in the /configure/RELEASE file ifneq ($(SNCSEQ),) - # Build sncExample into ISTTOKrpiSupport , Safe Mode : +s + # Build sncExample into ISTTOKrpiSupport , Safe Mode : +s IsttokSeqExec_SNCFLAGS += +r +s ISTTOKrpi_DBD += IsttokSeqExec.dbd # A .stt sequence program is *not* pre-processed: ISTTOKrpiSupport_SRCS += IsttokSeqExec.stt ISTTOKrpiSupport_LIBS += seq pv ISTTOKrpi_LIBS += seq pv +endif +# Link QSRV (pvAccess Server) if available +ifdef EPICS_QSRV_MAJOR_VERSION + ISTTOKrpi_LIBS += qsrv + ISTTOKrpi_LIBS += $(EPICS_BASE_PVA_CORE_LIBS) + ISTTOKrpi_DBD += PVAServerRegister.dbd + ISTTOKrpi_DBD += qsrv.dbd endif # Finally link IOC to the EPICS Base libraries @@ -69,3 +98,5 @@ include $(TOP)/configure/RULES #---------------------------------------- # ADD EXTRA GNUMAKE RULES BELOW HERE +# Explicit dependency needed for generated header file +devISTTOKrpiVersion$(DEP): $(COMMON_DIR)/$(GENVERSION) diff --git a/epics/iocs/ISTTOKrpi/iocBoot/iocISTTOKrpi/Makefile b/epics/iocs/ISTTOKrpi/iocBoot/iocISTTOKrpi/Makefile index e064d73..e1b9aa4 100644 --- a/epics/iocs/ISTTOKrpi/iocBoot/iocISTTOKrpi/Makefile +++ b/epics/iocs/ISTTOKrpi/iocBoot/iocISTTOKrpi/Makefile @@ -1,4 +1,5 @@ TOP = ../.. include $(TOP)/configure/CONFIG +ARCH = $(EPICS_HOST_ARCH) TARGETS = envPaths include $(TOP)/configure/RULES.ioc diff --git a/epics/iocs/ISTTOKrpi/iocBoot/iocISTTOKrpi/envPaths b/epics/iocs/ISTTOKrpi/iocBoot/iocISTTOKrpi/envPaths index 666b481..13171b5 100644 --- a/epics/iocs/ISTTOKrpi/iocBoot/iocISTTOKrpi/envPaths +++ b/epics/iocs/ISTTOKrpi/iocBoot/iocISTTOKrpi/envPaths @@ -1,9 +1,10 @@ epicsEnvSet("IOC","iocISTTOKrpi") epicsEnvSet("TOP","/home/pi/ISTTOK/epics/iocs/ISTTOKrpi") -epicsEnvSet("SUPPORT","/usr/local/epics/base/../synApps_5_8/support") -epicsEnvSet("SNCSEQ","/usr/local/epics/base/../synApps_5_8/support/seq-2-2-1") -epicsEnvSet("ASYN","/usr/local/epics/base/../synApps_5_8/support/asyn-4-26") -epicsEnvSet("STREAM","/usr/local/epics/base/../synApps_5_8/support/stream-2-6a") -epicsEnvSet("AUTOSAVE","/usr/local/epics/base/../synApps_5_8/support/autosave-5-6-1") -epicsEnvSet("DRVASYNI2C","/usr/local/epics/base/../modules/drvAsynI2C") -epicsEnvSet("EPICS_BASE","/usr/local/epics/base") +epicsEnvSet("EPICS_BASE","/home/pi/Apps/epics7/epics-base") +epicsEnvSet("HOME","/home/pi") +epicsEnvSet("SUPPORT","/home/pi/Apps/epics7/support") +epicsEnvSet("ASYN","/home/pi/Apps/epics7/support/asyn") +epicsEnvSet("STREAM","/home/pi/Apps/epics7/support/StreamDevice") +epicsEnvSet("AUTOSAVE","/home/pi/Apps/epics7/support/autosave") +epicsEnvSet("DRVASYNI2C","/home/pi/Apps/epics7/support/drvAsynI2C") +epicsEnvSet("SNCSEQ","/home/pi/Apps/epics7/support/seq-2-2") diff --git a/epics/iocs/ISTTOKrpi/iocBoot/iocISTTOKrpi/iocISTTOKrpi.req b/epics/iocs/ISTTOKrpi/iocBoot/iocISTTOKrpi/iocISTTOKrpi.req index 9436041..e382569 100644 --- a/epics/iocs/ISTTOKrpi/iocBoot/iocISTTOKrpi/iocISTTOKrpi.req +++ b/epics/iocs/ISTTOKrpi/iocBoot/iocISTTOKrpi/iocISTTOKrpi.req @@ -11,8 +11,8 @@ ISTTOK:central:TMPump1-ManualValve.VAL ISTTOK:central:Shot-TorPSCurrent #ALARM Limits -ISTTOK:central:RPump1-Pressure.HIGH -ISTTOK:central:RPump1-Pressure.HIHI -ISTTOK:central:RPump2-Pressure.HIGH -ISTTOK:central:RPump2-Pressure.HIHI +ISTTOK:vacuum:RPump1-Pressure.HIGH +ISTTOK:vacuum:RPump1-Pressure.HIHI +#ISTTOK:central:RPump2-Pressure.HIGH +#ISTTOK:central:RPump2-Pressure.HIHI diff --git a/epics/iocs/ISTTOKrpi/iocBoot/iocISTTOKrpi/save/iocISTTOKrpi.sav b/epics/iocs/ISTTOKrpi/iocBoot/iocISTTOKrpi/save/iocISTTOKrpi.sav index 61ac337..3d56bd1 100644 --- a/epics/iocs/ISTTOKrpi/iocBoot/iocISTTOKrpi/save/iocISTTOKrpi.sav +++ b/epics/iocs/ISTTOKrpi/iocBoot/iocISTTOKrpi/save/iocISTTOKrpi.sav @@ -1,15 +1,14 @@ -# autosave R5.3 Automatically generated - DO NOT MODIFY - 200127-094325 -ISTTOK:central:PULSE-NUMBER.VAL 48422 -ISTTOK:central:LogMessage.VAL Emplastro esteve aqui -ISTTOK:central:LASTOPSTATE.VAL 5 -ISTTOK:central:OPREQ 1 +# autosave R5.3 Automatically generated - DO NOT MODIFY - 210510-201940 +! 2 channel(s) not connected - or not all gets were successful +ISTTOK:central:PULSE-NUMBER.VAL 0 +ISTTOK:central:LogMessage.VAL +ISTTOK:central:LASTOPSTATE.VAL 0 +ISTTOK:central:OPREQ 0 ISTTOK:central:PROCESS-MODE.VAL 0 -ISTTOK:central:CLEANINGMANMODE.VAL 1 +ISTTOK:central:CLEANINGMANMODE.VAL 0 ISTTOK:central:Emergency-UserButton.VAL 0 -ISTTOK:central:TMPump1-ManualValve.VAL 1 -ISTTOK:central:Shot-TorPSCurrent 34 -ISTTOK:central:RPump1-Pressure.HIGH 0 -ISTTOK:central:RPump1-Pressure.HIHI 0 -ISTTOK:central:RPump2-Pressure.HIGH 0 -ISTTOK:central:RPump2-Pressure.HIHI 0 +ISTTOK:central:TMPump1-ManualValve.VAL 0 +ISTTOK:central:Shot-TorPSCurrent 1 +#ISTTOK:vacuum:RPump1-Pressure.HIGH Search Issued +#ISTTOK:vacuum:RPump1-Pressure.HIHI Search Issued