This commit is contained in:
Sakbe
2021-11-29 17:39:21 +00:00
41 changed files with 1116 additions and 583 deletions

View File

@@ -17,12 +17,12 @@ All software stored in IPFN GIT [server](https://git.ipfn.tecnico.ulisboa.pt/sum
- **Humberto Figueiredo** (ISTTOK Session Leader) - **Humberto Figueiredo** (ISTTOK Session Leader)
- **Hugo Alves** (ISTTOK Session Leader, State Machine development) - **Hugo Alves** (ISTTOK Session Leader, State Machine development)
- **Tiago Pereira** (dsPIC development, RS232 protocol/ Sensor Interface/ Wiring) - **Tiago Pereira** (dsPIC development, RS232 protocol/ Sensor Interface/ Wiring)
- **Paulo F. Carvalho** ( Epics Applications), CS-S Gui Panels)
## System description ## 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. 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. 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 ### Temperature/Vacuum Node: Temperature Sensors and ELCO Voltage Measurement Systems
- Thermocouple Sensor - Thermocouple Sensor
@@ -227,22 +227,45 @@ Process Variables in this IOC Server:
| ISTTOK:central:Shot-TorPSCurrentImage"| ai | ch3 | no | | 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 |
----------
### Vacuum Node (temporary)
- Vacuum Pfeiffer Sensors (RS485)
#### Hardware Platform
1. A Raspberry Pi 3, running a linux distribution..
* Has a USB/RS485 port for monitoring pressure sensors
#### Process Variables
Process Variables in this IOC Server:
* Connected to RS485 Bus * Connected to RS485 Bus
|PV Name |PV Type |Archive| |PV Name |PV Type |Archive|
|:----------|-------|---:| |:----------|-------|---:|
| ISTTOK:central:RPump1-Pressure | ai | yes | | ISTTOK:vacuum:RPump1-Pressure | ai | yes |
|ISTTOK:central:RPump2-Pressure | ai | yes | |ISTTOK:vacuum:RPump2-Pressure | ai | yes |
|ISTTOK:central:TMPump1-PressureAdmission | ai | yes | |ISTTOK:vacuum:TMPump1-PressureAdmission | ai | yes |
ISTTOK:central:VVessel-Pressure | 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. Linux Raspian "buster" (user :pi):
1. Make sure `screen` is installed in Linux * IP addr: 192.168.1.120 ( ISTTOK private network)
2. Include following Line in /etc/rc.local * NTP/timedatectl time conected to IPFN Gps NTP/PPS server IP:10.136.227.237 193.136.136.129
* `screen -dm bash -c "cd [..]/ISTTOKrpi/iocBoot/iocISTTOKrpi; ../../bin/linux-arm/ISTTOKrpi st.cmd"` (this is mandatory, Rpi does not have a Real Time clock see https://www.raspberrypi.org/forums/viewtopic.php?t=178763)
3. To access EPICS console run * EPICS 7. To install follow [EPICS Docs](https://docs.epics-controls.org/projects/how-tos/en/latest/getting-started/installation.html)
* `sudo screen -r`
## Download and configure CS-Studio ## Download and configure CS-Studio
@@ -266,7 +289,7 @@ ISTTOK:central:VVessel-Pressure | ai | yes
### EPICS Channel Access Configuration ### 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" export EPICS_CA_AUTO_ADDR_LIST="NO"
``` ```

View File

@@ -1,8 +1,8 @@
############################################# #############################################
## Project : ISTTOK slow Control ## Project : ISTTOK slow Control
## ##
## File : ## File :
## Description : Records for ISTTOK Control I/O channels connected to 2 Velleman board ## Description : Records for ISTTOK Control I/O channels connected to 2 Velleman board
## ##
## ##
## Author : Bernardo Carvalho (IPFN-IST) ## Author : Bernardo Carvalho (IPFN-IST)
@@ -23,108 +23,103 @@
### 24V commands - Optocoupler Out### ### 24V commands - Optocoupler Out###
##################################### #####################################
record(bo, "$(P)$(R)TMPump1-ControllerOn" ) { record(bo, "$(P)$(R)TMPump1-ControllerOn" ) {
# field(DESC,"Sinal p/ TMP 1, Liga a alimentação do controlador, vai a HIGH e depois a LOW") field(DESC,"Signal to TMP 1, goes HIGH and LW")
# field( ZNAM, "Off" )record(bo, "$(P)$(R)TMPControllerOn" ) { field(ZNAM, "Off" )
field(ZNAM, "Off" ) field(ONAM, "Pulse" )
field(ONAM, "Pulse" ) field(HIGH, "2.5")
field(HIGH, "2.5") field(FLNK, "$(P)$(R)TMPump1-ControllerOnInv" )
field(FLNK, "$(P)$(R)TMPump1-ControllerOnInv" ) field(VAL,"0")
field(VAL,"0")
# field( FLNK, "$(P)$(R)TMPControllerOnInv" )
} }
record(calcout, "$(P)$(R)TMPump1-ControllerOnInv" ) { record(calcout, "$(P)$(R)TMPump1-ControllerOnInv") {
#record(calcout, "$(P)$(R)TMPControllerOnInv" ) { field(INPA, "$(P)$(R)TMPump1-ControllerOn NPP MS")
field( INPA, "$(P)$(R)TMPControllerOn NPP MS" ) field(OUT, "$(P)$(R)PCF8574:56:REGISTER.B0 PP MS")
field( OUT, "$(P)$(R)PCF8574:56:REGISTER.B0 PP MS" ) field(OOPT, "On Change")
field( OOPT, "On Change" ) field(CALC, "A?0:1")
field( CALC, "A?0:1" )
} }
record(bo, "$(P)$(R)TMPump1-ControllerOff" ) { record(bo, "$(P)$(R)TMPump1-ControllerOff" ) {
# field(DESC," Sinal p/ TMP 1, desliga a alimentação do controlador, LOW->HIGH-> LOW") # field(DESC," Sinal p/ TMP 1, desliga a alimentação do controlador, LOW->HIGH-> LOW")
# record(bo, "$(P)$(R)TMPControllerOff" ) { # record(bo, "$(P)$(R)TMPControllerOff" ) {
field(ZNAM, "Off" ) field(ZNAM, "Off" )
field(ONAM, "Pulse" ) field(ONAM, "Pulse" )
field(HIGH, "2.5") field(HIGH, "2.5")
#field( FLNK, "$(P)$(R)TMPControllerOffInv" ) field(FLNK, "$(P)$(R)TMPump1-ControllerOffInv" )
field(FLNK, "$(P)$(R)TMPump1-ControllerOffInv" ) field(VAL,"0")
field(VAL,"0")
} }
record(calcout, "$(P)$(R)TMPump1-ControllerOffInv") { record(calcout, "$(P)$(R)TMPump1-ControllerOffInv") {
field( INPA, "$(P)$(R)TMPump1-ControllerOff NPP MS" ) field(INPA, "$(P)$(R)TMPump1-ControllerOff NPP MS" )
field( OUT, "$(P)$(R)PCF8574:56:REGISTER.B1 PP MS") field(OUT, "$(P)$(R)PCF8574:56:REGISTER.B1 PP MS")
field( OOPT, "On Change" ) field(OOPT, "On Change")
field( CALC, "A?0:1" ) field(CALC, "A?0:1")
} }
record(bo, "$(P)$(R)TMPump1-MotorOn" ) { record(bo, "$(P)$(R)TMPump1-MotorOn" ) {
field( ZNAM, "Off") field( ZNAM, "Off")
field( ONAM, "Pulse") field( ONAM, "Pulse")
field( HIGH, "2.5") field( HIGH, "2.5")
field( FLNK, "$(P)$(R)TMPump1-MotorOnInv") field( FLNK, "$(P)$(R)TMPump1-MotorOnInv")
} }
record(calcout, "$(P)$(R)TMPump1-MotorOnInv" ) { record(calcout, "$(P)$(R)TMPump1-MotorOnInv" ) {
field( INPA, "$(P)$(R)TMPump1-MotorOn NPP MS") field( INPA, "$(P)$(R)TMPump1-MotorOn NPP MS")
field( OUT, "$(P)$(R)PCF8574:56:REGISTER.B2 PP MS") field( OUT, "$(P)$(R)PCF8574:56:REGISTER.B2 PP MS")
field( OOPT, "On Change") field( OOPT, "On Change")
field( CALC, "A?0:1" ) field( CALC, "A?0:1" )
} }
record(bo, "$(P)$(R)TMPump1-MotorOff") { record(bo, "$(P)$(R)TMPump1-MotorOff") {
field( ZNAM, "Off") field( ZNAM, "Off")
field( ONAM, "Pulse") field( ONAM, "Pulse")
field( HIGH, "2.5") field( HIGH, "2.5")
field( FLNK, "$(P)$(R)TMPump1-MotorOffInv") field( FLNK, "$(P)$(R)TMPump1-MotorOffInv")
field(VAL,"0") field(VAL,"0")
} }
record(calcout, "$(P)$(R)TMPump1-MotorOffInv") { record(calcout, "$(P)$(R)TMPump1-MotorOffInv") {
field( INPA, "$(P)$(R)TMPump1-MotorOff NPP MS") field( INPA, "$(P)$(R)TMPump1-MotorOff NPP MS")
field( OUT, "$(P)$(R)PCF8574:56:REGISTER.B3 PP MS") field( OUT, "$(P)$(R)PCF8574:56:REGISTER.B3 PP MS")
field( OOPT, "On Change") field( OOPT, "On Change")
field( CALC, "A?0:1") field( CALC, "A?0:1")
} }
############################# #############################
### TMP1 Controller inputs### ### TMP1 Controller inputs###
############################# #############################
record(fanout, "$(P)$(R)PCF8574:56:REGISTER:READ:FNOUT"){ record(fanout, "$(P)$(R)PCF8574:56:REGISTER:READ:FNOUT"){
field(LNK1, "$(P)$(R)TMPump1-Power") field(LNK1, "$(P)$(R)TMPump1-Power")
field(LNK2, "$(P)$(R)TMPump1-Emergency") field(LNK2, "$(P)$(R)TMPump1-Emergency")
field(LNK3, "$(P)$(R)TMPump1-Acceleration") field(LNK3, "$(P)$(R)TMPump1-Acceleration")
field(LNK4, "$(P)$(R)TMPump1-NormalOperation") field(LNK4, "$(P)$(R)TMPump1-NormalOperation")
} }
record(bi , "$(P)$(R)TMPump1-Power" ) { record(bi , "$(P)$(R)TMPump1-Power" ) {
field(DESC," TMP1 Alimentada 220V ") field(DESC," TMP1 Alimentada 220V ")
field( INP, "$(P)$(R)PCF8574:56:REGISTER:READ.B4 NPP NMS") field( INP, "$(P)$(R)PCF8574:56:REGISTER:READ.B4 NPP NMS")
field( ZNAM, "ON" ) field( ZNAM, "ON" )
field( ONAM, "OFF" ) field( ONAM, "OFF" )
} }
record(bi , "$(P)$(R)TMPump1-Emergency") { record(bi , "$(P)$(R)TMPump1-Emergency") {
field(DESC," TMP1 Falha ") field(DESC," TMP1 Falha ")
field( INP, "$(P)$(R)PCF8574:56:REGISTER:READ.B6 NPP NMS") field( INP, "$(P)$(R)PCF8574:56:REGISTER:READ.B6 NPP NMS")
# field(VAL,"1") # field(VAL,"1")
field( ZNAM, "ON" ) field( ZNAM, "ON" )
field( ONAM, "OFF" ) field( ONAM, "OFF" )
field(ZSV,"MAJOR") field(ZSV,"MAJOR")
} }
record(bi , "$(P)$(R)TMPump1-Acceleration") { record(bi , "$(P)$(R)TMPump1-Acceleration") {
field(DESC," TMP1 Motor em aceleração ") field(DESC," TMP1 Motor em aceleração ")
field( INP, "$(P)$(R)PCF8574:56:REGISTER:READ.B5 NPP NMS") field( INP, "$(P)$(R)PCF8574:56:REGISTER:READ.B5 NPP NMS")
field( ZNAM, "ON" ) field( ZNAM, "ON" )
field( ONAM, "OFF" ) field( ONAM, "OFF" )
field(ZSV,"MINOR") field(ZSV,"MINOR")
} }
record(bi , "$(P)$(R)TMPump1-NormalOperation" ) { record(bi , "$(P)$(R)TMPump1-NormalOperation" ) {
field(DESC," TMP1 Operação Normal ") field(DESC," TMP1 Operação Normal ")
field( INP, "$(P)$(R)PCF8574:56:REGISTER:READ.B7 NPP NMS") field( INP, "$(P)$(R)PCF8574:56:REGISTER:READ.B7 NPP NMS")
field( ZNAM, "ON" ) field( ZNAM, "ON" )
field(ONAM, "OFF" ) field(ONAM, "OFF" )
field(OSV,"MINOR") field(OSV,"MINOR")
} }
############### ###############
@@ -137,87 +132,87 @@ record(bi , "$(P)$(R)TMPump1-NormalOperation" ) {
### TMP2 Controller Inputs ### ### TMP2 Controller Inputs ###
############################## ##############################
record(fanout, "$(P)$(R)PCF8574:57:REGISTER:READ:FNOUT"){ record(fanout, "$(P)$(R)PCF8574:57:REGISTER:READ:FNOUT"){
field(LNK1, "$(P)$(R)TMPump2-Emergency") field(LNK1, "$(P)$(R)TMPump2-Emergency")
field(LNK2, "$(P)$(R)TMPump2-Acceleration") field(LNK2, "$(P)$(R)TMPump2-Acceleration")
field(LNK3, "$(P)$(R)TTSystem-tzero") field(LNK3, "$(P)$(R)TTSystem-tzero")
field(LNK4, "$(P)$(R)Emergency-PhysButton") field(LNK4, "$(P)$(R)Emergency-PhysButton")
} }
record(bi , "$(P)$(R)TMPump2-Emergency") { record(bi , "$(P)$(R)TMPump2-Emergency") {
field(DESC," TMP2 Falha ") field(DESC," TMP2 Falha ")
# field(INP, "$(P)$(R)PCF8574:57:REGISTER:READ.B0 NPP NMS") # field(INP, "$(P)$(R)PCF8574:57:REGISTER:READ.B0 NPP NMS")
field(VAL,"1") field(VAL,"1")
field(ZNAM, "ON" ) field(ZNAM, "ON" )
field(ONAM, "OFF" ) field(ONAM, "OFF" )
field(ZSV,"MAJOR") field(ZSV,"MAJOR")
} }
record(bi , "$(P)$(R)TMPump2-Acceleration") { record(bi , "$(P)$(R)TMPump2-Acceleration") {
field(DESC," TMP2 START until Normal ") field(DESC," TMP2 START until Normal ")
field( INP, "$(P)$(R)PCF8574:57:REGISTER:READ.B1 NPP NMS") field( INP, "$(P)$(R)PCF8574:57:REGISTER:READ.B1 NPP NMS")
field( ZNAM, "ON" ) field( ZNAM, "ON" )
field( ONAM, "OFF" ) field( ONAM, "OFF" )
} }
#################################### ####################################
# TIMING TRIGGER ON/OFF # # TIMING TRIGGER ON/OFF #
#################################### ####################################
record(bi , "$(P)$(R)TTSystem-tzero" ) { record(bi , "$(P)$(R)TTSystem-tzero" ) {
field(DESC,"Trigger control 60s before shot") field(DESC,"Trigger control 60s before shot")
field(INP, "$(P)$(R)PCF8574:57:REGISTER:READ.B7") field(INP, "$(P)$(R)PCF8574:57:REGISTER:READ.B7")
# field(VAL,"1") # field(VAL,"1")
field(ZNAM, "OFF" ) field(ZNAM, "OFF" )
field(ONAM, "ON" ) field(ONAM, "ON" )
} }
############################### ###############################
### TMP2 Controller Outputs ### ### TMP2 Controller Outputs ###
############################### ###############################
record(bo, "$(P)$(R)TMPump2-Motor" ) { record(bo, "$(P)$(R)TMPump2-Motor" ) {
field(DESC," Motor On/Off ") field(DESC," Motor On/Off ")
# record(bo, "$(P)$(R)TMP2MotorOnOff" ) { # record(bo, "$(P)$(R)TMP2MotorOnOff" ) {
field( OUT, "$(P)$(R)PCF8574:57:REGISTER.B2 PP MS") field( OUT, "$(P)$(R)PCF8574:57:REGISTER.B2 PP MS")
field( ZNAM, "ON") field( ZNAM, "ON")
field( ONAM, "OFF") field( ONAM, "OFF")
} }
############################## ##############################
# BUZZER ON/OFF # # BUZZER ON/OFF #
############################## ##############################
record(bo, "$(P)$(R)Buzzer" ) { record(bo, "$(P)$(R)Buzzer" ) {
field(DESC," Lab Buzzer ") field(DESC," Lab Buzzer ")
field(ZNAM, "Off" ) field(ZNAM, "Off" )
field(ONAM, "Pulse" ) field(ONAM, "Pulse" )
field(HIGH, "2.5") field(HIGH, "2.5")
field(FLNK, "$(P)$(R)BuzzerInv" ) field(FLNK, "$(P)$(R)BuzzerInv" )
field(VAL, "0") field(VAL, "0")
} }
record(calcout, "$(P)$(R)BuzzerInv" ) { record(calcout, "$(P)$(R)BuzzerInv" ) {
field(INPA, "$(P)$(R)Buzzer NPP MS" ) field(INPA, "$(P)$(R)Buzzer NPP MS" )
field(OUT, "$(P)$(R)PCF8574:57:REGISTER.B3 PP MS" ) field(OUT, "$(P)$(R)PCF8574:57:REGISTER.B3 PP MS" )
field(OOPT, "On Change" ) field(OOPT, "On Change" )
field(CALC, "A?0:1" ) field(CALC, "A?0:1" )
} }
############################## ##############################
# EMERGENCY MODE # # EMERGENCY MODE #
############################## ##############################
record(bi, "$(P)$(R)Emergency-PhysButton" ) { record(bi, "$(P)$(R)Emergency-PhysButton" ) {
field(DESC,"External Physical Emergency Button") field(DESC,"External Physical Emergency Button")
field(INP, "$(P)$(R)PCF8574:57:REGISTER:READ.B4 NPP NMS") field(INP, "$(P)$(R)PCF8574:57:REGISTER:READ.B4 NPP NMS")
field(ZNAM, "ON") field(ZNAM, "ON")
field(ONAM, "OFF" ) field(ONAM, "OFF" )
field(FLNK, "$(P)$(R)Emergency" ) field(FLNK, "$(P)$(R)Emergency" )
} }
record(bo, "$(P)$(R)Emergency-UserButton" ) { record(bo, "$(P)$(R)Emergency-UserButton" ) {
field(DESC,"Soft User Emergency Button") field(DESC,"Soft User Emergency Button")
field(ZNAM, "OFF" ) field(ZNAM, "OFF" )
field(ONAM, "ON") field(ONAM, "ON")
field(FLNK, "$(P)$(R)Emergency" ) field(FLNK, "$(P)$(R)Emergency" )
} }
record(calc, "$(P)$(R)Emergency" ) { record(calc, "$(P)$(R)Emergency" ) {
field(DESC, "Emergency State") field(DESC, "Emergency State")
field(INPA, "$(P)$(R)Emergency-PhysButton.RVAL NPP" ) field(INPA, "$(P)$(R)Emergency-PhysButton.RVAL NPP" )
field(INPB, "$(P)$(R)Emergency-UserButton.RVAL NPP" ) field(INPB, "$(P)$(R)Emergency-UserButton.RVAL NPP" )
field(CALC, "A || B" ) # ! Not field(CALC, "A || B" ) # ! Not
} }
############ ############
@@ -237,71 +232,71 @@ record(calc, "$(P)$(R)Emergency" ) {
# ROTARY1 PUMP # # ROTARY1 PUMP #
############################# #############################
record( bo, "$(P)$(R)RPump1-Motor" ) { record( bo, "$(P)$(R)RPump1-Motor" ) {
field(DESC,"Power to Rotatory Pump 1. Relay 5") field(DESC,"Power to Rotatory Pump 1. Relay 5")
field(OUT, "$(P)$(R)PCF8574:60:REGISTER.B0 PP" ) field(OUT, "$(P)$(R)PCF8574:60:REGISTER.B0 PP" )
field(ZNAM, "Off" ) field(ZNAM, "Off" )
field(ONAM, "On" ) field(ONAM, "On" )
field(VAL,"1") field(VAL,"1")
field(ZSV,"MINOR") field(ZSV,"MINOR")
} }
############################# #############################
# ROTARY1 VALVE # # ROTARY1 VALVE #
############################# #############################
record( bo, "$(P)$(R)RPump1-Valve" ) { record( bo, "$(P)$(R)RPump1-Valve" ) {
field(DESC,"Abre a valvula da bomba rot. Relay 4") field(DESC,"Abre a valvula da bomba rot. Relay 4")
field(OUT, "$(P)$(R)PCF8574:60:REGISTER.B1 PP" ) field(OUT, "$(P)$(R)PCF8574:60:REGISTER.B1 PP" )
field(ZNAM, "Closed" ) field(ZNAM, "Closed" )
field(ONAM, "Open" ) field(ONAM, "Open" )
field(VAL,"1") field(VAL,"1")
} }
############################# #############################
# ROTARY2 PUMP # # ROTARY2 PUMP #
############################# #############################
record( bo, "$(P)$(R)RPump2-Motor" ) { record( bo, "$(P)$(R)RPump2-Motor" ) {
field(DESC,"Power On Rotatory Pump 2") field(DESC,"Power On Rotatory Pump 2")
field(OUT, "$(P)$(R)PCF8574:60:REGISTER.B2 PP" ) field(OUT, "$(P)$(R)PCF8574:60:REGISTER.B2 PP" )
field(ZNAM, "Off" ) field(ZNAM, "Off" )
field(ONAM, "On" ) field(ONAM, "On" )
field(VAL,"1") field(VAL,"1")
field(ZSV,"MINOR") field(ZSV,"MINOR")
} }
############################# #############################
# ROTARY2 VALVE # # ROTARY2 VALVE #
############################# #############################
record( bo, "$(P)$(R)RPump2-Valve" ) { record( bo, "$(P)$(R)RPump2-Valve" ) {
field(DESC," Abre a valvula da bomba rotatoria 2 ") field(DESC," Abre a valvula da bomba rotatoria 2 ")
field(OUT,"$(P)$(R)PCF8574:60:REGISTER.B3 PP" ) field(OUT,"$(P)$(R)PCF8574:60:REGISTER.B3 PP" )
field(ZNAM,"Closed" ) field(ZNAM,"Closed" )
field(ONAM,"Open" ) field(ONAM,"Open" )
field(VAL,"1") field(VAL,"1")
} }
################################ ################################
# FILAMENT ON/OFF # # FILAMENT ON/OFF #
################################ ################################
record(bo, "$(P)$(R)VVessel-Filament" ) { record(bo, "$(P)$(R)VVessel-Filament" ) {
field(DESC,"Vacuum Vessel Filament power") field(DESC,"Vacuum Vessel Filament power")
# record(bo, "$(P)$(R)FilamentOnOff" ) { # record(bo, "$(P)$(R)FilamentOnOff" ) {
field( OUT, "$(P)$(R)PCF8574:60:REGISTER.B4 PP" ) field( OUT, "$(P)$(R)PCF8574:60:REGISTER.B4 PP" )
field( ZNAM, "On" ) field( ZNAM, "On" )
field( ONAM, "Off" ) field( ONAM, "Off" )
field(VAL,"1") field(VAL,"1")
field(PINI,"YES") field(PINI,"YES")
} }
############################## ##############################
# LIGHTS ON/OFF # # LIGHTS ON/OFF #
############################## ##############################
record(bo, "$(P)$(R)Lab-WarningLight" ) { record(bo, "$(P)$(R)Lab-WarningLight" ) {
field(DESC," Luzes de sinalização, 220V ") field(DESC," Luzes de sinalização, 220V ")
# record(bo, "$(P)$(R)LightsOnOff" ) { # record(bo, "$(P)$(R)LightsOnOff" ) {
field(OUT, "$(P)$(R)PCF8574:60:REGISTER.B5 PP" ) field(OUT, "$(P)$(R)PCF8574:60:REGISTER.B5 PP" )
field(ZNAM, "On" ) field(ZNAM, "On" )
field(ONAM, "Off" ) field(ONAM, "Off" )
field(VAL,"1") field(VAL,"1")
} }
############ ############
@@ -314,10 +309,10 @@ record(bo, "$(P)$(R)Lab-WarningLight" ) {
############################## ##############################
record(bo, "$(P)$(R)Clean-TorContactor" ) { record(bo, "$(P)$(R)Clean-TorContactor" ) {
# field(DESC," Contactor 220V do transformador para a fonte de campo toroidal das descargas de limpeza (500 A) ") # field(DESC," Contactor 220V do transformador para a fonte de campo toroidal das descargas de limpeza (500 A) ")
field( OUT, "$(P)$(R)PCF8574:60:REGISTER.B7 PP" ) field( OUT, "$(P)$(R)PCF8574:60:REGISTER.B7 PP" )
field( ZNAM, "On" ) field( ZNAM, "On" )
field( ONAM, "Off" ) field( ONAM, "Off" )
field(VAL,"1") field(VAL,"1")
} }
############### ###############
@@ -331,34 +326,34 @@ record(bo, "$(P)$(R)Clean-TorContactor" ) {
############################ ############################
record(bo, "$(P)$(R)Clean-TorPneuBreaker" ) { record(bo, "$(P)$(R)Clean-TorPneuBreaker" ) {
## field(DESC," Interruptor de ar comprimido do transformador para a fonte de campo toroidal das descargas de limpeza (500 A)") ## field(DESC," Interruptor de ar comprimido do transformador para a fonte de campo toroidal das descargas de limpeza (500 A)")
field( OUT, "$(P)$(R)PCF8574:61:REGISTER.B0 PP" ) field( OUT, "$(P)$(R)PCF8574:61:REGISTER.B0 PP" )
field( ZNAM, "On" ) field( ZNAM, "On" )
field( ONAM, "Off" ) field( ONAM, "Off" )
field(VAL,"1") field(VAL,"1")
} }
record(bo, "$(P)$(R)Shot-TorPSDisable" ) { record(bo, "$(P)$(R)Shot-TorPSDisable" ) {
# field(DESC," É desligado na emergência e em qualquer estado que não seja Process ou Wait Shot.") # field(DESC," É desligado na emergência e em qualquer estado que não seja Process ou Wait Shot.")
field( OUT, "$(P)$(R)PCF8574:61:REGISTER.B1 PP" ) field( OUT, "$(P)$(R)PCF8574:61:REGISTER.B1 PP" )
field( ZNAM, "Off" ) field( ZNAM, "Off" )
field( ONAM, "On" ) field( ONAM, "On" )
field(VAL,"1") field(VAL,"1")
} }
record(bo, "$(P)$(R)Shot-TorPSTrigger" ) { record(bo, "$(P)$(R)Shot-TorPSTrigger" ) {
field(DESC," Trigger da FRAEP") field(DESC," Trigger da FRAEP")
field( ZNAM, "Off" ) field( ZNAM, "Off" )
field( ONAM, "Pulse" ) field( ONAM, "Pulse" )
field( HIGH, "2.5") field( HIGH, "2.5")
field( FLNK, "$(P)$(R)Shot-TorPSTriggerInv" ) field( FLNK, "$(P)$(R)Shot-TorPSTriggerInv" )
field(VAL,"0") field(VAL,"0")
} }
record(calcout, "$(P)$(R)Shot-TorPSTriggerInv" ) { record(calcout, "$(P)$(R)Shot-TorPSTriggerInv" ) {
# field(DESC," $(R)") # field(DESC," $(R)")
field( INPA, "$(P)$(R)ToroidalShotTriggerOnOff NPP MS" ) field( INPA, "$(P)$(R)ToroidalShotTriggerOnOff NPP MS" )
field( OUT, "$(P)$(R)PCF8574:61:REGISTER.B2 PP MS" ) field( OUT, "$(P)$(R)PCF8574:61:REGISTER.B2 PP MS" )
field( OOPT, "On Change" ) field( OOPT, "On Change" )
field( CALC, "A?0:1" ) field( CALC, "A?0:1" )
} }
############################################################ ############################################################
@@ -368,10 +363,10 @@ record(calcout, "$(P)$(R)Shot-TorPSTriggerInv" ) {
record(bo, "$(P)$(R)CapBank-Charge" ) { record(bo, "$(P)$(R)CapBank-Charge" ) {
## field(DESC," Contactor 220V do circuito de carga do banco de condensadores p/ SHOT (ELCO) ") ## field(DESC," Contactor 220V do circuito de carga do banco de condensadores p/ SHOT (ELCO) ")
#record(bo, "$(P)$(R)CapBankChargeOnOff" ) { #record(bo, "$(P)$(R)CapBankChargeOnOff" ) {
field(OUT, "$(P)$(R)PCF8574:61:REGISTER.B3 PP" ) field(OUT, "$(P)$(R)PCF8574:61:REGISTER.B3 PP" )
field(ZNAM, "On" ) field(ZNAM, "On" )
field(ONAM, "Off" ) field(ONAM, "Off" )
field(VAL,"1") field(VAL,"1")
} }
######################################## ########################################
@@ -380,10 +375,10 @@ record(bo, "$(P)$(R)CapBank-Charge" ) {
record(bo, "$(P)$(R)Clean-PrimContactor" ) { record(bo, "$(P)$(R)Clean-PrimContactor" ) {
# field(DESC," Contactor 220V do para o primário das descargas de limpeza ") # field(DESC," Contactor 220V do para o primário das descargas de limpeza ")
# record(bo, "$(P)$(R)PrimaryCleanContactorOnOff" ) { # record(bo, "$(P)$(R)PrimaryCleanContactorOnOff" ) {
field(OUT, "$(P)$(R)PCF8574:61:REGISTER.B4 PP MS" ) field(OUT, "$(P)$(R)PCF8574:61:REGISTER.B4 PP MS" )
field(ZNAM, "On" ) field(ZNAM, "On" )
field(ONAM, "Off" ) field(ONAM, "Off" )
field(VAL,"1") field(VAL,"1")
} }
#################################### ####################################
@@ -391,11 +386,11 @@ record(bo, "$(P)$(R)Clean-PrimContactor" ) {
#################################### ####################################
record(bo, "$(P)$(R)Clean-PrimPneuBreaker"){ record(bo, "$(P)$(R)Clean-PrimPneuBreaker"){
#record(bo, "$(P)$(R)PrimaryCleanBreakerOnOff"){ #record(bo, "$(P)$(R)PrimaryCleanBreakerOnOff"){
field( DESC, "Primary Cleaning OnOff") field( DESC, "Primary Cleaning OnOff")
field( OUT, "$(P)$(R)PCF8574:61:REGISTER.B5 PP" ) field( OUT, "$(P)$(R)PCF8574:61:REGISTER.B5 PP" )
field( ZNAM, "On") field( ZNAM, "On")
field( ONAM, "Off") field( ONAM, "Off")
field(VAL,"1") field(VAL,"1")
} }
################################## ##################################
@@ -404,22 +399,22 @@ record(bo, "$(P)$(R)Clean-PrimPneuBreaker"){
record(bo, "$(P)$(R)GasIS-Valves" ) { record(bo, "$(P)$(R)GasIS-Valves" ) {
# field(DESC," 2 válvulas pneumáticas de corte do sistema de injecção de H/D/Ne/He no TOK, 24V out = deixa passar") # field(DESC," 2 válvulas pneumáticas de corte do sistema de injecção de H/D/Ne/He no TOK, 24V out = deixa passar")
# record(bo, "$(P)$(R)GISValvesOnOff" ) { # record(bo, "$(P)$(R)GISValvesOnOff" ) {
field( OUT, "$(P)$(R)PCF8574:61:REGISTER.B6 PP" ) field( OUT, "$(P)$(R)PCF8574:61:REGISTER.B6 PP" )
field( ZNAM, "On" ) field( ZNAM, "On" )
field( ONAM, "Off" ) field( ONAM, "Off" )
field(VAL,"1") field(VAL,"1")
} }
########################################## ##########################################
# CAP BANK DISCHARGE ON/OFF # # CAP BANK DISCHARGE ON/OFF #
########################################## ##########################################
record(bo, "$(P)$(R)CapBank-Discharge" ) { record(bo, "$(P)$(R)CapBank-Discharge" ) {
field(DESC," Liga o circuito de descarga do ELCO ") field(DESC," Liga o circuito de descarga do ELCO ")
# record(bo, "$(P)$(R)CapBankDischargeOnOff" ) { # record(bo, "$(P)$(R)CapBankDischargeOnOff" ) {
field(OUT, "$(P)$(R)PCF8574:61:REGISTER.B7 PP" ) field(OUT, "$(P)$(R)PCF8574:61:REGISTER.B7 PP" )
field(ZNAM, "On" ) field(ZNAM, "On" )
field(ONAM, "Off" ) field(ONAM, "Off" )
field(VAL,"1") field(VAL,"1")
} }
#record(bo,"$(P)$(R)Primary-PressureCondition"){ #record(bo,"$(P)$(R)Primary-PressureCondition"){
@@ -431,9 +426,9 @@ record(bo, "$(P)$(R)CapBank-Discharge" ) {
record(ai,"$(P)$(R)TMPump2-Speed"){ record(ai,"$(P)$(R)TMPump2-Speed"){
# field(DESC," ADC Pump speed 0-10V ") # field(DESC," ADC Pump speed 0-10V ")
#record(ai,"$(P)$(R)Turbo2_Speed"){ #record(ai,"$(P)$(R)Turbo2_Speed"){
field(PREC,"3") field(PREC,"3")
field(EGU,"RPM") field(EGU,"RPM")
field(VAL,"0") field(VAL,"0")
} }
####################### #######################
@@ -442,8 +437,8 @@ record(ai,"$(P)$(R)TMPump2-Speed"){
record(bo, "$(P)$(R)TMPump1-ManualValve"){ record(bo, "$(P)$(R)TMPump1-ManualValve"){
# field(DESC," $(R)") # field(DESC," $(R)")
#record(bo, "$(P)$(R)TMPManualValve"){ #record(bo, "$(P)$(R)TMPManualValve"){
info(autosaveFields, "VAL") info(autosaveFields, "VAL")
field( DESC, "State of manual valve") field( DESC, "State of manual valve")
field( ZNAM, "Closed") field( ZNAM, "Closed")
field( ONAM, "Open") field( ONAM, "Open")
} }

View File

@@ -18,20 +18,20 @@
# ### Read/Write pcf8574 address 0x38=56 register ### # # ### Read/Write pcf8574 address 0x38=56 register ### #
################################################### ###################################################
record( mbboDirect, "$(P)$(R)PCF8574:56:REGISTER") { record( mbboDirect, "$(P)$(R)PCF8574:56:REGISTER") {
field(DTYP, "stream") field(DTYP, "stream")
field(OUT, "@pcf8574.proto wReg(56) I2C") field(OUT, "@pcf8574.proto wReg(56) $(BUS)")
field(SHFT, "0") field(SHFT, "0")
field(NOBT, "8") field(NOBT, "8")
field(VAL, 255) field(VAL, 255)
# field(PINI,"YES") # field(PINI,"YES")
} }
record( mbbiDirect, "$(P)$(R)PCF8574:56:REGISTER:READ" ) { record( mbbiDirect, "$(P)$(R)PCF8574:56:REGISTER:READ" ) {
field(DTYP, "stream") field(DTYP, "stream")
field(INP, "@pcf8574.proto rReg(56) I2C") field(INP, "@pcf8574.proto rReg(56) $(BUS)")
field(NOBT, "8") field(NOBT, "8")
field(SCAN, "1 second") field(SCAN, "1 second")
field(FLNK, "$(P)$(R)PCF8574:56:REGISTER:READ:FNOUT") field(FLNK, "$(P)$(R)PCF8574:56:REGISTER:READ:FNOUT")
} }
##################################################### #####################################################
@@ -39,7 +39,7 @@ record( mbbiDirect, "$(P)$(R)PCF8574:56:REGISTER:READ" ) {
################################################### ###################################################
record( mbboDirect, "$(P)$(R)PCF8574:57:REGISTER") { record( mbboDirect, "$(P)$(R)PCF8574:57:REGISTER") {
field(DTYP, "stream") field(DTYP, "stream")
field(OUT, "@pcf8574.proto wReg(57) I2C") field(OUT, "@pcf8574.proto wReg(57) $(BUS)")
field(SHFT, "0") field(SHFT, "0")
field(NOBT, "8") field(NOBT, "8")
field(VAL, 255) field(VAL, 255)
@@ -48,7 +48,7 @@ record( mbboDirect, "$(P)$(R)PCF8574:57:REGISTER") {
record( mbbiDirect, "$(P)$(R)PCF8574:57:REGISTER:READ" ) { record( mbbiDirect, "$(P)$(R)PCF8574:57:REGISTER:READ" ) {
field(DTYP, "stream") field(DTYP, "stream")
field(INP, "@pcf8574.proto rReg(57) I2C") field(INP, "@pcf8574.proto rReg(57) $(BUS)")
field(NOBT, "8") field(NOBT, "8")
field(SCAN, "1 second") field(SCAN, "1 second")
field(FLNK, "$(P)$(R)PCF8574:57:REGISTER:READ:FNOUT") field(FLNK, "$(P)$(R)PCF8574:57:REGISTER:READ:FNOUT")
@@ -59,7 +59,7 @@ record( mbbiDirect, "$(P)$(R)PCF8574:57:REGISTER:READ" ) {
################################################### ###################################################
record( mbboDirect, "$(P)$(R)PCF8574:60:REGISTER") { record( mbboDirect, "$(P)$(R)PCF8574:60:REGISTER") {
field( DTYP, "stream") field( DTYP, "stream")
field( OUT, "@pcf8574.proto wReg(60) I2C") field( OUT, "@pcf8574.proto wReg(60) $(BUS)")
field( SHFT, "0") field( SHFT, "0")
field( NOBT, "8") field( NOBT, "8")
field(VAL, 255) field(VAL, 255)
@@ -68,7 +68,7 @@ record( mbboDirect, "$(P)$(R)PCF8574:60:REGISTER") {
record( mbbiDirect, "$(P)$(R)PCF8574:60:REGISTER:READ" ) { record( mbbiDirect, "$(P)$(R)PCF8574:60:REGISTER:READ" ) {
field( DTYP, "stream") field( DTYP, "stream")
field( INP, "@pcf8574.proto rReg(60) I2C") field( INP, "@pcf8574.proto rReg(60) $(BUS)")
field(NOBT, "8") field(NOBT, "8")
field(SCAN, "1 second") field(SCAN, "1 second")
# field(FLNK, "$(P)$(R)PCF8574:60:REGISTER:READ:FNOUT") # field(FLNK, "$(P)$(R)PCF8574:60:REGISTER:READ:FNOUT")
@@ -80,7 +80,7 @@ record( mbbiDirect, "$(P)$(R)PCF8574:60:REGISTER:READ" ) {
################################################### ###################################################
record( mbboDirect, "$(P)$(R)PCF8574:61:REGISTER") { record( mbboDirect, "$(P)$(R)PCF8574:61:REGISTER") {
field( DTYP, "stream") field( DTYP, "stream")
field( OUT, "@pcf8574.proto wReg(61) I2C") field( OUT, "@pcf8574.proto wReg(61) $(BUS)")
field( SHFT, "0") field( SHFT, "0")
field( NOBT, "8") field( NOBT, "8")
field(VAL, 255) field(VAL, 255)
@@ -89,7 +89,7 @@ record( mbboDirect, "$(P)$(R)PCF8574:61:REGISTER") {
record( mbbiDirect, "$(P)$(R)PCF8574:61:REGISTER:READ" ) { record( mbbiDirect, "$(P)$(R)PCF8574:61:REGISTER:READ" ) {
field( DTYP, "stream") field( DTYP, "stream")
field( INP, "@pcf8574.proto rReg(61) I2C") field( INP, "@pcf8574.proto rReg(61) $(BUS)")
field(NOBT, "8") field(NOBT, "8")
field(SCAN, "1 second") field(SCAN, "1 second")
#field(PINI,"YES") #field(PINI,"YES")

View File

@@ -10,25 +10,25 @@
# ### 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 ### #
####################################################### #######################################################
##################################################### #####################################################
# Read/Write pcf8591 register @ address 0x48=d72 ### # # Read/Write pcf8591 register @ address 0x48=d72 ### #
##################################################### #####################################################
record( mbboDirect, "$(P)$(R)PCF8591:72:CTRLREGISTER") { record(mbboDirect, "$(P)$(R)PCF8591:72:CTRLREGISTER") {
field(DTYP, "stream") field(DTYP, "stream")
field(OUT, "@pcf8591.proto wReg(72) I2C") field(OUT, "@pcf8591.proto wReg(72) $(BUS)")
field(SHFT, "0") field(SHFT, "0")
field(NOBT, "8") field(NOBT, "8")
field(VAL, 255) field(VAL, 255)
field(PINI,"YES") field(PINI,"YES")
} }
# Receiving two bytes. last one counts # Receiving two bytes. last one counts
record( longin, "$(P)$(R)PCF8591:72:ADC_CH1" ) { record( longin, "$(P)$(R)PCF8591:72:ADC_CH1" ) {
field(DTYP, "stream") field(DTYP, "stream")
field(INP, "@pcf8591.proto rConvAdc0(72) I2C") field(INP, "@pcf8591.proto rConvAdc0(72) $(BUS)")
} }
record( calc, "$(P)$(R)PCF8591:72:BYTE2_CH1" ) { record( calc, "$(P)$(R)PCF8591:72:BYTE2_CH1" ) {
field(INPA, "$(P)$(R)PCF8591:72:ADC_CH1 PP NMS") field(INPA, "$(P)$(R)PCF8591:72:ADC_CH1 PP NMS")
@@ -37,36 +37,36 @@ record( calc, "$(P)$(R)PCF8591:72:BYTE2_CH1" ) {
} }
record( ai, "$(P)$(R)TMPump2-Speed" ) { 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" )
field(PREC, "3" ) field(PREC, "3" )
field(HOPR, "5000" ) field(HOPR, "5000" )
field(LOPR, "0" ) field(LOPR, "0" )
field(LOW, "200.0") field(LOW, "200.0")
# # field(LOLO,"0.0") # field(LOLO,"0.0")
field(LSV, "MINOR") field(LSV, "MINOR")
# # field(LLSV,"MAJOR") # field(LLSV,"MAJOR")
} }
record( longin, "$(P)$(R)PCF8591:72:ADC_CH2" ) { record( longin, "$(P)$(R)PCF8591:72:ADC_CH2" ) {
field(DTYP, "stream") field(DTYP, "stream")
field(INP, "@pcf8591.proto rConvAdc1(72) I2C") field(INP, "@pcf8591.proto rConvAdc1(72) $(BUS)")
} }
record( calc, "$(P)$(R)PCF8591:72:BYTE2_CH2" ) { record( calc, "$(P)$(R)PCF8591:72:BYTE2_CH2" ) {
field(INPA, "$(P)$(R)PCF8591:72:ADC_CH2 PP NMS") field(INPA, "$(P)$(R)PCF8591:72:ADC_CH2 PP NMS")
# LSB i=last byte received # LSB i=last byte received
field(CALC, " (A & 255)" ) field(CALC, "(A & 255)" )
} }
record( ai, "$(P)$(R)TMPump2-Current" ) { 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" )
@@ -82,7 +82,7 @@ record( ai, "$(P)$(R)TMPump2-Current" ) {
# Receiving two bytes. last one counts # Receiving two bytes. last one counts
record( longin, "$(P)$(R)PCF8591:72:ADC_CH3" ) { record( longin, "$(P)$(R)PCF8591:72:ADC_CH3" ) {
field(DTYP, "stream") field(DTYP, "stream")
field(INP, "@pcf8591.proto rConvAdc2(72) I2C") field(INP, "@pcf8591.proto rConvAdc2(72) $(BUS)")
} }
record( calc, "$(P)$(R)PCF8591:72:BYTE2_CH3" ) { record( calc, "$(P)$(R)PCF8591:72:BYTE2_CH3" ) {
field(INPA, "$(P)$(R)PCF8591:72:ADC_CH3 PP NMS") field(INPA, "$(P)$(R)PCF8591:72:ADC_CH3 PP NMS")
@@ -90,17 +90,17 @@ record( calc, "$(P)$(R)PCF8591:72:BYTE2_CH3" ) {
field(CALC, " (A & 255 )" ) field(CALC, " (A & 255 )" )
} }
record(ai, "$(P)$(R)Shot-TorPSCurrentImage" ) { 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" )
field(PREC, "3" ) field(PREC, "3" )
field(HOPR, "10000" ) field(HOPR, "10000" )
field(LOPR, "0" ) field(LOPR, "0" )
field(MDEL, "20" ) field(MDEL, "20" )
# field(LOW, "200.0") # field(LOW, "200.0")
# # field(LOLO,"0.0") # # field(LOLO,"0.0")
# field(LSV, "MINOR") # field(LSV, "MINOR")
@@ -110,7 +110,7 @@ record(ai, "$(P)$(R)Shot-TorPSCurrentImage" ) {
record( longout, "$(P)$(R)PCF8591:72:DAC") { record( longout, "$(P)$(R)PCF8591:72:DAC") {
field(DTYP, "stream") field(DTYP, "stream")
field(OUT, "@pcf8591.proto wDac(72) I2C") field(OUT, "@pcf8591.proto wDac(72) $(BUS)")
field(DRVH, "255" ) field(DRVH, "255" )
field(DRVL, "0" ) field(DRVL, "0" )
field(VAL, 128) field(VAL, 128)

View File

@@ -92,6 +92,24 @@ record(calc, "$(P)$(R)WSHOTCALCSTATE") {
# field(SCAN,"1 second") # field(SCAN,"1 second")
#} #}
record(bo, "$(P)$(R)UPS-OnBattery") {
info(autosaveFields, "VAL STAT")
field(DESC, "Main APC UPS On Battery status")
field(VAL, "0")
field(ZNAM, "OFF")
field(ONAM, "ON")
field(OSV, "MAJOR")
}
record(bo, "$(P)$(R)UPS-Shutdown") {
info(autosaveFields, "VAL STAT")
field(DESC, "Main APC UPS Shutdown request")
# field(VAL, "0")
field(ZNAM, "OFF")
field(ONAM, "ON")
field(OSV, "MAJOR")
}
record(bo, "$(P)$(R)OPREQ") { record(bo, "$(P)$(R)OPREQ") {
info(autosaveFields, "VAL") info(autosaveFields, "VAL")
field(DESC, "Pulse Sequence Start/Stop") field(DESC, "Pulse Sequence Start/Stop")

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 ### #
@@ -19,15 +19,15 @@
##################################################### #####################################################
record( longout, "$(P)$(R)TDA8444:32:DAC_CH0") { record( longout, "$(P)$(R)TDA8444:32:DAC_CH0") {
field(DTYP, "stream") field(DTYP, "stream")
field(OUT, "@tda8444.proto wDac0(32) I2C") field(OUT, "@tda8444.proto wDac0(32) $(BUS)")
field(DRVH, "63" ) field(DRVH, "63" )
field(DRVL, "0" ) field(DRVL, "0" )
field(VAL, 32) field(VAL, 32)
field(PINI,"YES") field(PINI,"YES")
} }
record( longout, "$(P)$(R)TDA8444:32:DAC_CH1") { record( longout, "$(P)$(R)TDA8444:32:DAC_CH1") {
field(DTYP, "stream") field(DTYP, "stream")
field(OUT, "@tda8444.proto wDac1(32) I2C") field(OUT, "@tda8444.proto wDac1(32) $(BUS)")
field(DRVH, "63" ) field(DRVH, "63" )
field(DRVL, "0" ) field(DRVL, "0" )
field(VAL, 32) field(VAL, 32)
@@ -35,7 +35,7 @@ record( longout, "$(P)$(R)TDA8444:32:DAC_CH1") {
} }
record( longout, "$(P)$(R)TDA8444:32:DAC_CH2") { record( longout, "$(P)$(R)TDA8444:32:DAC_CH2") {
field(DTYP, "stream") field(DTYP, "stream")
field(OUT, "@tda8444.proto wDac2(32) I2C") field(OUT, "@tda8444.proto wDac2(32) $(BUS)")
field(DRVH, "63" ) field(DRVH, "63" )
field(DRVL, "0" ) field(DRVL, "0" )
field(VAL, 32) field(VAL, 32)
@@ -43,7 +43,7 @@ record( longout, "$(P)$(R)TDA8444:32:DAC_CH2") {
} }
record( longout, "$(P)$(R)TDA8444:32:DAC_CH3") { record( longout, "$(P)$(R)TDA8444:32:DAC_CH3") {
field(DTYP, "stream") field(DTYP, "stream")
field(OUT, "@tda8444.proto wDac3(32) I2C") field(OUT, "@tda8444.proto wDac3(32) $(BUS)")
field(DRVH, "63" ) field(DRVH, "63" )
field(DRVL, "0" ) field(DRVL, "0" )
field(VAL, 32) field(VAL, 32)
@@ -51,7 +51,7 @@ record( longout, "$(P)$(R)TDA8444:32:DAC_CH3") {
} }
record( longout, "$(P)$(R)TDA8444:32:DAC_CH4") { record( longout, "$(P)$(R)TDA8444:32:DAC_CH4") {
field(DTYP, "stream") field(DTYP, "stream")
field(OUT, "@tda8444.proto wDac4(32) I2C") field(OUT, "@tda8444.proto wDac4(32) $(BUS)")
field(DRVH, "63" ) field(DRVH, "63" )
field(DRVL, "0" ) field(DRVL, "0" )
field(VAL, 32) field(VAL, 32)
@@ -59,7 +59,7 @@ record( longout, "$(P)$(R)TDA8444:32:DAC_CH4") {
} }
record( longout, "$(P)$(R)TDA8444:32:DAC_CH5") { record( longout, "$(P)$(R)TDA8444:32:DAC_CH5") {
field(DTYP, "stream") field(DTYP, "stream")
field(OUT, "@tda8444.proto wDac5(32) I2C") field(OUT, "@tda8444.proto wDac5(32) $(BUS)")
field(DRVH, "63" ) field(DRVH, "63" )
field(DRVL, "0" ) field(DRVL, "0" )
field(VAL, 32) field(VAL, 32)
@@ -67,7 +67,7 @@ record( longout, "$(P)$(R)TDA8444:32:DAC_CH5") {
} }
record( longout, "$(P)$(R)TDA8444:32:DAC_CH6") { record( longout, "$(P)$(R)TDA8444:32:DAC_CH6") {
field(DTYP, "stream") field(DTYP, "stream")
field(OUT, "@tda8444.proto wDac6(32) I2C") field(OUT, "@tda8444.proto wDac6(32) $(BUS)")
field(DRVH, "63" ) field(DRVH, "63" )
field(DRVL, "0" ) field(DRVL, "0" )
field(VAL, 32) field(VAL, 32)
@@ -76,7 +76,7 @@ record( longout, "$(P)$(R)TDA8444:32:DAC_CH6") {
#record( longout, "$(P)$(R) TDA8444:32:DAC_CH7") { #record( longout, "$(P)$(R) TDA8444:32:DAC_CH7") {
record( longout, "$(P)$(R)Shot-TorPSCurrent") { record( longout, "$(P)$(R)Shot-TorPSCurrent") {
field(DTYP, "stream") field(DTYP, "stream")
field(OUT, "@tda8444.proto wDac7(32) I2C") field(OUT, "@tda8444.proto wDac7(32) $(BUS)")
field(DRVH, "63" ) field(DRVH, "63" )
field(DRVL, "0" ) field(DRVL, "0" )
field(VAL, 1) field(VAL, 1)

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

@@ -8,7 +8,7 @@ ExtraInput = Error;
rReg { rReg {
out ${1}; out ${1};
in "%.1r"; in "%01r";
} }
## @init { rReg; } ## @init { rReg; }

View File

@@ -1,5 +1,5 @@
Terminator = ""; Terminator = "";
LockTimeout = 500; LockTimeout = 200;
ReplyTimeout = 100; ReplyTimeout = 100;
ReadTimeout = 100; ReadTimeout = 100;
WriteTimeout = 100; WriteTimeout = 100;
@@ -8,7 +8,7 @@ ExtraInput = Error;
rReg { rReg {
out ${1}; out ${1};
in "%.1r"; in "%01r";
} }
# To read adc write control Byte # To read adc write control Byte
# Bits 0,1 ADC channel Selection # Bits 0,1 ADC channel Selection
@@ -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

@@ -1,5 +1,5 @@
Terminator = ""; Terminator = "";
LockTimeout = 500; LockTimeout = 200;
ReplyTimeout = 100; ReplyTimeout = 100;
ReadTimeout = 100; ReadTimeout = 100;
WriteTimeout = 100; WriteTimeout = 100;

View File

@@ -13,7 +13,7 @@
int main(int argc,char *argv[]) int main(int argc,char *argv[])
{ {
if(argc>=2) { if(argc>=2) {
iocsh(argv[1]); iocsh(argv[1]);
epicsThreadSleep(.2); epicsThreadSleep(.2);
} }

View File

@@ -1,6 +1,7 @@
/** /** vim: set filetype=c :
* Use :SyntasticToggleMode
* *
* Project : ISTTOK slow Control Sequencer * Project : ISTTOK slow Control Sequencer
* Docs: https://www-csr.bessy.de/control/SoftDist/sequencer/ * Docs: https://www-csr.bessy.de/control/SoftDist/sequencer/
* *
* File : $Id$ * File : $Id$
@@ -11,12 +12,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;
@@ -24,7 +27,7 @@ short PCF_RELAY_OFF= 1;
short PCF_INPUT_ON = 0; short PCF_INPUT_ON = 0;
short PCF_INPUT_OFF= 1; short PCF_INPUT_OFF= 1;
short PCF_PULSE_ON = 1; short PCF_PULSE_ON = 1;
short STRST_NonStarting = 0; short STRST_NonStarting = 0;
short STRST_Starting1 = 1; short STRST_Starting1 = 1;
short STRST_Starting2 = 2; short STRST_Starting2 = 2;
@@ -63,12 +66,12 @@ short STPST_StoppingEnd = 4;
short POS_Stopped =0; short POS_Stopped =0;
short POS_Starting=1; short POS_Starting=1;
short POS_Process =2; short POS_Idle =2;
short POS_Clean =3; short POS_Clean =3;
short POS_WaitShot=4; short POS_WaitShot=4;
short POS_Stopping=5; short POS_Stopping=5;
short POS_Emergency=6; short POS_Emergency=6;
short ON=1; short ON=1;
short OFF=0; short OFF=0;
short START=1; short START=1;
@@ -80,31 +83,31 @@ short MINOR=1;
short MAJOR=2; short MAJOR=2;
short INVALID=3; short INVALID=3;
/* PV variables */ /* PV variables */
short IsttokOPSTATE; short IsttokOPSTATE;
assign IsttokOPSTATE to "ISTTOK:central:OPSTATE"; assign IsttokOPSTATE to "ISTTOK:central:OPSTATE";
monitor IsttokOPSTATE; monitor IsttokOPSTATE;
int PulseNumber; int PulseNumber;
assign PulseNumber to "ISTTOK:central:PULSE-NUMBER"; assign PulseNumber to "ISTTOK:central:PULSE-NUMBER";
monitor PulseNumber; monitor PulseNumber;
short IsttokLastOPSTATE; short IsttokLastOPSTATE;
assign IsttokLastOPSTATE to "ISTTOK:central:LASTOPSTATE"; assign IsttokLastOPSTATE to "ISTTOK:central:LASTOPSTATE";
monitor IsttokLastOPSTATE; monitor IsttokLastOPSTATE;
short IsttokOPREQ; short IsttokOPREQ;
assign IsttokOPREQ to "ISTTOK:central:OPREQ"; assign IsttokOPREQ to "ISTTOK:central:OPREQ";
monitor IsttokOPREQ; monitor IsttokOPREQ;
short IsttokProcMode; short IsttokProcMode;
assign IsttokProcMode to "ISTTOK:central:PROCESS-MODE"; assign IsttokProcMode to "ISTTOK:central:PROCESS-MODE";
monitor IsttokProcMode; monitor IsttokProcMode;
short IsttokProcReq; short IsttokProcReq;
assign IsttokProcReq to "ISTTOK:central:PROCESS-REQ"; assign IsttokProcReq to "ISTTOK:central:PROCESS-REQ";
monitor IsttokProcReq; monitor IsttokProcReq;
short STARTINGSTATE; short STARTINGSTATE;
assign STARTINGSTATE to "ISTTOK:central:STARTINGSTATE"; assign STARTINGSTATE to "ISTTOK:central:STARTINGSTATE";
monitor STARTINGSTATE; monitor STARTINGSTATE;
@@ -112,69 +115,72 @@ monitor STARTINGSTATE;
short CLEANINGSTATE; short CLEANINGSTATE;
assign CLEANINGSTATE to "ISTTOK:central:CLEANINGSTATE"; assign CLEANINGSTATE to "ISTTOK:central:CLEANINGSTATE";
monitor CLEANINGSTATE; monitor CLEANINGSTATE;
short CLEANINGMANMODE; short CLEANINGMANMODE;
assign CLEANINGMANMODE to "ISTTOK:central:CLEANINGMANMODE"; assign CLEANINGMANMODE to "ISTTOK:central:CLEANINGMANMODE";
monitor CLEANINGMANMODE; monitor CLEANINGMANMODE;
short WSHOTINGSTATE; short WSHOTINGSTATE;
assign WSHOTINGSTATE to "ISTTOK:central:WSHOTINGSTATE"; assign WSHOTINGSTATE to "ISTTOK:central:WSHOTINGSTATE";
short STOPPINGSTATE; short STOPPINGSTATE;
assign STOPPINGSTATE to "ISTTOK:central:STOPPINGSTATE"; assign STOPPINGSTATE to "ISTTOK:central:STOPPINGSTATE";
monitor STOPPINGSTATE; monitor STOPPINGSTATE;
short IsttokRPump1_Motor; short IsttokRPump1_Motor;
assign IsttokRPump1_Motor to "ISTTOK:central:RPump1-Motor"; assign IsttokRPump1_Motor to "ISTTOK:central:RPump1-Motor";
short IsttokRPump1_Valve; short IsttokRPump1_Valve;
assign IsttokRPump1_Valve to "ISTTOK:central:RPump1-Valve"; assign IsttokRPump1_Valve to "ISTTOK:central:RPump1-Valve";
short IsttokRPump2_Motor; short IsttokRPump2_Motor;
assign IsttokRPump2_Motor to "ISTTOK:central:RPump2-Motor"; assign IsttokRPump2_Motor to "ISTTOK:central:RPump2-Motor";
short IsttokRPump2_Valve; short IsttokRPump2_Valve;
assign IsttokRPump2_Valve to "ISTTOK:central:RPump2-Valve"; assign IsttokRPump2_Valve to "ISTTOK:central:RPump2-Valve";
short IsttokTMPump1_ControllerOff; short IsttokTMPump1_ControllerOff;
assign IsttokTMPump1_ControllerOff to "ISTTOK:central:TMPump1-ControllerOff"; assign IsttokTMPump1_ControllerOff to "ISTTOK:central:TMPump1-ControllerOff";
short IsttokTMPump1_ControllerOn; short IsttokTMPump1_ControllerOn;
assign IsttokTMPump1_ControllerOn to "ISTTOK:central:TMPump1-ControllerOn"; assign IsttokTMPump1_ControllerOn to "ISTTOK:central:TMPump1-ControllerOn";
short IsttokTMPump1_MotorOff; short IsttokTMPump1_MotorOff;
assign IsttokTMPump1_MotorOff to "ISTTOK:central:TMPump1-MotorOff"; assign IsttokTMPump1_MotorOff to "ISTTOK:central:TMPump1-MotorOff";
short IsttokTMPump1_MotorOn; short IsttokTMPump1_MotorOn;
assign IsttokTMPump1_MotorOn to "ISTTOK:central:TMPump1-MotorOn"; assign IsttokTMPump1_MotorOn to "ISTTOK:central:TMPump1-MotorOn";
short IsttokTMPump2_Motor; /*short IsttokTMPump2_Motor;*/
assign IsttokTMPump2_Motor to "ISTTOK:central:TMPump2-Motor"; /*assign IsttokTMPump2_Motor to "ISTTOK:central:TMPump2-Motor";*/
short TMPump1NormalOperation; short TMPump1NormalOperation;
assign TMPump1NormalOperation to "ISTTOK:central:TMPump1-NormalOperation"; assign TMPump1NormalOperation to "ISTTOK:central:TMPump1-NormalOperation";
monitor TMPump1NormalOperation; monitor TMPump1NormalOperation;
short IsttokTMPump1_Power; short IsttokTMPump1_Power;
assign IsttokTMPump1_Power to "ISTTOK:central:TMPump1-Power"; assign IsttokTMPump1_Power to "ISTTOK:central:TMPump1-Power";
monitor IsttokTMPump1_Power; monitor IsttokTMPump1_Power;
short IsttokTMPump1_Emergency; short IsttokTMPump1_Emergency;
assign IsttokTMPump1_Emergency to "ISTTOK:central:TMPump1-Emergency"; assign IsttokTMPump1_Emergency to "ISTTOK:central:TMPump1-Emergency";
monitor IsttokTMPump1_Emergency; 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;
@@ -182,61 +188,70 @@ monitor IsttokRPump2_Pressure;
float IsttokVVesselTemperature; float IsttokVVesselTemperature;
assign IsttokVVesselTemperature to "ISTTOK:temperature:VVessel-Temperature"; assign IsttokVVesselTemperature to "ISTTOK:temperature:VVessel-Temperature";
monitor IsttokVVesselTemperature; monitor IsttokVVesselTemperature;
*/
short IsttokShotBuzzer; short IsttokShotBuzzer;
assign IsttokShotBuzzer to "ISTTOK:central:Buzzer"; assign IsttokShotBuzzer to "ISTTOK:central:Buzzer";
short IsttokShotLab_WarningLight; short IsttokShotLab_WarningLight;
assign IsttokShotLab_WarningLight to "ISTTOK:central:Lab-WarningLight"; assign IsttokShotLab_WarningLight to "ISTTOK:central:Lab-WarningLight";
short IsttokShotGasIS_Valves; short IsttokShotGasIS_Valves;
assign IsttokShotGasIS_Valves to "ISTTOK:central:GasIS-Valves"; assign IsttokShotGasIS_Valves to "ISTTOK:central:GasIS-Valves";
short IsttokShotVVessel_Filament; short IsttokShotVVessel_Filament;
assign IsttokShotVVessel_Filament to "ISTTOK:central:VVessel-Filament"; assign IsttokShotVVessel_Filament to "ISTTOK:central:VVessel-Filament";
short IsttokShotCapBank_Charge; short IsttokShotCapBank_Charge;
assign IsttokShotCapBank_Charge to "ISTTOK:central:CapBank-Charge"; assign IsttokShotCapBank_Charge to "ISTTOK:central:CapBank-Charge";
short IsttokShotCapBank_Discharge; short IsttokShotCapBank_Discharge;
assign IsttokShotCapBank_Discharge to "ISTTOK:central:CapBank-Discharge"; assign IsttokShotCapBank_Discharge to "ISTTOK:central:CapBank-Discharge";
short IsttokShotClean_TorContactor; short IsttokShotClean_TorContactor;
assign IsttokShotClean_TorContactor to "ISTTOK:central:Clean-TorContactor"; assign IsttokShotClean_TorContactor to "ISTTOK:central:Clean-TorContactor";
short IsttokShotClean_TorPneuBreaker; short IsttokShotClean_TorPneuBreaker;
assign IsttokShotClean_TorPneuBreaker to "ISTTOK:central:Clean-TorPneuBreaker"; assign IsttokShotClean_TorPneuBreaker to "ISTTOK:central:Clean-TorPneuBreaker";
short IsttokShotShot_TorPSTrigger; short IsttokShotShot_TorPSTrigger;
assign IsttokShotShot_TorPSTrigger to "ISTTOK:central:Shot-TorPSTrigger"; assign IsttokShotShot_TorPSTrigger to "ISTTOK:central:Shot-TorPSTrigger";
monitor IsttokShotShot_TorPSTrigger; monitor IsttokShotShot_TorPSTrigger;
short IsttokShotShot_TorPSDisable; short IsttokShotShot_TorPSDisable;
assign IsttokShotShot_TorPSDisable to "ISTTOK:central:Shot-TorPSDisable"; assign IsttokShotShot_TorPSDisable to "ISTTOK:central:Shot-TorPSDisable";
short IsttokShotClean_PrimContactor; short IsttokShotClean_PrimContactor;
assign IsttokShotClean_PrimContactor to "ISTTOK:central:Clean-PrimContactor"; assign IsttokShotClean_PrimContactor to "ISTTOK:central:Clean-PrimContactor";
short IsttokShotClean_PrimPneuBreaker; short IsttokShotClean_PrimPneuBreaker;
assign IsttokShotClean_PrimPneuBreaker to "ISTTOK:central:Clean-PrimPneuBreaker"; assign IsttokShotClean_PrimPneuBreaker to "ISTTOK:central:Clean-PrimPneuBreaker";
short IsttokShotCountdown; short IsttokShotCountdown;
assign IsttokShotCountdown to "ISTTOK:central:COUNTDOWN"; assign IsttokShotCountdown to "ISTTOK:central:COUNTDOWN";
monitor IsttokShotCountdown; monitor IsttokShotCountdown;
string IsttokShotCountdownScan; string IsttokShotCountdownScan;
assign IsttokShotCountdownScan to "ISTTOK:central:COUNTDOWN.SCAN"; assign IsttokShotCountdownScan to "ISTTOK:central:COUNTDOWN.SCAN";
short IsttokEmergency; short IsttokEmergency;
assign IsttokEmergency to "ISTTOK:central:Emergency"; assign IsttokEmergency to "ISTTOK:central:Emergency";
monitor IsttokEmergency; monitor IsttokEmergency;
short IsttokTTSystem_tzero; short IsttokTTSystem_tzero;
assign IsttokTTSystem_tzero to "ISTTOK:central:TTSystem-tzero"; assign IsttokTTSystem_tzero to "ISTTOK:central:TTSystem-tzero";
monitor IsttokTTSystem_tzero; monitor IsttokTTSystem_tzero;
short IsttokupsBatteryON;
assign IsttokupsBatteryON "{unit}:central:UPS-OnBattery";
monitor IsttokupsBatteryON;
short IsttokShutdown;
assign IsttokShutdown "ISTTOK:central:UPS-Shutdown";
monitor IsttokShutdown;
//string tmp1_stat; //string tmp1_stat;
/* Trace message record limited to 40 characters */ /* Trace message record limited to 40 characters */
string msg; string msg;
assign msg to "ISTTOK:central:TraceMessage.VAL"; assign msg to "ISTTOK:central:TraceMessage.VAL";
@@ -252,68 +267,68 @@ ss PulseSequence {
strcpy(msg, "INIT: Sequence Entry"); strcpy(msg, "INIT: Sequence Entry");
pvPut(msg); pvPut(msg);
errlogSevPrintf(NO_ALARM, "%s\n",msg); errlogSevPrintf(NO_ALARM, "%s\n",msg);
strcpy(msg, "Initializing..."); strcpy(msg, "Initializing...");
pvPut(msg); pvPut(msg);
errlogSevPrintf(NO_ALARM, "%s\n",msg); errlogSevPrintf(NO_ALARM, "%s\n",msg);
IsttokShotCountdown = 160; IsttokShotCountdown = 160;
pvPut(IsttokShotCountdown); pvPut(IsttokShotCountdown);
// IsttokProcMode = OFF; // UPON POWER-DOWN OR FAILURE PREVENT TO ENTER WAITSHOT ON POWER-UP! // IsttokProcMode = OFF; // UPON POWER-DOWN OR FAILURE PREVENT TO ENTER WAITSHOT ON POWER-UP!
// pvPut(IsttokProcMode); // pvPut(IsttokProcMode);
IsttokShotClean_PrimContactor = PCF_RELAY_OFF; IsttokShotClean_PrimContactor = PCF_RELAY_OFF;
pvPut(IsttokShotClean_PrimContactor); pvPut(IsttokShotClean_PrimContactor);
IsttokShotClean_PrimPneuBreaker = PCF_RELAY_OFF; IsttokShotClean_PrimPneuBreaker = PCF_RELAY_OFF;
pvPut(IsttokShotClean_PrimPneuBreaker); pvPut(IsttokShotClean_PrimPneuBreaker);
IsttokShotBuzzer = PCF_RELAY_OFF; IsttokShotBuzzer = PCF_RELAY_OFF;
pvPut(IsttokShotBuzzer); pvPut(IsttokShotBuzzer);
IsttokShotCapBank_Charge = PCF_RELAY_OFF; IsttokShotCapBank_Charge = PCF_RELAY_OFF;
pvPut(IsttokShotCapBank_Charge); pvPut(IsttokShotCapBank_Charge);
IsttokShotCapBank_Discharge = PCF_RELAY_OFF; IsttokShotCapBank_Discharge = PCF_RELAY_OFF;
pvPut(IsttokShotCapBank_Discharge); pvPut(IsttokShotCapBank_Discharge);
IsttokShotVVessel_Filament = PCF_RELAY_OFF; IsttokShotVVessel_Filament = PCF_RELAY_OFF;
pvPut(IsttokShotVVessel_Filament); pvPut(IsttokShotVVessel_Filament);
IsttokShotGasIS_Valves = PCF_RELAY_OFF; IsttokShotGasIS_Valves = PCF_RELAY_OFF;
pvPut(IsttokShotGasIS_Valves); pvPut(IsttokShotGasIS_Valves);
IsttokShotLab_WarningLight = PCF_RELAY_OFF; IsttokShotLab_WarningLight = PCF_RELAY_OFF;
pvPut(IsttokShotLab_WarningLight); pvPut(IsttokShotLab_WarningLight);
IsttokShotClean_TorPneuBreaker = PCF_RELAY_OFF; IsttokShotClean_TorPneuBreaker = PCF_RELAY_OFF;
pvPut(IsttokShotClean_TorPneuBreaker); pvPut(IsttokShotClean_TorPneuBreaker);
IsttokShotClean_TorContactor = PCF_RELAY_OFF; IsttokShotClean_TorContactor = PCF_RELAY_OFF;
pvPut(IsttokShotClean_TorContactor); pvPut(IsttokShotClean_TorContactor);
IsttokShotShot_TorPSDisable = PCF_RELAY_OFF; IsttokShotShot_TorPSDisable = PCF_RELAY_OFF;
pvPut(IsttokShotShot_TorPSDisable); pvPut(IsttokShotShot_TorPSDisable);
IsttokShotShot_TorPSTrigger= OFF; IsttokShotShot_TorPSTrigger= OFF;
pvPut(IsttokShotShot_TorPSTrigger); pvPut(IsttokShotShot_TorPSTrigger);
IsttokTMPump1_ControllerOff = OFF; IsttokTMPump1_ControllerOff = OFF;
pvPut(IsttokTMPump1_ControllerOff); pvPut(IsttokTMPump1_ControllerOff);
IsttokTMPump1_ControllerOn = OFF; IsttokTMPump1_ControllerOn = OFF;
pvPut(IsttokTMPump1_ControllerOn); pvPut(IsttokTMPump1_ControllerOn);
IsttokTMPump1_MotorOff = OFF; IsttokTMPump1_MotorOff = OFF;
pvPut(IsttokTMPump1_MotorOff); pvPut(IsttokTMPump1_MotorOff);
IsttokTMPump1_MotorOn = OFF; IsttokTMPump1_MotorOn = OFF;
pvPut(IsttokTMPump1_MotorOn); pvPut(IsttokTMPump1_MotorOn);
IsttokTMPump2_Motor = PCF_RELAY_OFF; // IsttokTMPump2_Motor = PCF_RELAY_OFF;
pvPut(IsttokTMPump2_Motor); //pvPut(IsttokTMPump2_Motor);
if ((IsttokTMPump1_Power == PCF_INPUT_OFF)) { if ((IsttokTMPump1_Power == PCF_INPUT_OFF)) {
strcpy(msg, "TMP1 Controller is OFF"); strcpy(msg, "TMP1 Controller is OFF");
pvPut(msg); pvPut(msg);
@@ -331,7 +346,7 @@ ss PulseSequence {
/* State change to Stopping */ /* State change to Stopping */
// IsttokOPSTATE = POS_Stopping; // IsttokOPSTATE = POS_Stopping;
// pvPut(IsttokOPSTATE); // pvPut(IsttokOPSTATE);
} state Stopping } state Stopping
when (delay(5) && IsttokOPREQ == START ) { when (delay(5) && IsttokOPREQ == START ) {
strcpy(msg, "State to Starting"); strcpy(msg, "State to Starting");
pvPut(msg); pvPut(msg);
@@ -341,12 +356,13 @@ ss PulseSequence {
// pvPut(IsttokOPSTATE); // pvPut(IsttokOPSTATE);
} state Starting } state Starting
} }
/* State Stopped */
/*********** State Stopped ****************** */
state Stopped { state Stopped {
entry{ entry{
IsttokLastOPSTATE = POS_Stopped; IsttokLastOPSTATE = POS_Stopped;
pvPut(IsttokLastOPSTATE); pvPut(IsttokLastOPSTATE);
} }
when(IsttokEmergency == ON){ when(IsttokEmergency == ON){
strcpy(msg, "Emergency from Stopped"); strcpy(msg, "Emergency from Stopped");
pvPut(msg); pvPut(msg);
@@ -355,19 +371,21 @@ ss PulseSequence {
IsttokOPSTATE = POS_Stopped; IsttokOPSTATE = POS_Stopped;
pvPut(IsttokOPSTATE); pvPut(IsttokOPSTATE);
} state Emergency } state Emergency
when (IsttokOPREQ == START) {
when ((IsttokOPREQ == START) && (IsttokupsBatteryON != ON)) {
strcpy(msg, "State to Starting"); strcpy(msg, "State to Starting");
pvPut(msg); pvPut(msg);
errlogSevPrintf(NO_ALARM, "%s\n",msg); errlogSevPrintf(NO_ALARM, "%s\n",msg);
/* Pulse state change to Starting */ /* Pulse state change to Starting */
} state Starting } state Starting
} }
/* State Starting */
/******** State Starting ***********************/
state Starting { state Starting {
entry{ entry{
IsttokOPSTATE = POS_Starting; IsttokOPSTATE = POS_Starting;
pvPut(IsttokOPSTATE); pvPut(IsttokOPSTATE);
} }
when(IsttokEmergency == ON) { when(IsttokEmergency == ON) {
strcpy(msg, "Emergency from Starting"); strcpy(msg, "Emergency from Starting");
pvPut(msg); pvPut(msg);
@@ -380,39 +398,53 @@ ss PulseSequence {
errlogSevPrintf(MINOR, "%s\n",msg); errlogSevPrintf(MINOR, "%s\n",msg);
/* Pulse state change to Stopping */ /* Pulse state change to Stopping */
} state Stopping } state Stopping
when (STARTINGSTATE == STRST_StartingEnd ) { when (STARTINGSTATE == STRST_StartingEnd ) {
strcpy(msg, "State to Process"); strcpy(msg, "State to Idle");
pvPut(msg); pvPut(msg);
errlogSevPrintf(NO_ALARM, "%s\n",msg); errlogSevPrintf(NO_ALARM, "%s\n",msg);
/* Pulse state change to Process*/ /* Pulse state change to Idle*/
} state Process } state Idle
} }
/* State Process */
state Process { /********** State Idle ****************************/
entry{ state Idle {
IsttokOPSTATE = POS_Process; entry{
IsttokOPSTATE = POS_Idle;
pvPut(IsttokOPSTATE); pvPut(IsttokOPSTATE);
IsttokLastOPSTATE = POS_Process; IsttokLastOPSTATE = POS_Idle;
pvPut(IsttokLastOPSTATE); pvPut(IsttokLastOPSTATE);
IsttokShotShot_TorPSDisable = PCF_RELAY_OFF; IsttokShotShot_TorPSDisable = PCF_RELAY_OFF;
pvPut(IsttokShotShot_TorPSDisable); pvPut(IsttokShotShot_TorPSDisable);
IsttokProcReq = STOP; IsttokProcReq = STOP;
pvPut(IsttokProcReq); pvPut(IsttokProcReq);
} }
when (IsttokupsBatteryON == ON) {
strcpy(msg, "Power Emergency, go to Stopping");
pvPut(msg);
errlogSevPrintf(MAJOR, "%s\n",msg);
IsttokOPREQ = STOP;
pvPut(IsttokOPREQ);
/* State change to Stopping */
IsttokOPSTATE = POS_Stopping;
pvPut(IsttokOPSTATE);
} state Stopping
when(IsttokEmergency == ON){ when(IsttokEmergency == ON){
strcpy(msg, "Emergency from Process"); strcpy(msg, "Emergency from Idle");
pvPut(msg); pvPut(msg);
errlogSevPrintf(MAJOR, "%s\n",msg); errlogSevPrintf(MAJOR, "%s\n",msg);
/* 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 Idle");
sprintf(sendMail, "R1:%1.1e R2:%.1e T1:%d T2:%d",IsttokRPump1_Pressure,IsttokRPump2_Pressure,IsttokTMPump1_Emergency,IsttokTMPump2_Emergency); sprintf(sendMail, "Rpump1:%1.1e TMP1:%d",IsttokRPump1_Pressure,IsttokTMPump1_Emergency);
pvPut(sendMail); pvPut(sendMail);
} state Stopping } state Stopping
@@ -439,22 +471,24 @@ ss PulseSequence {
/* Pulse state change to WaitShot */ /* Pulse state change to WaitShot */
} state WaitShot } state WaitShot
} }
/* State Clean */
/******* State Clean ***************************/
state Clean { state Clean {
entry{ entry{
IsttokOPSTATE = POS_Clean; IsttokOPSTATE = POS_Clean;
pvPut(IsttokOPSTATE); pvPut(IsttokOPSTATE);
} }
when ((IsttokProcReq==STOP) && (CLEANINGSTATE == CLNST_NonCleaning)) { when ((IsttokProcReq==STOP) && (CLEANINGSTATE == CLNST_NonCleaning)) {
strcpy(msg, "State to Process F Clean"); strcpy(msg, "State to Idle From Clean");
pvPut(msg); pvPut(msg);
errlogSevPrintf(NO_ALARM, "%s\n",msg); errlogSevPrintf(NO_ALARM, "%s\n",msg);
} state Process } state Idle
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);
@@ -470,9 +504,10 @@ ss PulseSequence {
/* Pulse state change to Emergency*/ /* Pulse state change to Emergency*/
} state Emergency } state Emergency
} }
/* State WaitShot */
/******** State WaitShot *************************/
state WaitShot { state WaitShot {
entry{ entry{
strcpy(msg, "Toroidal Shot Enable"); strcpy(msg, "Toroidal Shot Enable");
pvPut(msg); pvPut(msg);
errlogSevPrintf(NO_ALARM, "%s\n",msg); errlogSevPrintf(NO_ALARM, "%s\n",msg);
@@ -480,7 +515,17 @@ ss PulseSequence {
pvPut(IsttokShotShot_TorPSDisable); pvPut(IsttokShotShot_TorPSDisable);
IsttokOPSTATE = POS_WaitShot; IsttokOPSTATE = POS_WaitShot;
pvPut(IsttokOPSTATE); pvPut(IsttokOPSTATE);
} }
when (IsttokupsBatteryON == ON) {
strcpy(msg, "Power Emergency, go to Stopping");
pvPut(msg);
errlogSevPrintf(MAJOR, "%s\n",msg);
IsttokOPREQ = STOP;
pvPut(IsttokOPREQ);
/* State change to Stopping */
IsttokOPSTATE = POS_Stopping;
pvPut(IsttokOPSTATE);
} state Stopping
when(IsttokEmergency == ON){ when(IsttokEmergency == ON){
strcpy(msg, "Emergency from WaitShot"); strcpy(msg, "Emergency from WaitShot");
pvPut(msg); pvPut(msg);
@@ -488,17 +533,18 @@ ss PulseSequence {
/* Pulse state change to Emergency*/ /* Pulse state change to Emergency*/
} state Emergency } state Emergency
when (IsttokProcReq==STOP ) { when (IsttokProcReq==STOP ) {
strcpy(msg, "State to Process"); strcpy(msg, "State to Idle");
pvPut(msg); pvPut(msg);
errlogSevPrintf(MINOR, "%s\n",msg); errlogSevPrintf(MINOR, "%s\n",msg);
} state Process } state Idle
when (IsttokOPREQ == STOP) { when (IsttokOPREQ == STOP) {
/* 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);
@@ -507,9 +553,10 @@ ss PulseSequence {
errlogSevPrintf(MAJOR, "%s\n",msg); errlogSevPrintf(MAJOR, "%s\n",msg);
} state Stopping } state Stopping
} }
/* State Stopping */
/* ************** State Stopping *********** */
state Stopping { state Stopping {
entry{ entry{
/*Just to be sure */ /*Just to be sure */
IsttokProcReq = STOP; IsttokProcReq = STOP;
pvPut(IsttokProcReq); pvPut(IsttokProcReq);
@@ -520,7 +567,7 @@ ss PulseSequence {
pvPut(IsttokLastOPSTATE); pvPut(IsttokLastOPSTATE);
} }
when (IsttokOPREQ == START ) { when ((IsttokOPREQ == START) && (IsttokupsBatteryON != ON) ) {
strcpy(msg, "State to Starting"); strcpy(msg, "State to Starting");
pvPut(msg); pvPut(msg);
errlogSevPrintf(NO_ALARM, "%s\n",msg); errlogSevPrintf(NO_ALARM, "%s\n",msg);
@@ -543,25 +590,25 @@ ss PulseSequence {
errlogSevPrintf(MAJOR, "%s\n",msg); errlogSevPrintf(MAJOR, "%s\n",msg);
IsttokShotShot_TorPSDisable = PCF_RELAY_OFF; IsttokShotShot_TorPSDisable = PCF_RELAY_OFF;
pvPut(IsttokShotShot_TorPSDisable); pvPut(IsttokShotShot_TorPSDisable);
strcpy(msg, "EMERGENCY: CAPBANK Charge OFF"); strcpy(msg, "EMERGENCY: CAPBANK Charge OFF");
pvPut(msg); pvPut(msg);
errlogSevPrintf(NO_ALARM, "%s\n",msg); errlogSevPrintf(NO_ALARM, "%s\n",msg);
IsttokShotCapBank_Charge = PCF_RELAY_OFF; IsttokShotCapBank_Charge = PCF_RELAY_OFF;
pvPut(IsttokShotCapBank_Charge); pvPut(IsttokShotCapBank_Charge);
strcpy(msg, "EMERGENCY: CAPBANK CrowBar Close"); strcpy(msg, "EMERGENCY: CAPBANK CrowBar Close");
pvPut(msg); pvPut(msg);
errlogSevPrintf(NO_ALARM, "%s\n",msg); errlogSevPrintf(NO_ALARM, "%s\n",msg);
IsttokShotCapBank_Discharge = PCF_RELAY_OFF; IsttokShotCapBank_Discharge = PCF_RELAY_OFF;
pvPut(IsttokShotCapBank_Discharge); pvPut(IsttokShotCapBank_Discharge);
strcpy(msg, "EMERGENCY: GIS Valves CLOSE"); strcpy(msg, "EMERGENCY: GIS Valves CLOSE");
pvPut(msg); pvPut(msg);
errlogSevPrintf(NO_ALARM, "%s\n",msg); errlogSevPrintf(NO_ALARM, "%s\n",msg);
IsttokShotGasIS_Valves = PCF_RELAY_OFF; IsttokShotGasIS_Valves = PCF_RELAY_OFF;
pvPut(IsttokShotGasIS_Valves); pvPut(IsttokShotGasIS_Valves);
strcpy(msg, "EMERGENCY: Filament OFF"); strcpy(msg, "EMERGENCY: Filament OFF");
pvPut(msg); pvPut(msg);
errlogSevPrintf(MAJOR, "%s\n",msg); errlogSevPrintf(MAJOR, "%s\n",msg);
@@ -569,23 +616,23 @@ ss PulseSequence {
pvPut(IsttokShotVVessel_Filament); pvPut(IsttokShotVVessel_Filament);
} }
when (delay(1.0) && (IsttokEmergency == OFF) && (IsttokOPSTATE == POS_WaitShot || IsttokOPSTATE==POS_Clean) ){ when (delay(1.0) && (IsttokEmergency == OFF) && (IsttokOPSTATE == POS_WaitShot || IsttokOPSTATE==POS_Clean) ){
/* Pulse state change to Process */ /* Pulse state change to Idle */
strcpy(msg, "State to Process"); strcpy(msg, "State to Idle");
pvPut(msg); pvPut(msg);
errlogSevPrintf(NO_ALARM, "%s\n",msg); errlogSevPrintf(NO_ALARM, "%s\n",msg);
IsttokProcReq = STOP; IsttokProcReq = STOP;
pvPut(IsttokProcReq); pvPut(IsttokProcReq);
IsttokOPSTATE = POS_Process; IsttokOPSTATE = POS_Idle;
pvPut(IsttokOPSTATE); pvPut(IsttokOPSTATE);
} state Process } state Idle
when (delay(1.0) && (IsttokEmergency == OFF) && (IsttokOPSTATE == POS_Process)){ when (delay(1.0) && (IsttokEmergency == OFF) && (IsttokOPSTATE == POS_Idle)){
/* Pulse state change to Process */ /* Pulse state change to Idle */
strcpy(msg, "State to Process"); strcpy(msg, "State to Idle");
pvPut(msg); pvPut(msg);
errlogSevPrintf(NO_ALARM, "%s\n",msg); errlogSevPrintf(NO_ALARM, "%s\n",msg);
IsttokOPSTATE = POS_Process; IsttokOPSTATE = POS_Idle;
pvPut(IsttokOPSTATE); pvPut(IsttokOPSTATE);
} state Process } state Idle
when (delay(1.0) && (IsttokEmergency == OFF) && (IsttokOPSTATE == POS_Starting)){ when (delay(1.0) && (IsttokEmergency == OFF) && (IsttokOPSTATE == POS_Starting)){
// TODO Check these 2 transictions // TODO Check these 2 transictions
strcpy(msg, "State to Stopped"); strcpy(msg, "State to Stopped");
@@ -599,7 +646,7 @@ ss PulseSequence {
} state Stopped } state Stopped
when (delay(1.0) && (IsttokEmergency == OFF) && (IsttokOPSTATE == POS_Stopped)){ when (delay(1.0) && (IsttokEmergency == OFF) && (IsttokOPSTATE == POS_Stopped)){
strcpy(msg, "State to Stopped"); strcpy(msg, "State to Stopped");
pvPut(msg); pvPut(msg);
errlogSevPrintf(NO_ALARM, "%s\n",msg); errlogSevPrintf(NO_ALARM, "%s\n",msg);
@@ -677,8 +724,9 @@ 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);
errlogSevPrintf(NO_ALARM, "%s\n",msg); errlogSevPrintf(NO_ALARM, "%s\n",msg);
@@ -687,8 +735,8 @@ ss StartingSequence {
strcpy(msg, "TMP2 Motor ON" ); strcpy(msg, "TMP2 Motor ON" );
pvPut(msg); pvPut(msg);
errlogSevPrintf(NO_ALARM, "%s\n",msg); errlogSevPrintf(NO_ALARM, "%s\n",msg);
IsttokTMPump2_Motor = PCF_RELAY_ON; // IsttokTMPump2_Motor = PCF_RELAY_ON;
pvPut(IsttokTMPump2_Motor); // pvPut(IsttokTMPump2_Motor);
STARTINGSTATE = STRST_Starting4; STARTINGSTATE = STRST_Starting4;
pvPut(STARTINGSTATE); pvPut(STARTINGSTATE);
} state Starting4 } state Starting4
@@ -701,7 +749,7 @@ ss StartingSequence {
//IsttokSTARTINGSTATE = STRST_NonStarting; //IsttokSTARTINGSTATE = STRST_NonStarting;
//pvPut(IsttokSTARTINGSTATE); //pvPut(IsttokSTARTINGSTATE);
} state NonStarting } state NonStarting
when (TMPump1NormalOperation == PCF_INPUT_ON) { // TODO insert TMP2 Test when (TMPump1NormalOperation == PCF_INPUT_ON) { // TODO insert TMP2 Test
strcpy(msg, "TMP1 operating Normal"); strcpy(msg, "TMP1 operating Normal");
pvPut(msg); pvPut(msg);
errlogSevPrintf(NO_ALARM, "%s\n",msg); errlogSevPrintf(NO_ALARM, "%s\n",msg);
@@ -721,15 +769,15 @@ ss CleaningSequence{
state NonCleaning{ state NonCleaning{
entry{ entry{
strcpy(msg, "GIS Valves CLOSE"); strcpy(msg, "GIS Valves CLOSE");
pvPut(msg); pvPut(msg);
IsttokShotGasIS_Valves = PCF_RELAY_OFF; IsttokShotGasIS_Valves = PCF_RELAY_OFF;
pvPut(IsttokShotGasIS_Valves); pvPut(IsttokShotGasIS_Valves);
strcpy(msg, "Filament OFF"); strcpy(msg, "Filament OFF");
pvPut(msg); pvPut(msg);
IsttokShotVVessel_Filament = PCF_RELAY_OFF; IsttokShotVVessel_Filament = PCF_RELAY_OFF;
pvPut(IsttokShotVVessel_Filament); pvPut(IsttokShotVVessel_Filament);
strcpy(msg, "Primary_CT OFF"); strcpy(msg, "Primary_CT OFF");
pvPut(msg); pvPut(msg);
IsttokShotClean_PrimContactor = PCF_RELAY_OFF; IsttokShotClean_PrimContactor = PCF_RELAY_OFF;
@@ -848,7 +896,7 @@ ss CleaningSequence{
} }
state Cleaning5{ state Cleaning5{
when (IsttokProcReq==STOP) { when (IsttokProcReq==STOP) {
// } state Process // } state Idle
// when(delay(1.0) && IsttokOPSTATE != POS_Clean){ // when(delay(1.0) && IsttokOPSTATE != POS_Clean){
strcpy(msg, "Toroidal-CT OFF"); strcpy(msg, "Toroidal-CT OFF");
pvPut(msg); pvPut(msg);
@@ -861,14 +909,16 @@ ss CleaningSequence{
CLEANINGSTATE = CLNST_Cleaning4; CLEANINGSTATE = CLNST_Cleaning4;
pvPut(CLEANINGSTATE); pvPut(CLEANINGSTATE);
} state Cleaning4 } state Cleaning4
when (pvSeverity(IsttokVVesselTemperature) >= pvSevrMAJOR) { /*
/* Temperature Limit Pulse state change to Process */ when (pvSeverity(IsttokVVesselTemperature) >= pvSevrMAJOR) {
// Temperature Limit Pulse state change to Idle
IsttokProcReq = STOP; IsttokProcReq = STOP;
pvPut(IsttokProcReq); pvPut(IsttokProcReq);
strcpy(msg, "Temperature Limit-> State to Process"); strcpy(msg, "Temperature Limit-> State to Idle");
pvPut(msg); pvPut(msg);
errlogSevPrintf(MINOR, "%s\n",msg); errlogSevPrintf(MINOR, "%s\n",msg);
} state Cleaning5 } state Cleaning5
*/
} }
} }
@@ -895,7 +945,7 @@ ss ShotSequence {
} state ShotEnd } state ShotEnd
} }
state ShotWaitTrg { state ShotWaitTrg {
when ((IsttokShotCountdown > 1800) || (IsttokOPSTATE != POS_WaitShot)) { when ((IsttokShotCountdown > 1800) || (IsttokOPSTATE != POS_WaitShot)) {
strcpy(msg, "Shooting Out"); strcpy(msg, "Shooting Out");
pvPut(msg); pvPut(msg);
errlogSevPrintf(NO_ALARM, "%s\n",msg); errlogSevPrintf(NO_ALARM, "%s\n",msg);
@@ -921,7 +971,7 @@ ss ShotSequence {
strcpy(msg, "Shoting 2 Out"); strcpy(msg, "Shoting 2 Out");
pvPut(msg); pvPut(msg);
errlogSevPrintf(NO_ALARM, "%s\n",msg); errlogSevPrintf(NO_ALARM, "%s\n",msg);
} state ShotWaitTrg } state ShotWaitTrg
when ((IsttokOPSTATE == POS_WaitShot) && (IsttokShotCountdown == -61)) { when ((IsttokOPSTATE == POS_WaitShot) && (IsttokShotCountdown == -61)) {
strcpy(msg, "Buzzer 1-Sound"); strcpy(msg, "Buzzer 1-Sound");
pvPut(msg); pvPut(msg);
@@ -947,7 +997,7 @@ ss ShotSequence {
strcpy(msg, "Shoting3 Out"); strcpy(msg, "Shoting3 Out");
pvPut(msg); pvPut(msg);
errlogSevPrintf(NO_ALARM, "%s\n",msg); errlogSevPrintf(NO_ALARM, "%s\n",msg);
} state ShotWaitTrg } state ShotWaitTrg
when (IsttokShotCountdown == -60) { when (IsttokShotCountdown == -60) {
strcpy(msg, "GIS Valves OPEN"); strcpy(msg, "GIS Valves OPEN");
pvPut(msg); pvPut(msg);
@@ -1044,7 +1094,7 @@ ss ShotSequence {
errlogSevPrintf(NO_ALARM, "%s\n",msg); errlogSevPrintf(NO_ALARM, "%s\n",msg);
// PS Trigger Pulse // PS Trigger Pulse
IsttokShotShot_TorPSTrigger = ON; IsttokShotShot_TorPSTrigger = ON;
pvPut(IsttokShotShot_TorPSTrigger); pvPut(IsttokShotShot_TorPSTrigger);
WSHOTINGSTATE = WSHTST_Shoting9; WSHOTINGSTATE = WSHTST_Shoting9;
pvPut(WSHOTINGSTATE); pvPut(WSHOTINGSTATE);
} state Shoting9 } state Shoting9
@@ -1125,13 +1175,13 @@ ss ShotSequence {
} state ShotEnd } state ShotEnd
} }
state ShotEnd { state ShotEnd {
when (IsttokShotCountdown > 160 || IsttokOPSTATE != POS_WaitShot) { when (IsttokShotCountdown > 160 || IsttokOPSTATE != POS_WaitShot) {
strcpy(msg, "Terminated"); strcpy(msg, "Terminated");
pvPut(msg); pvPut(msg);
errlogSevPrintf(NO_ALARM, "%s\n", msg); errlogSevPrintf(NO_ALARM, "%s\n", msg);
WSHOTINGSTATE = WSHTST_WaitTrg; WSHOTINGSTATE = WSHTST_WaitTrg;
pvPut(WSHOTINGSTATE); pvPut(WSHOTINGSTATE);
} state ShotWaitTrg } state ShotWaitTrg
} }
} }
@@ -1139,7 +1189,7 @@ ss ShotSequence {
ss StoppingSequence { ss StoppingSequence {
state NonStopping { state NonStopping {
entry { entry {
STOPPINGSTATE = STPST_NonStopping; STOPPINGSTATE = STPST_NonStopping;
pvPut(STOPPINGSTATE); pvPut(STOPPINGSTATE);
} }
when (IsttokOPSTATE == POS_Stopping) { when (IsttokOPSTATE == POS_Stopping) {
@@ -1150,25 +1200,25 @@ ss StoppingSequence {
IsttokTMPump1_MotorOff = ON; IsttokTMPump1_MotorOff = ON;
pvPut(IsttokTMPump1_MotorOff); pvPut(IsttokTMPump1_MotorOff);
IsttokTMPump2_Motor = PCF_RELAY_OFF; // IsttokTMPump2_Motor = PCF_RELAY_OFF;
pvPut(IsttokTMPump2_Motor); // pvPut(IsttokTMPump2_Motor);
STOPPINGSTATE = STPST_Stopping1; STOPPINGSTATE = STPST_Stopping1;
pvPut(STOPPINGSTATE); pvPut(STOPPINGSTATE);
} state Stopping1 } state Stopping1
} }
state Stopping1 { state Stopping1 {
when (IsttokOPSTATE != POS_Stopping ) { } state NonStopping when (IsttokOPSTATE != POS_Stopping ) { } state NonStopping
when (TMPump1NormalOperation == PCF_INPUT_OFF) { // TODO insert TMP2 Test when (TMPump1NormalOperation == PCF_INPUT_OFF) { // TODO insert TMP2 Test
strcpy(msg, "TMP1 Stopping"); strcpy(msg, "TMP1 Stopping");
pvPut(msg); pvPut(msg);
errlogSevPrintf(NO_ALARM, "%s\n",msg); errlogSevPrintf(NO_ALARM, "%s\n",msg);
STOPPINGSTATE = STPST_Stopping2; STOPPINGSTATE = STPST_Stopping2;
pvPut(STOPPINGSTATE); pvPut(STOPPINGSTATE);
} state Stopping2 } state Stopping2
} }
state Stopping2 { state Stopping2 {
when (IsttokOPSTATE != POS_Stopping ) { when (IsttokOPSTATE != POS_Stopping ) {
} state NonStopping } state NonStopping
when (delay(5.0) && IsttokTMPump1_ManualValve==OFF) { when (delay(5.0) && IsttokTMPump1_ManualValve==OFF) {
strcpy(msg, "Manual Valve Closed Checked"); strcpy(msg, "Manual Valve Closed Checked");
pvPut(msg); pvPut(msg);
@@ -1182,11 +1232,11 @@ ss StoppingSequence {
pvPut(IsttokRPump2_Motor); pvPut(IsttokRPump2_Motor);
STOPPINGSTATE = STPST_Stopping3; STOPPINGSTATE = STPST_Stopping3;
pvPut(STOPPINGSTATE); pvPut(STOPPINGSTATE);
} state Stopping3 } state Stopping3
} }
state Stopping3 { state Stopping3 {
when (IsttokOPSTATE != POS_Stopping ) { when (IsttokOPSTATE != POS_Stopping ) {
} state NonStopping } state NonStopping
when (delay(5)) { when (delay(5)) {
IsttokRPump1_Valve = PCF_RELAY_ON; IsttokRPump1_Valve = PCF_RELAY_ON;
pvPut(IsttokRPump1_Valve); pvPut(IsttokRPump1_Valve);
@@ -1197,15 +1247,15 @@ ss StoppingSequence {
pvPut(IsttokRPump2_Valve); pvPut(IsttokRPump2_Valve);
STOPPINGSTATE = STPST_StoppingEnd; STOPPINGSTATE = STPST_StoppingEnd;
pvPut(STOPPINGSTATE); pvPut(STOPPINGSTATE);
} state StoppingEnd } state StoppingEnd
} }
state StoppingEnd { state StoppingEnd {
when (IsttokOPSTATE != POS_Stopping ) { } state NonStopping when (IsttokOPSTATE != POS_Stopping ) { } state NonStopping
} }
} }
/**** END PROGRAM ***/ /**** END PROGRAM ***/
/* when (IsttokShotCountdown > 159) { /* when (IsttokShotCountdown > 159) {
strcpy(msg, "Toroidal Field Recovered" ); strcpy(msg, "Toroidal Field Recovered" );
pvPut(msg); pvPut(msg);
@@ -1229,12 +1279,12 @@ ss StoppingSequence {
// pvPut(IsttokShotCountdownScan); // pvPut(IsttokShotCountdownScan);
// IsttokShotCountdown = 0; // IsttokShotCountdown = 0;
// pvPut(IsttokShotCountdown); // pvPut(IsttokShotCountdown);
} state ShotWaitTrg } state ShotWaitTrg
} }
entry{ entry{
IsttokRPump1_Motor = PCF_RELAY_ON; IsttokRPump1_Motor = PCF_RELAY_ON;
pvPut(IsttokRPump1_Motor); pvPut(IsttokRPump1_Motor);
strcpy(msg, "Rotary Pumps 1/2 OFF"); strcpy(msg, "Rotary Pumps 1/2 OFF");
@@ -1242,7 +1292,7 @@ ss StoppingSequence {
errlogSevPrintf(NO_ALARM, "%s\n",msg); errlogSevPrintf(NO_ALARM, "%s\n",msg);
IsttokRPump2_Motor = PCF_RELAY_ON; IsttokRPump2_Motor = PCF_RELAY_ON;
pvPut(IsttokRPump2_Motor); pvPut(IsttokRPump2_Motor);
//IsttokLastOPSTATE = POS_Process; //IsttokLastOPSTATE = POS_Idle;
//pvPut(IsttokLastOPSTATE); //pvPut(IsttokLastOPSTATE);
} }
// } state Stopping // } state Stopping

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)

Binary file not shown.

Binary file not shown.

View File

@@ -23,8 +23,7 @@ CHECK_RELEASE = YES
# To install files into a location other than $(TOP) define # To install files into a location other than $(TOP) define
# INSTALL_LOCATION here. # INSTALL_LOCATION here.
INSTALL_LOCATION=/opt/epics/iocs/ISTTOKrpi #INSTALL_LOCATION=</absolute/path/to/install/top>
#</absolute/path/to/install/top>
# Set this when the IOC and build host use different paths # Set this when the IOC and build host use different paths
# to the install location. This may be needed to boot from # to the install location. This may be needed to boot from

View File

@@ -1,13 +1,12 @@
# RELEASE - Location of external support modules # RELEASE - Location of external support modules
# #
# IF YOU MAKE ANY CHANGES to this file you must subsequently # IF YOU CHANGE ANY PATHS in this file or make API changes to
# do a "gnumake rebuild" in this application's top level # any modules it refers to, you should do a "make rebuild" in
# directory. # this application's top level directory.
# #
# The build process does not check dependencies against files # The EPICS build process does not check dependencies against
# that are outside this application, thus you should do a # any files from outside the application, so it is safest to
# "gnumake rebuild" in the top level directory after EPICS_BASE # rebuild it completely if any modules it depends on change.
# or any other external module pointed to below is rebuilt.
# #
# Host- or target-specific settings can be given in files named # Host- or target-specific settings can be given in files named
# RELEASE.$(EPICS_HOST_ARCH).Common # RELEASE.$(EPICS_HOST_ARCH).Common
@@ -15,7 +14,7 @@
# RELEASE.$(EPICS_HOST_ARCH).$(T_A) # RELEASE.$(EPICS_HOST_ARCH).$(T_A)
# #
# This file is parsed by both GNUmake and an EPICS Perl script, # This file is parsed by both GNUmake and an EPICS Perl script,
# so it can ONLY contain definititions of paths to other support # so it may ONLY contain definititions of paths to other support
# modules, variable definitions that are used in module paths, # modules, variable definitions that are used in module paths,
# and include statements that pull in other RELEASE files. # and include statements that pull in other RELEASE files.
# Variables may be used before their values have been set. # Variables may be used before their values have been set.
@@ -23,25 +22,21 @@
# the CONFIG_SITE file. # the CONFIG_SITE file.
# Variables and paths to dependent modules: # Variables and paths to dependent modules:
SUPPORT=$(EPICS_BASE)/../synApps_5_8/support #MODULES = /path/to/modules
#MYMODULE = $(MODULES)/my-module
# If using the sequencer, point SNCSEQ at its top directory: # If using the sequencer, point SNCSEQ at its top directory:
SNCSEQ = $(SUPPORT)/seq-2-2-1 #SNCSEQ = $(MODULES)/seq-ver
ASYN = $(SUPPORT)/asyn-4-26
STREAM = $(SUPPORT)/stream-2-6a
AUTOSAVE = $(SUPPORT)/autosave-5-6-1
DRVASYNI2C = $(EPICS_BASE)/../modules/drvAsynI2C
#
# EPICS_BASE should appear last so earlier modules can override stuff: # EPICS_BASE should appear last so earlier modules can override stuff:
EPICS_BASE = /usr/local/epics/base EPICS_BASE = /home/pi/Apps/epics7/epics-base
# Set RULES here if you want to use build rules from somewhere # Set RULES here if you want to use build rules from somewhere
# other than EPICS_BASE: # other than EPICS_BASE:
#RULES = $(MODULES)/build-rules #RULES = $(MODULES)/build-rules
# These allow developers to override the RELEASE variable settings # These lines allow developers to override these RELEASE settings
# without having to modify the configure/RELEASE file itself. # without having to modify this file directly.
-include $(TOP)/../RELEASE.local -include $(TOP)/../RELEASE.local
-include $(TOP)/../RELEASE.$(EPICS_HOST_ARCH).local
-include $(TOP)/configure/RELEASE.local -include $(TOP)/configure/RELEASE.local

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,4 +1,5 @@
UAG(uag) {pi,opertok,codac-dev,pricardofc} #UAG(uag) {pi,root,opertok,codac-dev,pricardofc}
UAG(uag) {pi,root,opertok,codac-dev}
HAG(hag) {rpi-isttok,opertok-desktop,atca2} HAG(hag) {rpi-isttok,opertok-desktop,atca2}
ASG(DEFAULT) { ASG(DEFAULT) {
RULE(1,READ) RULE(1,READ)

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

@@ -9,10 +9,9 @@ ISTTOK:central:CLEANINGMANMODE.VAL
ISTTOK:central:Emergency-UserButton.VAL ISTTOK:central:Emergency-UserButton.VAL
ISTTOK:central:TMPump1-ManualValve.VAL ISTTOK:central:TMPump1-ManualValve.VAL
ISTTOK:central:Shot-TorPSCurrent ISTTOK:central:Shot-TorPSCurrent
ISTTOK:central:UPS-Shutdown
#ALARM Limits #ALARM Limits
ISTTOK:central:RPump1-Pressure.HIGH #ISTTOK:central:RPump2-Pressure.HIGH
ISTTOK:central:RPump1-Pressure.HIHI #ISTTOK:central:RPump2-Pressure.HIHI
ISTTOK:central:RPump2-Pressure.HIGH
ISTTOK:central:RPump2-Pressure.HIHI

View File

@@ -1,75 +1,8 @@
ISTTOK:central:CurrentTime
ISTTOK:central:OPCALCSTATE
ISTTOK:central:STARTCALCSTATE
ISTTOK:central:STOPPINGCALCSTATE
ISTTOK:central:CLEANCALCSTATE
ISTTOK:central:WSHOTCALCSTATE
ISTTOK:central:COUNTDOWN
ISTTOK:central:COUNTER
ISTTOK:central:PCF8591:72:BYTE2_CH1
ISTTOK:central:PCF8591:72:BYTE2_CH2
ISTTOK:central:PCF8591:72:BYTE2_CH3
ISTTOK:central:Emergency
ISTTOK:central:VVessel-Pressure
ISTTOK:central:RPump1-Pressure
ISTTOK:central:TMPump1-PressureAdmission
ISTTOK:central:RPump2-Pressure
ISTTOK:central:TMPump2-Speed
ISTTOK:central:TMPump2-Current
ISTTOK:central:Shot-TorPSCurrentImage
ISTTOK:central:PCF8574:56:REGISTER
ISTTOK:central:PCF8574:57:REGISTER
ISTTOK:central:PCF8574:60:REGISTER
ISTTOK:central:PCF8574:61:REGISTER
ISTTOK:central:PCF8591:72:CTRLREGISTER
ISTTOK:central:PULSE-NUMBER
ISTTOK:central:PCF8591:72:DAC
ISTTOK:central:TDA8444:32:DAC_CH0
ISTTOK:central:TDA8444:32:DAC_CH1
ISTTOK:central:TDA8444:32:DAC_CH2
ISTTOK:central:TDA8444:32:DAC_CH3
ISTTOK:central:TDA8444:32:DAC_CH4
ISTTOK:central:TDA8444:32:DAC_CH5
ISTTOK:central:TDA8444:32:DAC_CH6
ISTTOK:central:Shot-TorPSCurrent
ISTTOK:SR_0_State
ISTTOK:SR_1_State
ISTTOK:SR_2_State
ISTTOK:SR_3_State
ISTTOK:SR_4_State
ISTTOK:SR_5_State
ISTTOK:SR_6_State
ISTTOK:SR_7_State
ISTTOK:central:PCF8591:72:ADC_CH1 ISTTOK:central:PCF8591:72:ADC_CH1
ISTTOK:central:PCF8591:72:ADC_CH2 ISTTOK:central:PCF8591:72:ADC_CH2
ISTTOK:central:PCF8591:72:ADC_CH3 ISTTOK:central:PCF8591:72:ADC_CH3
ISTTOK:central:P001:M ISTTOK:central:UPS-OnBattery
ISTTOK:central:P001:E ISTTOK:central:UPS-Shutdown
ISTTOK:central:P002:M
ISTTOK:central:P002:E
ISTTOK:central:P003:M
ISTTOK:central:P003:E
ISTTOK:central:P004:M
ISTTOK:central:P004:E
ISTTOK:central:OPSTATE
ISTTOK:central:STARTINGSTATE
ISTTOK:central:CLEANINGSTATE
ISTTOK:central:WSHOTINGSTATE
ISTTOK:central:STOPPINGSTATE
ISTTOK:central:TMPump1-Power
ISTTOK:central:TMPump1-Emergency
ISTTOK:central:TMPump1-Acceleration
ISTTOK:central:TMPump1-NormalOperation
ISTTOK:central:TMPump2-Emergency
ISTTOK:central:TMPump2-Acceleration
ISTTOK:central:TTSystem-tzero
ISTTOK:central:Emergency-PhysButton
ISTTOK:central:TMPump1-ControllerOnInv
ISTTOK:central:TMPump1-ControllerOffInv
ISTTOK:central:TMPump1-MotorOnInv
ISTTOK:central:TMPump1-MotorOffInv
ISTTOK:central:BuzzerInv
ISTTOK:central:Shot-TorPSTriggerInv
ISTTOK:central:OPREQ ISTTOK:central:OPREQ
ISTTOK:central:CLEANINGMANMODE ISTTOK:central:CLEANINGMANMODE
ISTTOK:central:FSTriggerStart ISTTOK:central:FSTriggerStart
@@ -102,6 +35,45 @@ ISTTOK:central:TMPump1-ManualValve
ISTTOK:SR_heartbeat ISTTOK:SR_heartbeat
ISTTOK:SR_i_am_alive ISTTOK:SR_i_am_alive
ISTTOK:SR_deadIfZero ISTTOK:SR_deadIfZero
ISTTOK:SR_disable
ISTTOK:central:PULSE-NUMBER
ISTTOK:central:PCF8591:72:DAC
ISTTOK:central:TDA8444:32:DAC_CH0
ISTTOK:central:TDA8444:32:DAC_CH1
ISTTOK:central:TDA8444:32:DAC_CH2
ISTTOK:central:TDA8444:32:DAC_CH3
ISTTOK:central:TDA8444:32:DAC_CH4
ISTTOK:central:TDA8444:32:DAC_CH5
ISTTOK:central:TDA8444:32:DAC_CH6
ISTTOK:central:Shot-TorPSCurrent
ISTTOK:SR_0_State
ISTTOK:SR_1_State
ISTTOK:SR_2_State
ISTTOK:SR_3_State
ISTTOK:SR_4_State
ISTTOK:SR_5_State
ISTTOK:SR_6_State
ISTTOK:SR_7_State
ISTTOK:SR_disableMaxSecs
ISTTOK:central:PCF8574:56:REGISTER:READ:FNOUT
ISTTOK:central:PCF8574:57:REGISTER:READ:FNOUT
ISTTOK:central:OPCALCSTATE
ISTTOK:central:STARTCALCSTATE
ISTTOK:central:STOPPINGCALCSTATE
ISTTOK:central:CLEANCALCSTATE
ISTTOK:central:WSHOTCALCSTATE
ISTTOK:central:COUNTDOWN
ISTTOK:central:COUNTER
ISTTOK:central:PCF8591:72:BYTE2_CH1
ISTTOK:central:PCF8591:72:BYTE2_CH2
ISTTOK:central:PCF8591:72:BYTE2_CH3
ISTTOK:central:Emergency
ISTTOK:central:TMPump1-ControllerOnInv
ISTTOK:central:TMPump1-ControllerOffInv
ISTTOK:central:TMPump1-MotorOnInv
ISTTOK:central:TMPump1-MotorOffInv
ISTTOK:central:BuzzerInv
ISTTOK:central:Shot-TorPSTriggerInv
ISTTOK:central:LASTOPSTATE ISTTOK:central:LASTOPSTATE
ISTTOK:SR_rebootStatus ISTTOK:SR_rebootStatus
ISTTOK:SR_status ISTTOK:SR_status
@@ -113,13 +85,28 @@ ISTTOK:SR_4_Status
ISTTOK:SR_5_Status ISTTOK:SR_5_Status
ISTTOK:SR_6_Status ISTTOK:SR_6_Status
ISTTOK:SR_7_Status ISTTOK:SR_7_Status
ISTTOK:central:TMPump1-Power
ISTTOK:central:TMPump1-Emergency
ISTTOK:central:TMPump1-Acceleration
ISTTOK:central:TMPump1-NormalOperation
ISTTOK:central:TMPump2-Emergency
ISTTOK:central:TMPump2-Acceleration
ISTTOK:central:TTSystem-tzero
ISTTOK:central:Emergency-PhysButton
ISTTOK:central:PCF8574:56:REGISTER
ISTTOK:central:PCF8574:57:REGISTER
ISTTOK:central:PCF8574:60:REGISTER
ISTTOK:central:PCF8574:61:REGISTER
ISTTOK:central:PCF8591:72:CTRLREGISTER
ISTTOK:central:PCF8574:56:REGISTER:READ ISTTOK:central:PCF8574:56:REGISTER:READ
ISTTOK:central:PCF8574:57:REGISTER:READ ISTTOK:central:PCF8574:57:REGISTER:READ
ISTTOK:central:PCF8574:60:REGISTER:READ ISTTOK:central:PCF8574:60:REGISTER:READ
ISTTOK:central:PCF8574:61:REGISTER:READ ISTTOK:central:PCF8574:61:REGISTER:READ
ISTTOK:central:TMPump2-Speed
ISTTOK:central:TMPump2-Current
ISTTOK:central:Shot-TorPSCurrentImage
ISTTOK:central:TraceMessage ISTTOK:central:TraceMessage
ISTTOK:central:LogMessage ISTTOK:central:LogMessage
ISTTOK:central:RS485Debug
ISTTOK:central:sendmail ISTTOK:central:sendmail
ISTTOK:SR_recentlyStr ISTTOK:SR_recentlyStr
ISTTOK:SR_rebootStatusStr ISTTOK:SR_rebootStatusStr
@@ -149,5 +136,9 @@ ISTTOK:SR_6_Time
ISTTOK:SR_7_Name ISTTOK:SR_7_Name
ISTTOK:SR_7_StatusStr ISTTOK:SR_7_StatusStr
ISTTOK:SR_7_Time ISTTOK:SR_7_Time
ISTTOK:central:PCF8574:56:REGISTER:READ:FNOUT ISTTOK:central:OPSTATE
ISTTOK:central:PCF8574:57:REGISTER:READ:FNOUT ISTTOK:central:STARTINGSTATE
ISTTOK:central:CLEANINGSTATE
ISTTOK:central:WSHOTINGSTATE
ISTTOK:central:STOPPINGSTATE
ISTTOK:central:CurrentTime

View File

@@ -1,15 +1,12 @@
# autosave R5.3 Automatically generated - DO NOT MODIFY - 200127-094325 # autosave R5.3 Automatically generated - DO NOT MODIFY - 211129-172335
ISTTOK:central:PULSE-NUMBER.VAL 48422 ISTTOK:central:PULSE-NUMBER.VAL 0
ISTTOK:central:LogMessage.VAL Emplastro esteve aqui ISTTOK:central:LogMessage.VAL
ISTTOK:central:LASTOPSTATE.VAL 5 ISTTOK:central:LASTOPSTATE.VAL 5
ISTTOK:central:OPREQ 1 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 1
ISTTOK:central:Shot-TorPSCurrent 34 ISTTOK:central:Shot-TorPSCurrent 32
ISTTOK:central:RPump1-Pressure.HIGH 0 ISTTOK:central:UPS-Shutdown 0
ISTTOK:central:RPump1-Pressure.HIHI 0
ISTTOK:central:RPump2-Pressure.HIGH 0
ISTTOK:central:RPump2-Pressure.HIHI 0
<END> <END>

View File

@@ -4,9 +4,9 @@
## everywhere it appears in this file ## everywhere it appears in this file
< envPaths < envPaths
epicsEnvSet( "STREAM_PROTOCOL_PATH", "$(TOP)/protocols" ) epicsEnvSet( "STREAM_PROTOCOL_PATH", "$(TOP)/db" )
epicsEnvSet( "SAVE_DIR", "$(TOP)/iocBoot/$(IOC)" ) epicsEnvSet( "SAVE_DIR", "$(TOP)/iocBoot/$(IOC)" )
epicsEnvSet( "EPICS_CA_ADDR_LIST", "localhost 192.168.1.152") epicsEnvSet( "EPICS_CA_ADDR_LIST", "localhost 192.168.1.120 192.168.1.152")
cd "${TOP}" cd "${TOP}"
@@ -19,23 +19,24 @@ drvAsynI2CConfigure( "I2C", "/dev/i2c-1", 1 )
## Load record instances ## Load record instances
dbLoadRecords("db/ISTTOKstates.db","P=ISTTOK:,R=central:") dbLoadRecords("db/ISTTOKstates.db","P=ISTTOK:,R=central:")
dbLoadRecords("db/ISTTOKpcf8574.db","P=ISTTOK:,R=central:") dbLoadRecords("db/ISTTOKpcf8574.db","P=ISTTOK:,R=central:,BUS=I2C")
dbLoadRecords("db/ISTTOKpcf8591.db","P=ISTTOK:,R=central:") dbLoadRecords("db/ISTTOKpcf8591.db","P=ISTTOK:,R=central:,BUS=I2C")
dbLoadRecords("db/ISTTOKtda8444.db","P=ISTTOK:,R=central:") dbLoadRecords("db/ISTTOKtda8444.db","P=ISTTOK:,R=central:,BUS=I2C")
dbLoadRecords("db/ISTTOKmachineControl.db","P=ISTTOK:,R=central:") dbLoadRecords("db/ISTTOKmachineControl.db","P=ISTTOK:,R=central:")
## Load Serial drivers ## Load Serial drivers
drvAsynSerialPortConfigure("RS0","/dev/ttyUSB0") #drvAsynSerialPortConfigure("RS0","/dev/ttyUSB0")
#drvAsynSerialPortConfigure("RS0","/dev/ttyAMA0") #drvAsynSerialPortConfigure("RS0","/dev/ttyAMA0")
asynSetOption("RS0", 0, "baud", "9600") #asynSetOption("RS0", 0, "baud", "9600")
asynSetOption("RS0", 0, "bits", "8") #asynSetOption("RS0", 0, "bits", "8")
asynSetOption("RS0", 0, "parity", "none") #asynSetOption("RS0", 0, "parity", "none")
asynSetOption("RS0", 0, "stop", "1") #asynSetOption("RS0", 0, "stop", "1")
asynSetOption("RS0", 0, "clocal", "Y") #asynSetOption("RS0", 0, "clocal", "Y")
asynSetOption("RS0", 0, "crtscts", "N") #asynSetOption("RS0", 0, "crtscts", "N")
dbLoadRecords("db/ISTTOKpfeiffer.db","P=ISTTOK:,R=central:,bus=RS0") # Pfeiffer sensor are connectoed to other RPI /(192.168.1.120)
#dbLoadRecords("db/ISTTOKpfeiffer.db","P=ISTTOK:,R=central:,bus=RS0")
# connect to the MAIL server mail.ipfn.tecnico.ulisboa.pt # connect to the MAIL server mail.ipfn.tecnico.ulisboa.pt
# ,priority,noAutoConnect,noProcessEos # ,priority,noAutoConnect,noProcessEos
@@ -43,10 +44,10 @@ drvAsynIPPortConfigure("L0","193.136.136.3:25",0,1,0)
dbLoadRecords("db/sendmail.db", "P=ISTTOK:,PORT=L0,R=central:,L=0,A=0") dbLoadRecords("db/sendmail.db", "P=ISTTOK:,PORT=L0,R=central:,L=0,A=0")
# Uncomment to Debug STREAM serial activity # Uncomment to Debug STREAMDEVICE serial activity
#var streamError 1 #var streamError 1
#var streamDebug 1 #var streamDebug 1
#streamSetLogfile("logfile.txt") streamSetLogfile("logfile.txt")
## Run this to trace the stages of iocInit ## Run this to trace the stages of iocInit
#traceIocInit #traceIocInit
@@ -74,4 +75,4 @@ iocInit
create_monitor_set("$(IOC).req", 30) create_monitor_set("$(IOC).req", 30)
## Start any sequence programs , use safe mode ## Start any sequence programs , use safe mode
seq IsttokSeqExec seq IsttokSeqExec "unit=ISTTOK"

6
epics/iocs/ISTTOKrpi2/.gitignore vendored Normal file
View File

@@ -0,0 +1,6 @@
O.*
bin/*
iocBoot/iocISTTOKrpi2/save/*
db
dbd
configure

View File

@@ -0,0 +1,131 @@
# 8/5/2021 Only sensor 2 is working. Running with dspIC
# 20/9/2021 sensors 1,2,3 are working. Running with dspIC
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, "I/O Intr")
# field (SCAN, "1 second")
field (FLNK, "$(P)$(R)TMPump1-PressureAdmission")
}
record (longin, "$(P)$(R)P001:E")
{
field (DESC, "Pressure001 exponent $(bus)")
}
record (calc, "$(P)$(R)TMPump1-PressureAdmission")
{
field(DESC, "ISTTOK:central:TMPump1-PressureAdmission")
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")
field(HIHI,"1.0e-2")
field(HIGH,"1.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)P002:M")
{
field (DESC, "getPressure002 $(bus)")
field (DTYP, "stream")
field (INP, "@pfeiffer.proto getPressure002($(P)$(R)P002:E) $(bus)")
field (SCAN, "I/O Intr")
# 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-2")
# 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)VVessel-Pressure")
}
record (longin, "$(P)$(R)P003:E")
{
field (DESC, "Pressure003 Exponent $(bus)")
}
record (calc, "$(P)$(R)VVessel-Pressure")
{
field (DESC, "ISTTOK:central:VVessel-Pressure")
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")
field(HIHI,"1.0e-1")
field(HIGH,"1.0e-2")
field(HHSV,"MAJOR")
field(HSV, "MINOR")
}
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 (SCAN, "I/O Intr")
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,"")
}

View File

@@ -0,0 +1,20 @@
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 += xxx.db
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

View File

@@ -0,0 +1,45 @@
Terminator=CR;
MaxInput = 30;
ExtraInput = Ignore;
# in millisecond
#ReadTimeout = 1500;
#ReplyTimeout = 100;
#PollPeriod = $ReplyTimeout;
#Integer. Affects first in command in I/O Intr mode (see chapter Record Processing).
PollPeriod = 250;
# Using redirection to read 2 records, mantissa and exponent
getPressure001 {
# out "0010074002=?106";
in "0011074006%4u%(\$1)2u%+<sum8>";
}
# out "0020074002=?107";
getPressure002 {
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,8 @@
TOP = ..
include $(TOP)/configure/CONFIG
DIRS := $(DIRS) $(filter-out $(DIRS), $(wildcard *src*))
DIRS := $(DIRS) $(filter-out $(DIRS), $(wildcard *Src*))
DIRS := $(DIRS) $(filter-out $(DIRS), $(wildcard *db*))
DIRS := $(DIRS) $(filter-out $(DIRS), $(wildcard *Db*))
include $(TOP)/configure/RULES_DIRS

View File

@@ -0,0 +1,23 @@
/* ISTTOKrpi2Main.cpp */
/* Author: Marty Kraimer Date: 17MAR2000 */
#include <stddef.h>
#include <stdlib.h>
#include <stddef.h>
#include <string.h>
#include <stdio.h>
#include "epicsExit.h"
#include "epicsThread.h"
#include "iocsh.h"
int main(int argc,char *argv[])
{
if(argc>=2) {
iocsh(argv[1]);
epicsThreadSleep(.2);
}
iocsh(NULL);
epicsExit(0);
return(0);
}

View File

@@ -0,0 +1,49 @@
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
ISTTOKrpi2_DBD += asSupport.dbd
# Add all the support libraries needed by this IOC
#ISTTOKrpi2_LIBS += xxx
ISTTOKrpi2_LIBS += asyn
ISTTOKrpi2_LIBS += stream
ISTTOKrpi2_LIBS += autosave
# 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

View File

@@ -0,0 +1,31 @@
# Makefile at top of application tree
TOP = .
include $(TOP)/configure/CONFIG
# Directories to build, any order
DIRS += configure
DIRS += $(wildcard *Sup)
DIRS += $(wildcard *App)
DIRS += $(wildcard *Top)
DIRS += $(wildcard iocBoot)
# The build order is controlled by these dependency rules:
# All dirs except configure depend on configure
$(foreach dir, $(filter-out configure, $(DIRS)), \
$(eval $(dir)_DEPEND_DIRS += configure))
# Any *App dirs depend on all *Sup dirs
$(foreach dir, $(filter %App, $(DIRS)), \
$(eval $(dir)_DEPEND_DIRS += $(filter %Sup, $(DIRS))))
# Any *Top dirs depend on all *Sup and *App dirs
$(foreach dir, $(filter %Top, $(DIRS)), \
$(eval $(dir)_DEPEND_DIRS += $(filter %Sup %App, $(DIRS))))
# iocBoot depends on all *App dirs
iocBoot_DEPEND_DIRS += $(filter %App,$(DIRS))
# Add any additional dependency rules here:
include $(TOP)/configure/RULES_TOP

View File

@@ -0,0 +1,6 @@
TOP = ..
include $(TOP)/configure/CONFIG
DIRS += $(wildcard *ioc*)
DIRS += $(wildcard as*)
include $(CONFIG)/RULES_DIRS

View File

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

View File

@@ -0,0 +1,8 @@
epicsEnvSet("IOC","iocISTTOKrpi2")
epicsEnvSet("TOP","/home/pi/ISTTOK/epics/iocs/ISTTOKrpi2")
epicsEnvSet("EPICS_BASE","/home/pi/EPICS/epics-base")
epicsEnvSet("HOME","/home/pi")
epicsEnvSet("SUPPORT","/home/pi/EPICS/support")
epicsEnvSet("ASYN","/home/pi/EPICS/support/asyn")
epicsEnvSet("STREAM","/home/pi/EPICS/support/stream")
epicsEnvSet("AUTOSAVE","/home/pi/EPICS/support/autosave")

View File

@@ -0,0 +1,4 @@
#ALARM Limits
ISTTOK:vacuum:RPump1-Pressure.HIGH
ISTTOK:vacuum:RPump1-Pressure.HIHI

View File

@@ -0,0 +1,4 @@
# autosave R5.3 Automatically generated - DO NOT MODIFY - 211011-110712
ISTTOK:vacuum:RPump1-Pressure.HIGH 0.05
ISTTOK:vacuum:RPump1-Pressure.HIHI 0.1
<END>

View File

@@ -0,0 +1,53 @@
#!../../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" )
epicsEnvSet( "SAVE_DIR", "$(TOP)/iocBoot/$(IOC)" )
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")
# Uncomment to Debug STREAM serial activity
#var streamError 1
#var streamDebug 1
#streamSetLogfile("stream_logfile.txt")
#save_restoreSet_status_prefix("$(IOC):")
save_restoreSet_status_prefix("ISTTOK:")
set_requestfile_path("$(SAVE_DIR)")
set_savefile_path("$(SAVE_DIR)/save")
save_restoreSet_NumSeqFiles(3)
save_restoreSet_SeqPeriodInSeconds(600)
set_pass0_restoreFile("$(IOC).sav")
set_pass1_restoreFile("$(IOC).sav")
#dbLoadRecords("$(AUTOSAVE)/asApp/Db/save_restoreStatus.db", "P=ISTTOK:")
cd "${TOP}/iocBoot/${IOC}"
iocInit
# Create request file and start periodic 'save
# makeAutosaveFileFromDbInfo("$(SAVE_DIR)/$(IOC).req", "autosaveFields")
create_monitor_set("$(IOC).req", 30)
## Start any sequence programs
#seq sncxxx,"user=pi"

34
epics/iocs/RELEASE.local Normal file
View File

@@ -0,0 +1,34 @@
#RELEASE Location of external products
HOME=/home/pi
SUPPORT=$(HOME)/Apps/epics7/support
#
#
ASYN=$(SUPPORT)/asyn
STREAM=$(SUPPORT)/StreamDevice
#CALC=$(SUPPORT)/calc
AUTOSAVE = $(SUPPORT)/autosave
## Using this driver in combination with streamDevice
## requires a workaround forbidding read queries with
## a max length of 256 byte. To compile the driver with
## with workaround enabled, uncomment the following line
#in configure/RELEASE
#STREAM_WORKAROUND = 1
DRVASYNI2C =$(SUPPORT)/drvAsynI2C
SNCSEQ=$(SUPPORT)/seq-2-2
#
# SEQ is required for testIPServer
#SNCSEQ=$(SUPPORT)/seq-2-2-5
SNCSEQ=
## For sCalcout support in asynOctet - applications include asynCalc.dbd
#CALC=$(SUPPORT)/calc-3-7-3
CALC=
PCRE=
# If CALC was built with SSCAN support then SSCAN must be defined for testEpicsApp
#SSCAN=$(SUPPORT)/sscan-2-11-3
# EPICS_BASE 3.14.6 or later is required
EPICS_BASE=/home/pi/EPICS/epics-base