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

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

@@ -0,0 +1,22 @@
Terminator = "";
LockTimeout = 500;
ReplyTimeout = 100;
ReadTimeout = 100;
WriteTimeout = 100;
MaxInput = 1;
ExtraInput = Error;
rReg {
out ${1};
in "%.1r";
}
## @init { rReg; }
##
wReg {
out ${1} "%.1r";
}
# @init { out ${1}; in "%.1r"; }

View File

@@ -0,0 +1,47 @@
Terminator = "";
LockTimeout = 500;
ReplyTimeout = 100;
ReadTimeout = 100;
WriteTimeout = 100;
MaxInput = 2;
ExtraInput = Error;
rReg {
out ${1};
in "%.1r";
}
# To read adc write control Byte
# Bits 0,1 ADC channel Selection
# Bits 2 : ADC auto increment =0
# Bits 3 : =0
# 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";
}
rConvAdc1 {
out ${1} 65;
in "%02r";
}
rConvAdc2 {
out ${1} 66;
in "%02r";
}
rConvAdc3 {
out ${1} 67;
in "%02r";
}
## @init { rReg; }
##
wReg {
out ${1} "%.1r";
}
wDac {
out ${1} 64 "%.1r";
}

View File

@@ -0,0 +1,40 @@
Terminator=CR;
MaxInput = 20;
# in millisecond
#ReadTimeout = 2000;
ReplyTimeout = 250;
# Using redirection to read 2 records, mantissa and exponent
getPressure001 {
out "0010074002=?106";
in "0011074006%4u%(\$1)2u%+<sum8>";
}
getPressure002 {
out "0020074002=?107";
in "0021074006%4u%(\$1)2u%+<sum8>";
}
getPressure003 {
out "0030074002=?108";
in "0031074006%4u%(\$1)2u%+<sum8>";
}
getPressure004 {
out "0040074002=?109";
in "0041074006%4u%(\$1)2u%+<sum8>";
}
#
# in "0031074006%4u%(\$1)2u%*3u";
#
#getPressureE003 {
# in "0031074006%*4u%2u%*3u";
#}
# Connect a stringout record to this to get
# a generic command interface.
# After processing finishes, the record contains the reply.
debug {
ExtraInput = Ignore;
out "%s"; in "%39c"
}

View File

@@ -0,0 +1,46 @@
# https://epics.anl.gov/tech-talk/2013/msg02051.php
Terminator = CR LF;
ExtraInput = Ignore;
ReplyTimeout = 1000;
@mismatch { out "QUIT"; disconnect; }
mail_start {
connect 10000;
in "220";
out "HELO ipfn.tecnico.ulisboa.pt";
in "250";
out "AUTH LOGIN";
in "334";
out "YmVybmFyZG8=";
in "334";
out "RjJjb21ldA==";
in "235";
out "MAIL FROM:\$1";
in "250";
out "RCPT TO:\$2";
in "250";
out "RCPT TO: halves@ipfn.tecnico.ulisboa.pt";
in "250";
out "DATA";
in "354";
out "From: \$1";
out "To: \$2";
out "Subject: Report from ISTTOK";
out "";
}
mail_end {
out ".";
in "250";
out "QUIT";
disconnect;
}
send {
mail_start;
out "Problem is: %s\n";
out "Please check: http://epics.ipfn.ist.utl.pt/isttok";
mail_end;
}

View File

@@ -0,0 +1,42 @@
Terminator = "";
LockTimeout = 500;
ReplyTimeout = 100;
ReadTimeout = 100;
WriteTimeout = 100;
MaxInput = 2;
ExtraInput = Error;
#I2C-bus format
# 0 1 0 0 A2 A1 A0 0 : I3 I2 I1 I0 SD SC SB SA : X X D5 D4 D3 D2 D1 D0
# A2 to A0 = programmable address bits; A = Acknowledge; I3 to I0 = Instruction bits;
# SD to SA = subaddress bits; X = dont care; D5 to D0 = data bits;
#instruction F will cause a consecutive writing of the data bytes into the
#same DAC-latch whose subaddress was given in the instruction byte.
#0xF0
wDac0 {
out ${1} 240 "%.1r";
}
wDac1 {
out ${1} 241 "%.1r";
}
wDac2 {
out ${1} 242 "%.1r";
}
wDac3 {
out ${1} 243 "%.1r";
}
wDac4 {
out ${1} 244 "%.1r";
}
wDac5 {
out ${1} 245 "%.1r";
}
wDac6 {
out ${1} 246 "%.1r";
}
wDac7 {
out ${1} 247 "%.1r";
}

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

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
@@ -52,14 +74,21 @@ ISTTOKrpi_LIBS += ISTTOKrpiSupport
# To build SNL programs, SNCSEQ must be defined
# in the <top>/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)