added RPi2 IOC
This commit is contained in:
@@ -17,12 +17,12 @@ All software stored in IPFN GIT [server](https://git.ipfn.tecnico.ulisboa.pt/sum
|
||||
- **Humberto Figueiredo** (ISTTOK Session Leader)
|
||||
- **Hugo Alves** (ISTTOK Session Leader, State Machine development)
|
||||
- **Tiago Pereira** (dsPIC development, RS232 protocol/ Sensor Interface/ Wiring)
|
||||
- **Paulo F. Carvalho** ( Epics Applications), CS-S Gui Panels)
|
||||
|
||||
## System description
|
||||
Presently there are two instances of EPICS IOC Server implemented.
|
||||
Presently there are two/three instances of EPICS IOC Server implemented.
|
||||
One responsible for the Temperature Node.
|
||||
And a second one, installed in a Raspberry Pi, implemented in the new control unit launched at ISTTOK for the remote control of the vacuum pumps, named Central Node.
|
||||
A third one is dedicated for readind the Vacuum Sensore through the RS484 Interface
|
||||
|
||||
### Temperature/Vacuum Node: Temperature Sensors and ELCO Voltage Measurement Systems
|
||||
- Thermocouple Sensor
|
||||
@@ -227,22 +227,45 @@ Process Variables in this IOC Server:
|
||||
| ISTTOK:central:Shot-TorPSCurrentImage"| ai | ch3 | no |
|
||||
----------
|
||||
|
||||
* Connected to RS485 Bus (Not yet)
|
||||
|
||||
|PV Name |PV Type |Archive|
|
||||
|:----------|-------|---:|
|
||||
|ISTTOK:central:RPump1-Pressure | ai | yes |
|
||||
|ISTTOK:central:RPump2-Pressure | ai | yes |
|
||||
|ISTTOK:central:TMPump1-PressureAdmission | ai | yes |
|
||||
|ISTTOK:central:VVessel-Pressure | ai | yes |
|
||||
----------
|
||||
|
||||
|
||||
### Central Control/Vacuum Node
|
||||
- Vacuum Pfeiffer Sensors (RS485)
|
||||
|
||||
#### Hardware Platform
|
||||
1. A Raspberry Pi 3, running a linux distribution..
|
||||
* Has a USB/RS485 port for monitoring pressure
|
||||
|
||||
#### Process Variables
|
||||
Process Variables in this IOC Server:
|
||||
|
||||
* Connected to RS485 Bus
|
||||
|
||||
|PV Name |PV Type |Archive|
|
||||
|:----------|-------|---:|
|
||||
| ISTTOK:central:RPump1-Pressure | ai | yes |
|
||||
|ISTTOK:central:RPump2-Pressure | ai | yes |
|
||||
|ISTTOK:central:TMPump1-PressureAdmission | ai | yes |
|
||||
ISTTOK:central:VVessel-Pressure | ai | yes
|
||||
| ISTTOK:vacuum:RPump1-Pressure | ai | yes |
|
||||
|ISTTOK:vacuum:RPump2-Pressure | ai | yes |
|
||||
|ISTTOK:vacuum:TMPump1-PressureAdmission | ai | yes |
|
||||
|ISTTOK:vacuum:VVessel-Pressure | ai | yes |
|
||||
----------
|
||||
|
||||
#### Software Platform
|
||||
[//]: # (This may be the most platform independent comment)
|
||||
|
||||
##### Start the IOC on power up
|
||||
1. Make sure `screen` is installed in Linux
|
||||
2. Include following Line in /etc/rc.local
|
||||
* `screen -dm bash -c "cd [..]/ISTTOKrpi/iocBoot/iocISTTOKrpi; ../../bin/linux-arm/ISTTOKrpi st.cmd"`
|
||||
3. To access EPICS console run
|
||||
* `sudo screen -r`
|
||||
1. Linux Raspian "buster" (user :pi):
|
||||
* IP addr: 192.168.1.120 ( ISTTOK private network)
|
||||
* NTP/timedatectl time conected to IPFN Gps NTP/PPS server IP:10.136.227.237 193.136.136.129
|
||||
(this is mandatory, Rpi does not have a Real Time clock see https://www.raspberrypi.org/forums/viewtopic.php?t=178763)
|
||||
* EPICS 7. To install follow [EPICS Docs](https://docs.epics-controls.org/projects/how-tos/en/latest/getting-started/installation.html)
|
||||
|
||||
|
||||
## Download and configure CS-Studio
|
||||
@@ -266,7 +289,7 @@ ISTTOK:central:VVessel-Pressure | ai | yes
|
||||
|
||||
### EPICS Channel Access Configuration
|
||||
```
|
||||
export EPICS_CA_ADDR_LIST="192.168.1.110 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"
|
||||
```
|
||||
|
||||
|
||||
115
epics/iocs/ISTTOKrpi2/ISTTOKrpi2App/Db/ISTTOKpfeiffer.db
Normal file
115
epics/iocs/ISTTOKrpi2/ISTTOKrpi2App/Db/ISTTOKpfeiffer.db
Normal file
@@ -0,0 +1,115 @@
|
||||
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, "1 second")
|
||||
field (FLNK, "$(P)$(R)VVessel-Pressure")
|
||||
}
|
||||
record (longin, "$(P)$(R)P001:E")
|
||||
{
|
||||
field (DESC, "Pressure001 exponent $(bus)")
|
||||
}
|
||||
record (calc, "$(P)$(R)VVessel-Pressure")
|
||||
{
|
||||
field (DESC, "ISTTOK:central:VVessel-Pressure")
|
||||
field(INPA, "$(P)$(R)P001:M")
|
||||
field(INPB, "$(P)$(R)P001:E")
|
||||
field(CALC, "(A*0.001)*10.0**(B-20)")
|
||||
field(PREC, "3")
|
||||
field(EGU, "mBar")
|
||||
}
|
||||
|
||||
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 (FLNK, "$(P)$(R)RPump1-Pressure")
|
||||
}
|
||||
record (longin, "$(P)$(R)P002:E")
|
||||
{
|
||||
field (DESC, "Pressure002 exponent $(bus)")
|
||||
}
|
||||
record (calc, "$(P)$(R)RPump1-Pressure")
|
||||
{
|
||||
field (DESC, "ISTTOK:central:RPump1-Pressure")
|
||||
field(INPA, "$(P)$(R)P002:M")
|
||||
field(INPB, "$(P)$(R)P002:E")
|
||||
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(LOW, "20.0")
|
||||
# field(LOLO,"0.0")
|
||||
field(HHSV,"MAJOR")
|
||||
field(HSV, "MINOR")
|
||||
# field(LSV, "MINOR")
|
||||
# field(LLSV,"MAJOR")
|
||||
}
|
||||
|
||||
record (longin, "$(P)$(R)P003:M")
|
||||
{
|
||||
field (DESC, "getPressure003 Mantissa $(bus)")
|
||||
field (DTYP, "stream")
|
||||
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")
|
||||
}
|
||||
|
||||
record (longin, "$(P)$(R)P003:E")
|
||||
{
|
||||
field (DESC, "Pressure003 Exponent $(bus)")
|
||||
}
|
||||
record (calc, "$(P)$(R)TMPump1-PressureAdmission")
|
||||
{
|
||||
field(DESC, "ISTTOK:central:TMPump1-PressureAdmission")
|
||||
field(INPA, "$(P)$(R)P003:M")
|
||||
field(INPB, "$(P)$(R)P003:E")
|
||||
field(CALC, "(A*0.001)* 10.0**(B-20)")
|
||||
field(PREC, "3")
|
||||
field(EGU, "mBar")
|
||||
}
|
||||
|
||||
|
||||
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 (FLNK, "$(P)$(R)RPump2-Pressure")
|
||||
}
|
||||
record (longin, "$(P)$(R)P004:E")
|
||||
{
|
||||
field (DESC, "Pressure004 Exponent $(bus)")
|
||||
}
|
||||
|
||||
record (calc, "$(P)$(R)RPump2-Pressure")
|
||||
{
|
||||
field(DESC, "ISTTOK:central:RPump2-Pressure")
|
||||
field(INPA, "$(P)$(R)P004:M")
|
||||
field(INPB, "$(P)$(R)P004:E")
|
||||
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(LOW, "20.0")
|
||||
# field(LOLO,"0.0")
|
||||
field(HHSV,"MAJOR")
|
||||
field(HSV, "MINOR")
|
||||
# field(LSV, "MINOR")
|
||||
# field(LLSV,"MAJOR")
|
||||
}
|
||||
|
||||
record(stringout,"$(P)$(R)RS485Debug") {
|
||||
field(DESC, "")
|
||||
field(DTYP, "stream")
|
||||
field(OUT, "@pfeiffer.proto debug $(bus)")
|
||||
field(VAL,"")
|
||||
}
|
||||
|
||||
19
epics/iocs/ISTTOKrpi2/ISTTOKrpi2App/Db/Makefile
Normal file
19
epics/iocs/ISTTOKrpi2/ISTTOKrpi2App/Db/Makefile
Normal file
@@ -0,0 +1,19 @@
|
||||
TOP=../..
|
||||
include $(TOP)/configure/CONFIG
|
||||
#----------------------------------------
|
||||
# ADD MACRO DEFINITIONS AFTER THIS LINE
|
||||
|
||||
#----------------------------------------------------
|
||||
# Create and install (or just install) into <top>/db
|
||||
# databases, templates, substitutions like this
|
||||
DB += ISTTOKpfeiffer.db
|
||||
DB += pfeiffer.proto
|
||||
|
||||
#----------------------------------------------------
|
||||
# If <anyname>.db template is not named <anyname>*.template add
|
||||
# <anyname>_template = <templatename>
|
||||
|
||||
include $(TOP)/configure/RULES
|
||||
#----------------------------------------
|
||||
# ADD RULES AFTER THIS LINE
|
||||
|
||||
40
epics/iocs/ISTTOKrpi2/ISTTOKrpi2App/Db/pfeiffer.proto
Normal file
40
epics/iocs/ISTTOKrpi2/ISTTOKrpi2App/Db/pfeiffer.proto
Normal 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"
|
||||
}
|
||||
|
||||
46
epics/iocs/ISTTOKrpi2/ISTTOKrpi2App/src/Makefile
Normal file
46
epics/iocs/ISTTOKrpi2/ISTTOKrpi2App/src/Makefile
Normal file
@@ -0,0 +1,46 @@
|
||||
TOP=../..
|
||||
|
||||
include $(TOP)/configure/CONFIG
|
||||
#----------------------------------------
|
||||
# ADD MACRO DEFINITIONS AFTER THIS LINE
|
||||
#=============================
|
||||
|
||||
#=============================
|
||||
# Build the IOC application
|
||||
|
||||
PROD_IOC = ISTTOKrpi2
|
||||
# ISTTOKrpi2.dbd will be created and installed
|
||||
DBD += ISTTOKrpi2.dbd
|
||||
|
||||
# ISTTOKrpi2.dbd will be made up from these files:
|
||||
ISTTOKrpi2_DBD += base.dbd
|
||||
|
||||
# Include dbd files from all support applications:
|
||||
#ISTTOKrpi2_DBD += xxx.dbd
|
||||
ISTTOKrpi2_DBD += asyn.dbd
|
||||
ISTTOKrpi2_DBD += stream.dbd
|
||||
ISTTOKrpi2_DBD += drvAsynSerialPort.dbd
|
||||
|
||||
# Add all the support libraries needed by this IOC
|
||||
ISTTOKrpi2_LIBS += asyn
|
||||
ISTTOKrpi2_LIBS += stream
|
||||
|
||||
# ISTTOKrpi2_registerRecordDeviceDriver.cpp derives from ISTTOKrpi2.dbd
|
||||
ISTTOKrpi2_SRCS += ISTTOKrpi2_registerRecordDeviceDriver.cpp
|
||||
|
||||
# Build the main IOC entry point on workstation OSs.
|
||||
ISTTOKrpi2_SRCS_DEFAULT += ISTTOKrpi2Main.cpp
|
||||
ISTTOKrpi2_SRCS_vxWorks += -nil-
|
||||
|
||||
# Add support from base/src/vxWorks if needed
|
||||
#ISTTOKrpi2_OBJS_vxWorks += $(EPICS_BASE_BIN)/vxComLibrary
|
||||
|
||||
# Finally link to the EPICS Base libraries
|
||||
ISTTOKrpi2_LIBS += $(EPICS_BASE_IOC_LIBS)
|
||||
|
||||
#===========================
|
||||
|
||||
include $(TOP)/configure/RULES
|
||||
#----------------------------------------
|
||||
# ADD RULES AFTER THIS LINE
|
||||
|
||||
34
epics/iocs/ISTTOKrpi2/iocBoot/iocISTTOKrpi2/st.cmd
Executable file
34
epics/iocs/ISTTOKrpi2/iocBoot/iocISTTOKrpi2/st.cmd
Executable file
@@ -0,0 +1,34 @@
|
||||
#!../../bin/linux-arm/ISTTOKrpi2
|
||||
|
||||
#- You may have to change ISTTOKrpi2 to something else
|
||||
#- everywhere it appears in this file
|
||||
|
||||
< envPaths
|
||||
epicsEnvSet( "STREAM_PROTOCOL_PATH", "$(TOP)/db" )
|
||||
|
||||
cd "${TOP}"
|
||||
|
||||
## Register all support components
|
||||
dbLoadDatabase "dbd/ISTTOKrpi2.dbd"
|
||||
ISTTOKrpi2_registerRecordDeviceDriver pdbbase
|
||||
|
||||
## Load record instances
|
||||
#dbLoadRecords("db/xxx.db","user=pi")
|
||||
## 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")
|
||||
|
||||
dbLoadRecords("db/ISTTOKpfeiffer.db","P=ISTTOK:,R=vacuum:,bus=RS0")
|
||||
|
||||
cd "${TOP}/iocBoot/${IOC}"
|
||||
iocInit
|
||||
|
||||
## Start any sequence programs
|
||||
#seq sncxxx,"user=pi"
|
||||
19
epics/iocs/RELEASE.local
Normal file
19
epics/iocs/RELEASE.local
Normal file
@@ -0,0 +1,19 @@
|
||||
#RELEASE Location of external products
|
||||
HOME=/home/pi
|
||||
SUPPORT=$(HOME)/Apps/epics7/support
|
||||
#
|
||||
#
|
||||
ASYN=$(SUPPORT)/asyn
|
||||
STREAM=$(SUPPORT)/StreamDevice
|
||||
# IPAC release V2-7 or later is required.
|
||||
IPAC=
|
||||
#$(SUPPORT)/ipac-2-15
|
||||
#
|
||||
# # SEQ is required for testIPServer
|
||||
SNCSEQ=
|
||||
#$(SUPPORT)/seq-2-2-5
|
||||
#
|
||||
CALC=
|
||||
PCRE=
|
||||
#
|
||||
EPICS_BASE=$(HOME)/Apps/epics7/epics-base
|
||||
Reference in New Issue
Block a user