changed to epics 7

This commit is contained in:
Bernardo Carvalho
2021-05-10 20:33:35 +01:00
parent c25f1139bf
commit 807a1ff0e5
14 changed files with 95 additions and 49 deletions

View File

@@ -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" )

View File

@@ -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 ### #

View File

@@ -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 <anyname>.db template is not named <anyname>*.template add
# <anyname>_TEMPLATE = <templatename>

View File

@@ -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;
@@ -167,17 +169,21 @@ 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);

View File

@@ -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 <top>/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
@@ -59,7 +81,14 @@ ifneq ($(SNCSEQ),)
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)

View File

@@ -1,4 +1,5 @@
TOP = ../..
include $(TOP)/configure/CONFIG
ARCH = $(EPICS_HOST_ARCH)
TARGETS = envPaths
include $(TOP)/configure/RULES.ioc

View File

@@ -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")

View File

@@ -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

View File

@@ -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
<END>