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

@@ -10,7 +10,7 @@
# ### macros: ID I2C address of ADC ### # # ### macros: ID I2C address of ADC ### #
# ### Description: ### # # ### Description: ### #
# ### This DB file is using ### # # ### This DB file is using ### #
# ### stream(asynI2C) to read/write ### # # ### stream(asynI2C) to read/write ### #
# ### an PCF8591 ADDA chip ### # # ### an PCF8591 ADDA chip ### #
####################################################### #######################################################
@@ -40,7 +40,7 @@ record( ai, "$(P)$(R)TMPump2-Speed" ) {
field(DESC, "TMPump2-Speed") field(DESC, "TMPump2-Speed")
field(DTYP, "Raw Soft Channel" ) field(DTYP, "Raw Soft Channel" )
field(INP, "$(P)$(R)PCF8591:72:BYTE2_CH1 PP NMS") field(INP, "$(P)$(R)PCF8591:72:BYTE2_CH1 PP NMS")
field(SCAN, "1 second") # field(SCAN, "1 second")
field(ASLO, "16" ) field(ASLO, "16" )
field(AOFF, "0" ) field(AOFF, "0" )
field(EGU, "RPM" ) field(EGU, "RPM" )
@@ -66,7 +66,7 @@ record( ai, "$(P)$(R)TMPump2-Current" ) {
field(DESC, "TMPump2-Current") field(DESC, "TMPump2-Current")
field(DTYP, "Raw Soft Channel" ) field(DTYP, "Raw Soft Channel" )
field(INP, "$(P)$(R)PCF8591:72:BYTE2_CH2 PP NMS") field(INP, "$(P)$(R)PCF8591:72:BYTE2_CH2 PP NMS")
field(SCAN, "1 second") # field(SCAN, "1 second")
field(ASLO, "0.1" ) field(ASLO, "0.1" )
field(AOFF, "0" ) field(AOFF, "0" )
field(EGU, "mA" ) field(EGU, "mA" )
@@ -93,7 +93,7 @@ record(ai, "$(P)$(R)Shot-TorPSCurrentImage" ) {
field(DESC, "Toroidal Current Image") field(DESC, "Toroidal Current Image")
field(DTYP, "Raw Soft Channel" ) field(DTYP, "Raw Soft Channel" )
field(INP, "$(P)$(R)PCF8591:72:BYTE2_CH3 PP NMS") field(INP, "$(P)$(R)PCF8591:72:BYTE2_CH3 PP NMS")
field(SCAN, ".2 second") # field(SCAN, ".2 second")
field(ASLO, "39.215686275" ) field(ASLO, "39.215686275" )
field(AOFF, "0.0" ) field(AOFF, "0.0" )
field(EGU, "A" ) field(EGU, "A" )

View File

@@ -7,7 +7,7 @@
# ### ### # # ### ### #
# ### Ref 2.0; 2019-10-14 ### # # ### Ref 2.0; 2019-10-14 ### #
# ### ### # # ### ### #
# ### macros: ID I2C address of ADC ### # # ### macros: ID I2C address of DAC ### #
# ### Description: ### # # ### Description: ### #
# ### This DB file is using ### # # ### This DB file is using ### #
# ### stream(asynI2C) to write ### # # ### stream(asynI2C) to write ### #

View File

@@ -11,6 +11,11 @@ DB += ISTTOKpcf8591.db
DB += ISTTOKpfeiffer.db DB += ISTTOKpfeiffer.db
DB += ISTTOKtda8444.db DB += ISTTOKtda8444.db
DB += sendmail.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 # If <anyname>.db template is not named <anyname>*.template add
# <anyname>_TEMPLATE = <templatename> # <anyname>_TEMPLATE = <templatename>

View File

@@ -5,7 +5,7 @@ ReadTimeout = 100;
WriteTimeout = 100; WriteTimeout = 100;
MaxInput = 2; MaxInput = 2;
ExtraInput = Error; ExtraInput = Error;
rReg { rReg {
out ${1}; out ${1};
in "%.1r"; in "%.1r";
@@ -17,7 +17,7 @@ rReg {
# Bits 4,5 ADC configuration . 00 = four single ended channels # Bits 4,5 ADC configuration . 00 = four single ended channels
# Bits 6 : DAC Output enable bit # Bits 6 : DAC Output enable bit
# Bits 7 : =0 # Bits 7 : =0
rConvAdc0 { rConvAdc0 {
out ${1} 64; out ${1} 64;
in "%02r"; in "%02r";
@@ -34,15 +34,14 @@ rConvAdc3 {
out ${1} 67; out ${1} 67;
in "%02r"; in "%02r";
} }
## @init { rReg; } ## @init { rReg; }
## ##
wReg { wReg {
out ${1} "%.1r"; out ${1} "%.1r";
} }
wDac { wDac {
out ${1} 64 "%.1r"; out ${1} 64 "%.1r";
} }

View File

@@ -11,12 +11,14 @@
* Copyright (c) : (IPFN-IST) * Copyright (c) : (IPFN-IST)
* *
* Created 5-Mar-2013 * Created 5-Mar-2013
* Revised 01-07-2019 * Revised 07-May-2021
* Modified 18-Nov-2019 * Modified 18-Nov-2019
* *
**/ **/
//%% #include "errlog.h"
program IsttokSeqExec program IsttokSeqExec
%{#include "errlog.h"}%
/* CONSTANT DECLARATION*/ /* CONSTANT DECLARATION*/
/*Relays and INPUT (Valleman Board) have negative Logic!*/ /*Relays and INPUT (Valleman Board) have negative Logic!*/
short PCF_RELAY_ON = 0; short PCF_RELAY_ON = 0;
@@ -166,18 +168,22 @@ monitor IsttokTMPump1_Emergency;
short IsttokTMPump1_ManualValve; short IsttokTMPump1_ManualValve;
assign IsttokTMPump1_ManualValve to "ISTTOK:central:TMPump1-ManualValve"; assign IsttokTMPump1_ManualValve to "ISTTOK:central:TMPump1-ManualValve";
monitor IsttokTMPump1_ManualValve; monitor IsttokTMPump1_ManualValve;
/*
short IsttokTMPump2_Emergency; short IsttokTMPump2_Emergency;
assign IsttokTMPump2_Emergency to "ISTTOK:central:TMPump2-Emergency"; assign IsttokTMPump2_Emergency to "ISTTOK:central:TMPump2-Emergency";
monitor IsttokTMPump2_Emergency; monitor IsttokTMPump2_Emergency;
*/
float IsttokRPump1_Pressure; float IsttokRPump1_Pressure;
assign IsttokRPump1_Pressure to "ISTTOK:central:RPump1-Pressure"; assign IsttokRPump1_Pressure to "ISTTOK:vacuum:RPump1-Pressure";
monitor IsttokRPump1_Pressure; monitor IsttokRPump1_Pressure;
/*
float IsttokRPump2_Pressure; float IsttokRPump2_Pressure;
assign IsttokRPump2_Pressure to "ISTTOK:central:RPump2-Pressure"; assign IsttokRPump2_Pressure to "ISTTOK:central:RPump2-Pressure";
monitor IsttokRPump2_Pressure; monitor IsttokRPump2_Pressure;
*/
float IsttokVVesselTemperature; float IsttokVVesselTemperature;
assign IsttokVVesselTemperature to "ISTTOK:temperature:VVessel-Temperature"; assign IsttokVVesselTemperature to "ISTTOK:temperature:VVessel-Temperature";
@@ -406,13 +412,14 @@ ss PulseSequence {
/* Pulse state change to Emergency*/ /* Pulse state change to Emergency*/
} state Emergency } state Emergency
when ( pvStatus(IsttokRPump1_Pressure) != pvStatOK || pvStatus(IsttokRPump2_Pressure) != pvStatOK || when ( pvStatus(IsttokRPump1_Pressure) != pvStatOK || pvStatus(IsttokTMPump1_Emergency) != pvStatOK ) {
pvStatus(IsttokTMPump1_Emergency) != pvStatOK || pvStatus(IsttokTMPump2_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 */ /* Vacuum emergency: Pulse state change to Stopping */
IsttokOPREQ = STOP; IsttokOPREQ = STOP;
pvPut(IsttokOPREQ); pvPut(IsttokOPREQ);
//strcpy(sendMail, "Vacuum Emergency while Process"); //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); pvPut(sendMail);
} state Stopping } state Stopping
@@ -453,8 +460,9 @@ ss PulseSequence {
when (IsttokOPREQ == STOP) {} state Stopping when (IsttokOPREQ == STOP) {} state Stopping
when ( pvStatus(IsttokTMPump1_Emergency) != pvStatOK || when ( pvStatus(IsttokTMPump1_Emergency) != pvStatOK) {
pvStatus(IsttokTMPump2_Emergency) != pvStatOK) { //when ( pvStatus(IsttokTMPump1_Emergency) != pvStatOK ||
// pvStatus(IsttokTMPump2_Emergency) != pvStatOK) {
/* Vacuum emergency: Pulse state change to Stopping */ /* Vacuum emergency: Pulse state change to Stopping */
IsttokOPREQ = STOP; IsttokOPREQ = STOP;
pvPut(IsttokOPREQ); pvPut(IsttokOPREQ);
@@ -497,8 +505,9 @@ ss PulseSequence {
/* Pulse state change to Stopping */ /* Pulse state change to Stopping */
} state Stopping } state Stopping
when ( pvStatus(IsttokTMPump1_Emergency) != pvStatOK || when ( pvStatus(IsttokTMPump1_Emergency) != pvStatOK) {
pvStatus(IsttokTMPump2_Emergency) != pvStatOK) { //when ( pvStatus(IsttokTMPump1_Emergency) != pvStatOK ||
// pvStatus(IsttokTMPump2_Emergency) != pvStatOK) {
/* Vacuum emergency: Pulse state change to Stopping */ /* Vacuum emergency: Pulse state change to Stopping */
IsttokOPREQ = STOP; IsttokOPREQ = STOP;
pvPut(IsttokOPREQ); pvPut(IsttokOPREQ);
@@ -677,7 +686,8 @@ ss StartingSequence {
STARTINGSTATE = STRST_NonStarting; STARTINGSTATE = STRST_NonStarting;
pvPut(STARTINGSTATE); pvPut(STARTINGSTATE);
} state NonStarting } 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" ); strcpy(msg, "TMP1 MotorOn ON" );
pvPut(msg); pvPut(msg);

View File

@@ -4,18 +4,38 @@ include $(TOP)/configure/CONFIG
#---------------------------------------- #----------------------------------------
# ADD MACRO DEFINITIONS BELOW HERE # 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 # Build an IOC support library
LIBRARY_IOC += ISTTOKrpiSupport 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, # Link locally-provided code into the support library,
# rather than directly into the IOC application. # rather than directly into the IOC application, that
# This is required for Windows DLL builds. # causes problems on Windows DLL builds
#ISTTOKrpiSupport_SRCS += dbSubExample.c
#ISTTOKrpiSupport_SRCS += devISTTOKrpiVersion.c
#ISTTOKrpiSupport_SRCS += ISTTOKrpiHello.c
ISTTOKrpiSupport_SRCS += initTrace.c ISTTOKrpiSupport_SRCS += initTrace.c
ISTTOKrpiSupport_LIBS += $(EPICS_BASE_IOC_LIBS) 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 # Build the IOC application
PROD_IOC = ISTTOKrpi PROD_IOC = ISTTOKrpi
@@ -27,6 +47,7 @@ ISTTOKrpi_DBD += base.dbd
ISTTOKrpi_DBD += initTrace.dbd ISTTOKrpi_DBD += initTrace.dbd
# Include dbd files from all support applications: # Include dbd files from all support applications:
ISTTOKrpi_DBD += asyn.dbd ISTTOKrpi_DBD += asyn.dbd
#ISTTOKrpi_DBD += calc.dbd
ISTTOKrpi_DBD += stream.dbd ISTTOKrpi_DBD += stream.dbd
ISTTOKrpi_DBD += drvAsynI2C.dbd ISTTOKrpi_DBD += drvAsynI2C.dbd
ISTTOKrpi_DBD += drvAsynSerialPort.dbd ISTTOKrpi_DBD += drvAsynSerialPort.dbd
@@ -35,6 +56,7 @@ ISTTOKrpi_DBD += asSupport.dbd
# Add all the support libraries needed by this IOC # Add all the support libraries needed by this IOC
ISTTOKrpi_LIBS += asyn ISTTOKrpi_LIBS += asyn
#ISTTOKrpi_LIBS += calc
ISTTOKrpi_LIBS += stream ISTTOKrpi_LIBS += stream
ISTTOKrpi_LIBS += drvAsynI2C ISTTOKrpi_LIBS += drvAsynI2C
ISTTOKrpi_LIBS += autosave ISTTOKrpi_LIBS += autosave
@@ -52,14 +74,21 @@ ISTTOKrpi_LIBS += ISTTOKrpiSupport
# To build SNL programs, SNCSEQ must be defined # To build SNL programs, SNCSEQ must be defined
# in the <top>/configure/RELEASE file # in the <top>/configure/RELEASE file
ifneq ($(SNCSEQ),) ifneq ($(SNCSEQ),)
# Build sncExample into ISTTOKrpiSupport , Safe Mode : +s # Build sncExample into ISTTOKrpiSupport , Safe Mode : +s
IsttokSeqExec_SNCFLAGS += +r +s IsttokSeqExec_SNCFLAGS += +r +s
ISTTOKrpi_DBD += IsttokSeqExec.dbd ISTTOKrpi_DBD += IsttokSeqExec.dbd
# A .stt sequence program is *not* pre-processed: # A .stt sequence program is *not* pre-processed:
ISTTOKrpiSupport_SRCS += IsttokSeqExec.stt ISTTOKrpiSupport_SRCS += IsttokSeqExec.stt
ISTTOKrpiSupport_LIBS += seq pv ISTTOKrpiSupport_LIBS += seq pv
ISTTOKrpi_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 endif
# Finally link IOC to the EPICS Base libraries # Finally link IOC to the EPICS Base libraries
@@ -69,3 +98,5 @@ include $(TOP)/configure/RULES
#---------------------------------------- #----------------------------------------
# ADD EXTRA GNUMAKE RULES BELOW HERE # 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 = ../.. TOP = ../..
include $(TOP)/configure/CONFIG include $(TOP)/configure/CONFIG
ARCH = $(EPICS_HOST_ARCH)
TARGETS = envPaths TARGETS = envPaths
include $(TOP)/configure/RULES.ioc include $(TOP)/configure/RULES.ioc

View File

@@ -1,9 +1,10 @@
epicsEnvSet("IOC","iocISTTOKrpi") epicsEnvSet("IOC","iocISTTOKrpi")
epicsEnvSet("TOP","/home/pi/ISTTOK/epics/iocs/ISTTOKrpi") epicsEnvSet("TOP","/home/pi/ISTTOK/epics/iocs/ISTTOKrpi")
epicsEnvSet("SUPPORT","/usr/local/epics/base/../synApps_5_8/support") epicsEnvSet("EPICS_BASE","/home/pi/Apps/epics7/epics-base")
epicsEnvSet("SNCSEQ","/usr/local/epics/base/../synApps_5_8/support/seq-2-2-1") epicsEnvSet("HOME","/home/pi")
epicsEnvSet("ASYN","/usr/local/epics/base/../synApps_5_8/support/asyn-4-26") epicsEnvSet("SUPPORT","/home/pi/Apps/epics7/support")
epicsEnvSet("STREAM","/usr/local/epics/base/../synApps_5_8/support/stream-2-6a") epicsEnvSet("ASYN","/home/pi/Apps/epics7/support/asyn")
epicsEnvSet("AUTOSAVE","/usr/local/epics/base/../synApps_5_8/support/autosave-5-6-1") epicsEnvSet("STREAM","/home/pi/Apps/epics7/support/StreamDevice")
epicsEnvSet("DRVASYNI2C","/usr/local/epics/base/../modules/drvAsynI2C") epicsEnvSet("AUTOSAVE","/home/pi/Apps/epics7/support/autosave")
epicsEnvSet("EPICS_BASE","/usr/local/epics/base") 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 ISTTOK:central:Shot-TorPSCurrent
#ALARM Limits #ALARM Limits
ISTTOK:central:RPump1-Pressure.HIGH ISTTOK:vacuum:RPump1-Pressure.HIGH
ISTTOK:central:RPump1-Pressure.HIHI ISTTOK:vacuum:RPump1-Pressure.HIHI
ISTTOK:central:RPump2-Pressure.HIGH #ISTTOK:central:RPump2-Pressure.HIGH
ISTTOK:central:RPump2-Pressure.HIHI #ISTTOK:central:RPump2-Pressure.HIHI

View File

@@ -1,15 +1,14 @@
# autosave R5.3 Automatically generated - DO NOT MODIFY - 200127-094325 # autosave R5.3 Automatically generated - DO NOT MODIFY - 210510-201940
ISTTOK:central:PULSE-NUMBER.VAL 48422 ! 2 channel(s) not connected - or not all gets were successful
ISTTOK:central:LogMessage.VAL Emplastro esteve aqui ISTTOK:central:PULSE-NUMBER.VAL 0
ISTTOK:central:LASTOPSTATE.VAL 5 ISTTOK:central:LogMessage.VAL
ISTTOK:central:OPREQ 1 ISTTOK:central:LASTOPSTATE.VAL 0
ISTTOK:central:OPREQ 0
ISTTOK:central:PROCESS-MODE.VAL 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:Emergency-UserButton.VAL 0
ISTTOK:central:TMPump1-ManualValve.VAL 1 ISTTOK:central:TMPump1-ManualValve.VAL 0
ISTTOK:central:Shot-TorPSCurrent 34 ISTTOK:central:Shot-TorPSCurrent 1
ISTTOK:central:RPump1-Pressure.HIGH 0 #ISTTOK:vacuum:RPump1-Pressure.HIGH Search Issued
ISTTOK:central:RPump1-Pressure.HIHI 0 #ISTTOK:vacuum:RPump1-Pressure.HIHI Search Issued
ISTTOK:central:RPump2-Pressure.HIGH 0
ISTTOK:central:RPump2-Pressure.HIHI 0
<END> <END>