Compare commits

144 Commits

Author SHA1 Message Date
Bernardo Carvalho
c81ad9a42f Added PyQt6 script to List Archived Channels
Signed-off-by: Bernardo Carvalho <bernardo.carvalho@tecnico.ulisboa.pt>
2025-03-10 16:13:07 +00:00
Bernardo Carvalho
a781b1b92e Changed to Postgresql DB server
Signed-off-by: Bernardo Carvalho <bernardo.carvalho@tecnico.ulisboa.pt>
2025-02-11 14:09:59 +00:00
Bernardo Carvalho
6f6765c7e1 Changed to Postgresql merge
Signed-off-by: Bernardo Carvalho <bernardo.carvalho@tecnico.ulisboa.pt>
2024-12-18 09:27:36 +00:00
Bernardo Carvalho
17bab67ce7 added Inficon gauges
Signed-off-by: Bernardo Carvalho <bernardo.carvalho@tecnico.ulisboa.pt>
2024-12-11 17:00:23 +00:00
Bernardo Carvalho
0ea59f7cfe Added Blanket relay PV
Signed-off-by: Bernardo Carvalho <bernardo.carvalho@tecnico.ulisboa.pt>
2024-11-15 14:01:35 +00:00
Bernardo Carvalho
3dbdf2a374 Added phoebus settings for ISTOOK clients
Signed-off-by: Bernardo Carvalho <bernardo.carvalho@tecnico.ulisboa.pt>
2024-10-11 14:51:44 +01:00
Bernardo Carvalho
0ed0ce8a11 Update CSS Archive Engine scripts
Signed-off-by: Bernardo Carvalho <bernardo.carvalho@tecnico.ulisboa.pt>
2024-10-08 16:06:08 +01:00
Bernardo Carvalho
fd58fab8e9 Added Archive_Enable PV
Signed-off-by: Bernardo Carvalho <bernardo.carvalho@tecnico.ulisboa.pt>
2024-10-08 09:26:42 +00:00
Bernardo Carvalho
4d9ceb2fd5 Update CSS Archive Engine scripts
Signed-off-by: Bernardo Carvalho <bernardo.carvalho@tecnico.ulisboa.pt>
2024-10-08 10:25:34 +01:00
Bernardo Carvalho
ef5b399714 updated save
Signed-off-by: Bernardo Carvalho <bernardo.carvalho@tecnico.ulisboa.pt>
2024-10-08 08:26:07 +00:00
Bernardo Carvalho
870d9b2745 Added MARTe2 PVs in State Machine
Signed-off-by: Bernardo Carvalho <bernardo.carvalho@tecnico.ulisboa.pt>
2024-05-15 14:36:51 +00:00
Bernardo Carvalho
a0a43ee5a6 Added MARTe2 PVs in State Machine
Signed-off-by: Bernardo Carvalho <bernardo.carvalho@tecnico.ulisboa.pt>
2024-04-23 15:57:51 +00:00
Bernardo Carvalho
fa28a411c3 Added MARTe2 PVs in State Machine
Signed-off-by: Bernardo Carvalho <bernardo.carvalho@tecnico.ulisboa.pt>
2023-12-19 18:02:25 +00:00
Bernardo Carvalho
8ab9a8dda3 Added MARTe2 PVs
Signed-off-by: Bernardo Carvalho <bernardo.carvalho@tecnico.ulisboa.pt>
2023-12-19 17:37:12 +00:00
Bernardo Carvalho
3cfb6bb2ae Added Pfeifer RS84 Debug/command PV
Signed-off-by: Bernardo Carvalho <bernardo.carvalho@tecnico.ulisboa.pt>
2023-12-15 15:42:28 +00:00
Bernardo Carvalho
55ea8d1e40 Added Pfeifer RS84 Debug/command PV
Signed-off-by: Bernardo Carvalho <bernardo.carvalho@tecnico.ulisboa.pt>
2023-12-15 15:42:23 +00:00
Bernardo Carvalho
d27b978ff4 Added ISTTOK:central:ELCO-Enable. PV and State Machine
Signed-off-by: Bernardo Carvalho <bernardo.carvalho@tecnico.ulisboa.pt>
2023-12-15 15:42:20 +00:00
Bernardo Carvalho
b84e2c3cd2 Solving Idle State glitches
Signed-off-by: Bernardo Carvalho <bernardo.carvalho@tecnico.ulisboa.pt>
2023-12-15 15:42:17 +00:00
Bernardo Carvalho
128e3c4119 Solving Idle State glitches
Signed-off-by: Bernardo Carvalho <bernardo.carvalho@tecnico.ulisboa.pt>
2023-12-15 15:42:17 +00:00
Bernardo Carvalho
072c8b2512 last changes
Signed-off-by: Bernardo Carvalho <bernardo.carvalho@tecnico.ulisboa.pt>
2023-12-15 15:42:14 +00:00
Bernardo Brotas de Carvalho
8cce3ee00b Document update 2023-08-16 11:12:56 +01:00
Bernardo Carvalho
443eb8857c added bob displays
Signed-off-by: Bernardo Carvalho <bernardo.carvalho@tecnico.ulisboa.pt>
2023-03-08 17:06:07 +00:00
Bernardo Carvalho
470ea3d252 added bob displays
Signed-off-by: Bernardo Carvalho <bernardo.carvalho@tecnico.ulisboa.pt>
2023-03-08 17:06:07 +00:00
Bernardo Carvalho
083359805c added InfluxDB scripts
Signed-off-by: Bernardo Carvalho <bernardo.carvalho@tecnico.ulisboa.pt>
2022-12-04 23:11:57 +00:00
Bernardo Carvalho
6d144aa0f7 Plot of Logs
Signed-off-by: Bernardo Carvalho <bernardo.carvalho@tecnico.ulisboa.pt>
2022-11-02 11:17:05 +00:00
Bernardo Carvalho
4257941712 Added Gateway script
Signed-off-by: Bernardo Carvalho <bernardo.carvalho@tecnico.ulisboa.pt>
2022-10-28 19:05:52 +01:00
Bernardo Carvalho
38d7a16f61 Added Gateway script
Signed-off-by: Bernardo Carvalho <bernardo.carvalho@tecnico.ulisboa.pt>
2022-10-28 19:05:52 +01:00
Bernardo Carvalho
d51063f5f3 added Databrowser widget
Signed-off-by: Bernardo Carvalho <bernardo.carvalho@tecnico.ulisboa.pt>
2022-10-28 19:05:11 +01:00
Bernardo Carvalho
eb4dccdd61 added Databrowser widget
Signed-off-by: Bernardo Carvalho <bernardo.carvalho@tecnico.ulisboa.pt>
2022-10-28 18:53:28 +01:00
bernardo carvalho
3aabcd0a9d added bob file fo dbwr tomcat
Signed-off-by: bernardo carvalho <bernardo.carvalho@tecnico.ulisboa.pt>
2022-10-28 01:11:28 +01:00
Bernardo Carvalho
61dc77e757 Changed WSGI files 2022-10-27 23:18:11 +01:00
Bernardo Carvalho
701502bddd APC-UPS scripts
Signed-off-by: Bernardo Carvalho <bernardo.carvalho@tecnico.ulisboa.pt>
2022-07-05 21:23:50 +01:00
Bernardo Carvalho
9be1e84b74 changed scripts
Signed-off-by: Bernardo Carvalho <bernardo.carvalho@tecnico.ulisboa.pt>
2022-05-05 13:48:05 +00:00
Bernardo Carvalho
677785a8ed added scripts
Signed-off-by: Bernardo Carvalho <bernardo.carvalho@tecnico.ulisboa.pt>
2022-05-04 15:43:41 +00:00
Bernardo Carvalho
6b02c1f54a added scripts
Signed-off-by: Bernardo Carvalho <bernardo.carvalho@tecnico.ulisboa.pt>
2022-05-04 15:43:20 +00:00
Bernardo Carvalho
bd7bc7417c added file
Signed-off-by: Bernardo Carvalho <bernardo.carvalho@tecnico.ulisboa.pt>
2022-05-04 15:43:20 +00:00
Bernardo Carvalho
495ca45e16 New device name
Signed-off-by: Bernardo Carvalho <bernardo.carvalho@tecnico.ulisboa.pt>
2022-05-04 16:03:59 +01:00
Bernardo Carvalho
cc7293d588 New device name
Signed-off-by: Bernardo Carvalho <bernardo.carvalho@tecnico.ulisboa.pt>
2022-05-04 16:03:59 +01:00
Bernardo Carvalho
1b2912fab0 Corrected Times on SM 2022-03-16 15:33:48 +00:00
Bernardo Carvalho
57e309b752 SM includes VVessel Temperature checks
Signed-off-by: Bernardo Carvalho <bernardo.carvalho@tecnico.ulisboa.pt>
2022-02-25 18:30:53 +00:00
Bernardo Carvalho
f9c9b5dba1 New temperature IOC ans systemd start script
Signed-off-by: Bernardo Carvalho <bernardo.carvalho@tecnico.ulisboa.pt>
2022-02-25 18:16:48 +00:00
Bernardo Carvalho
f14b51ce41 New clean enable rules
Signed-off-by: Bernardo Carvalho <bernardo.carvalho@tecnico.ulisboa.pt>
2022-02-23 19:02:37 +00:00
Sakbe
154f3885f5 Merge branch 'master' of https://git.ipfn.tecnico.ulisboa.pt/r/ISTTOK 2022-02-23 18:45:57 +00:00
Sakbe
0bf2d4203c New Enable Rules 2022-02-23 18:45:52 +00:00
Bernardo Carvalho
9736f169fc Inserted Clean Manual State. Change sequencer version, 2.2.9 2022-02-16 18:28:45 +00:00
Bernardo Carvalho
7e88e4ca47 Inserted 3rd Relay Board and PVs 2022-02-14 16:48:21 +00:00
Bernardo Carvalho
8e534c636b Inserted 3rd Relay Board and PVs 2022-02-14 16:45:44 +00:00
Bernardo Carvalho
d616a7fa1f Inserted 3rd Relay Board and PVs 2022-02-04 15:42:12 +00:00
Bernardo Carvalho
0ffb996b10 Updated Relay PVs 2022-02-04 00:30:13 +00:00
Bernardo Carvalho
be0d56bd2f Added second SEEEDUINO Relay Board
Signed-off-by: Bernardo Carvalho <bernardo.carvalho@tecnico.ulisboa.pt>
2022-02-04 00:30:13 +00:00
Sakbe
6b83e948b5 Merge branch 'master' of https://git.ipfn.tecnico.ulisboa.pt/r/ISTTOK 2022-01-26 17:10:05 +00:00
Sakbe
195b545fb5 Changed Seeed Relay PV 2022-01-26 17:09:30 +00:00
Bernardo Carvalho
d98bb95bda Added new SEEEDUINO Relay PVs
Signed-off-by: Bernardo Carvalho <bernardo.carvalho@tecnico.ulisboa.pt>
2022-01-26 16:36:52 +00:00
Bernardo Carvalho
5f86117e7f Added SEEEDUINO Relay PVs. Adapted State Machine
Signed-off-by: Bernardo Carvalho <bernardo.carvalho@tecnico.ulisboa.pt>
2022-01-26 12:31:17 +00:00
Bernardo Carvalho
ef2a3c2d26 Added SEEEDUINO Relay Board Support
Signed-off-by: Bernardo Carvalho <bernardo.carvalho@tecnico.ulisboa.pt>
2022-01-24 17:17:07 +00:00
Bernardo Carvalho
f6f5670025 README edit. SM correction. RS485 probe address swap
Signed-off-by: Bernardo Carvalho <bernardo.carvalho@tecnico.ulisboa.pt>
2021-12-16 17:06:46 +00:00
Bernardo Carvalho
ee358f710d README edit
Signed-off-by: Bernardo Carvalho <bernardo.carvalho@tecnico.ulisboa.pt>
2021-12-15 18:55:28 +00:00
Bernardo Carvalho
f14a20ac68 Updated WSGI html python script 2021-12-15 18:19:17 +00:00
Bernardo Carvalho
947b95ffee State Machine implemting UPS states 2021-12-15 16:37:10 +00:00
Bernardo Carvalho
a055c01789 Moved pfeiffer sensors to central IOC. MSS fields where added 2021-12-15 00:33:46 +00:00
Sakbe
01cb2eec4e Merge branch 'master' of https://git.ipfn.tecnico.ulisboa.pt/r/ISTTOK 2021-12-14 14:23:29 +00:00
Sakbe
db08d512bb Moved pfeffer sensors to cenrtal IOC 2021-12-14 14:23:10 +00:00
Sakbe
605829e43f Moved pfeffer sensors to cenrtal IOC 2021-12-14 14:21:51 +00:00
Bernardo Carvalho
ecae668588 Moved pfeffer sensors to cenrtal IOC 2021-12-14 14:19:56 +00:00
Bernardo Carvalho
f5aa69298b README edit
Signed-off-by: Bernardo Carvalho <bernardo.carvalho@tecnico.ulisboa.pt>
2021-12-14 12:28:03 +00:00
Bernardo Carvalho
33dd29cd79 Checking relay outputs 2021-12-09 16:41:27 +00:00
Bernardo Carvalho
3813c99704 Checking relay output 2021-12-09 15:07:43 +00:00
Sakbe
2eeafe3581 Merge branch 'master' of https://git.ipfn.tecnico.ulisboa.pt/r/ISTTOK 2021-11-29 17:39:21 +00:00
Sakbe
102663840a added UPS records 2021-11-29 17:39:05 +00:00
Bernardo Carvalho
3417b9bfda added UPD records
Signed-off-by: Bernardo Carvalho <bernardo.carvalho@tecnico.ulisboa.pt>
2021-11-29 17:37:04 +00:00
Bernardo Carvalho
329d0b0799 added UPD records
Signed-off-by: Bernardo Carvalho <bernardo.carvalho@tecnico.ulisboa.pt>
2021-11-29 17:36:02 +00:00
Bernardo Carvalho
1a43cf78f0 added UPS Records 2021-11-29 17:27:13 +00:00
Bernardo Carvalho
2743219a13 working 10/2021
Signed-off-by: Bernardo Carvalho <bernardo.carvalho@tecnico.ulisboa.pt>
2021-11-29 09:36:37 +00:00
514eb82e22 added .gitignore and project files
Signed-off-by: Bernardo Carvalho <bernardo@ipfn.tecnico.ulisboa.pt>
2021-10-11 11:20:11 +01:00
3d8c3428fc changed PollPeriod = ; param
Signed-off-by: Bernardo Carvalho <bernardo@ipfn.tecnico.ulisboa.pt>
2021-10-11 11:10:35 +01:00
fe811ce784 changed RPI
Signed-off-by: Bernardo Carvalho <bernardo@ipfn.tecnico.ulisboa.pt>
2021-10-10 21:59:08 +01:00
bernardo carvalho
4c48cd3848 changed RS485 addreses
Signed-off-by: bernardo carvalho <bernardo.carvalho@tecnico.ulisboa.pt>
2021-10-10 21:52:32 +01:00
Bernardo Carvalho
9007221515 drvI2C working ? 2021-05-12 11:04:00 +01:00
Bernardo Carvalho
9f1e47c424 fixing I2C 2021-05-11 17:30:11 +01:00
bernardo carvalho
9bd8504ec2 added autosave for alarm limits 2021-05-11 11:45:16 +01:00
bernardo carvalho
99270a6e36 Merge branch 'master' of https://git.ipfn.tecnico.ulisboa.pt/r/ISTTOK 2021-05-11 11:28:36 +01:00
bernardo carvalho
de3d81fe07 pre- autosave 2021-05-11 11:28:32 +01:00
Bernardo Carvalho
2c0f99e4be Version epics7 2021-05-11 11:24:01 +01:00
Bernardo Carvalho
641da82642 chanegd to epics 7 2021-05-11 11:20:40 +01:00
Bernardo Carvalho
807a1ff0e5 changed to epics 7 2021-05-10 20:33:35 +01:00
bernardo carvalho
bf0d445031 changeg pfiffer interface 2021-05-07 15:07:37 +01:00
bernardo carvalho
c25f1139bf added RPi2 IOC 2020-09-25 19:20:47 +01:00
bernardo carvalho
4bfb5ea148 added RPi2 IOC 2020-09-25 19:17:29 +01:00
Sakbe
c598cc963c Updated CSS OPI 2020-01-27 10:23:52 +00:00
Bernardo Carvalho
d2045469e5 Merge branch 'master' of https://git.ipfn.tecnico.ulisboa.pt/r/ISTTOK 2020-01-27 09:50:53 +00:00
Bernardo Carvalho
21d175abcd Commit BBC 2020-01-27 09:50:29 +00:00
Bernardo B. Carvalho
e91403e6e5 Added CS-Studio info 2020-01-20 15:03:11 +00:00
Bernardo B. Carvalho
ae2b1d7850 Added CS-Studio info 2020-01-20 15:00:31 +00:00
Bernardo B. Carvalho
00a7492299 pre-V04 version. 255Bytes Ch1 DMA. Hanging 2020-01-20 14:56:03 +00:00
Bernardo Carvalho
9625a19d21 Commit BBC 2020-01-15 19:46:47 +00:00
Bernardo Carvalho
cb04b237df Merge branch 'master' of https://git.ipfn.tecnico.ulisboa.pt/r/ISTTOK 2020-01-15 19:45:40 +00:00
Bernardo B. Carvalho
e44d208503 Edit 2020-01-15 19:39:02 +00:00
Bernardo B. Carvalho
96807ba194 Edit 2020-01-15 19:35:43 +00:00
Bernardo B. Carvalho
dc8a0f63fd Edit 2020-01-15 19:21:12 +00:00
Bernardo B. Carvalho
097fad23c7 Edit 2020-01-15 19:19:53 +00:00
Bernardo B. Carvalho
9a933d4b67 Edit 2020-01-15 19:15:39 +00:00
Bernardo B. Carvalho
bd13286335 Edit 2020-01-15 19:11:16 +00:00
Bernardo B. Carvalho
d230af3859 Edit 2020-01-15 19:07:16 +00:00
Bernardo B. Carvalho
38c96cf2fd Edit 2020-01-15 19:01:55 +00:00
Bernardo B. Carvalho
28e027af4b Edit 2020-01-15 19:00:06 +00:00
Bernardo B. Carvalho
1c1efebd25 Edit 2020-01-15 18:50:59 +00:00
Bernardo B. Carvalho
9898f1dadd Edit 2020-01-15 18:47:47 +00:00
Bernardo B. Carvalho
b2288eb1b8 Edit 2020-01-15 18:41:31 +00:00
Bernardo B. Carvalho
dcfcf9c0a1 Edit 2020-01-15 18:10:27 +00:00
Bernardo Carvalho
f445009375 Added TDA8444 DAC channels 2020-01-15 15:52:30 +00:00
Sakbe
1da955732d Change Temperature OPI 2019-12-23 15:04:00 +00:00
Bernardo
4efab62a80 Added wsgi archive plot file 2019-12-22 22:58:25 +00:00
Bernardo
9af01e8ea4 Added wsgi archive plot file 2019-12-22 22:53:40 +00:00
codac-dev
c7f067b9ba Corrected Temperatures 2019-12-20 17:32:22 +00:00
Bernardo Carvalho
fe9a7ad1ac Modified SM (Cleaning States) 2019-12-20 17:30:54 +00:00
Bernardo Carvalho
a97b6050ef Commit BBC 2019-12-20 16:00:00 +00:00
Bernardo Carvalho
7ad8abbffa Changed state machine with Temperatures 2019-12-20 14:13:07 +00:00
codac-dev
be2c948ef6 Corrected State machine with Temperatures 2019-12-20 14:11:35 +00:00
Sakbe
fc3aeb562d Corrected temperature widgets 2019-12-20 11:54:43 +00:00
codac-dev
2ce84c4fcc Corrected Temperatures 2019-12-20 11:51:38 +00:00
Bernardo
3533a35127 Adde Epics README.md 2019-12-19 23:02:55 +00:00
Bernardo Carvalho
2fa8d07a6b Merge branch 'master' of https://git.ipfn.tecnico.ulisboa.pt/r/ISTTOK 2019-12-19 17:31:47 +00:00
Bernardo Carvalho
52239c79a4 Commit BBC 2019-12-19 17:31:11 +00:00
codac-dev
748046bdbd Coorected 2019-12-19 17:29:54 +00:00
codac-dev
9922cd4fa6 initial import 2019-12-19 17:09:44 +00:00
Sakbe
fe12cbbcb3 Updated CSS OPI 2019-12-17 19:22:09 +00:00
Bernardo Carvalho
b71f20d6c2 Added html and ArchiveEngine Config files 2019-12-17 14:14:42 +00:00
Bernardo Carvalho
ab49f03b9a Now sending Emails 2019-12-16 10:30:09 +00:00
Bernardo Carvalho
8869b40e1f Merge branch 'master' of https://git.ipfn.tecnico.ulisboa.pt/r/ISTTOK 2019-12-12 17:25:58 +00:00
Bernardo Carvalho
fa9fc97a32 Solved PCF8574 READ/WRIE problem 2019-12-12 17:24:42 +00:00
Sakbe
559b2f9f2b Updated CSS OPI 2019-12-12 12:05:44 +00:00
Bernardo Carvalho
1189a07ed7 Added Pulse Number Counter 2019-12-12 11:49:22 +00:00
Bernardo Carvalho
a2a21a2a40 Implemented Vacuum Emergency (bbc) 2019-12-11 18:05:36 +00:00
Bernardo Carvalho
94f7cb955d Changed state machine 2019-12-11 10:57:47 +00:00
Bernardo Carvalho
172d345d5a changed Stopping States 2019-12-10 21:22:39 +00:00
Bernardo Carvalho
0684acc1e8 Merge branch 'master' of https://git.ipfn.tecnico.ulisboa.pt/r/ISTTOK 2019-12-05 19:12:11 +00:00
Sakbe
f749d0e0fe Edited CSS OPI file 2019-12-05 19:12:29 +00:00
Bernardo Carvalho
697199b47f Commit BBC 2019-12-05 19:11:57 +00:00
Bernardo Carvalho
5d5b5160fb Commit Hugo 2019-12-05 17:13:48 +00:00
Bernardo Carvalho
50e2202f61 Commit Hugo 2019-12-05 15:22:03 +00:00
Bernardo Carvalho
de91a58191 Removed Stoping states 2019-12-03 18:26:39 +00:00
Bernardo Carvalho
4c4f22c764 Changes to db files 2019-12-02 21:01:13 +00:00
Bernardo Carvalho
5905d36ad3 Change PV names. state machine running 2019-11-29 11:50:11 +00:00
Bernardo Carvalho
dabf6bdf9d Change PV names and state machine 2019-11-27 18:07:24 +00:00
104 changed files with 12651 additions and 18961 deletions

415
epics/README.md Normal file
View File

@@ -0,0 +1,415 @@
# New ISTTOK Slow Control System
## Intro
The new ISTTOK slow control system is designed to replace the former vacuum/power/slow timing system based is the EDWARDS controller.
The new system uses the [EPICS](https://epics-controls.org) framework and the [Control System Studio](http://controlsystemstudio.org), below there is a detailed description of the used software.
In the next figure is depicted the system structure.
![Kiku](images/isttokepicssystem.png)
At the present the software are installed in two IOC servers with the exception of the Control System Studio that is also used for the GUI management.
All software stored in IPFN GIT [server](https://git.ipfn.tecnico.ulisboa.pt/summary/ISTTOK.git)
## Team and responsabilities
* **Horácio Fernandes** (ISTTOK Leader)
* **Bernardo Carvalho** (Project Leader)
* **Humberto Figueiredo** (ISTTOK Session Leader)
* **Hugo Alves** (ISTTOK Session Leader, State Machine development)
* **Tiago Pereira** (dsPIC development, RS232 protocol/ Sensor Interface/ Wiring)
## System description
Presently there are two/three instances of EPICS IOC Server implemented.
One responsible for the Temperature Node.
And a second one, installed in a Raspberry Pi, implemented in the new control unit launched at ISTTOK for the remote control of the vacuum pumps, named Central Node.
A third one is dedicated for readind the Vacuum Sensore through the RS484 Interface
### Temperature/Vacuum Node: Temperature Sensors and ELCO Voltage Measurement Systems
* Thermocouple Sensor
* ELCO voltage measurement
* For communication was used a fiber optic
The dsPic uses the internal ADC to read the voltage signal from the thermocouple.
To measure the ELCO's voltage it was developed two boards one to read the ELCO's voltage and another to connect the fiber optic to dsPIC.
#### Hardware Platform
* Thermocouple Sensor
* ELCO voltage measurement
1. One PC Controller
* Intel(R) Atom(TM) CPU330 1.60GHz, Dual Core, 1 Gbyte RAM, 4 RAM
* 4 Serial Ports
* IP addr: 192.168.1.152 ( ISTTOK private network)
* Scientific [Linux CERN 6](http://linux.web.cern.ch/linux/scientific6) (SLC6)
with MRG Realtime extensions
\*Linux kernel 3.2.33-rt50.66.el6rt.x86_64
* NTP time conected to IPFN Gps NTP/PPS server IP:10.136.236.255 and
baco.ipfn.tecnico.ulisboa.pt (193.136.136.129)
1. Local Control
* One or more dsPic board running an embedded firmware
Temperature Sensors and ELCO Voltage Measurement Systems
\-For communication was used a fiber optic
The dsPic uses the internal ADC to read the voltage signal from the thermocouple.
To measure the ELCO's voltage it was developed two boards one to read the ELCO's voltage and another to connect the fiber optic to dsPIC.
#### Protocol for communication between dspics and PC
* all bytes are readable ASCII
* all messages all terminated with two bytes: \\r\\n (13 10)
* messages have variable length
* framing character for fields inside message is space (32)
* individual fields inside each message have variable length
* the last three characters before the terminator are the ASCII representation of the checksum of all other bytes, excluding the terminator
* Messages are sent periodically (1s)
Examples:
PIC -> PC
`VL01_1 VL02_1 VL03_0 TE01_150.9 TE02_80.1 UP_7200 PR01_1.3e-4 CKS\r\n`
PC -> PIC
`VL01_1 CKS\r\n`
Table of word fields
| N | A |
|:------|-----|
| VLxx_| Valve|
| TExx_| Temperature|
| UP_ | Uptime |
| PRDxx_| Wave Period |
| PRxx_ | Pressure |
#### Software Platform
1. EPICS V3.15.7 (instaled in `/opt/epics/base-3.15.7`)
* IOC sources (versioned) in `/home/codac-dev/ISTTOK/epics/iocs/ISTTOKdsPIC`
* IOC binaries in `/opt/epics/apps/ISTTOK`
* Init IOC script in `/etc/rc.local`
2. Modules ( (instaled in `/opt/epics/modules`)
* ASYN [git package](https://github.com/epics-modules/asyn.git)
* STREAM [git](https://github.com/paulscherrerinstitute/StreamDevice.git)
3. CS-Studio
* Archive \[Engine\] (http://cs-studio.sourceforge.net/docbook/ch11.html)
* Init script in `/etc/init.d/isttok-archive-engine`
* MySQL server (user: report )
* ArchiveConfigTool in `/home/bernardo/css/ArchiveConfigTool`
Process Value in this IOC Server:
|PV Name |PV Type |Archive|
|:----------|-------|---:|
|ISTTOK:temperature:Uptime |longin| no|
|ISTTOK:temperature:Last_Uptime | ai | no |
|ISTTOK:temperature:Temperature_0 |ai |yes
|ISTTOK:temperature:Temperature_1 |ai | no |
|ISTTOK:temperature:Temperature_2 |ai | no |
|ISTTOK:temperature:Temperature_3 |ai | no |
|ISTTOK:temperature:Capbank_Voltage | ai| no |
|ISTTOK:temperature:VVessel-Temperature | ai | yes |
---
### Central Control/Vacuum Node
* Vacuum Sensors
* Pffeifer rotatory vacuum pumpa (*RPump1*)
* Edwards electro valve
* Seiko Seiki turbomolecular pump and control unit (model SCU-400)
* Main State Machine, see [source](https://git.ipfn.tecnico.ulisboa.pt/blob/ISTTOK.git/master/epics%2Fiocs%2FISTTOKrpi%2FISTTOKrpiApp%2Fsrc%2FIsttokSeqExec.stt)
#### Hardware Platform
1. A Raspberry Pi running a linux distribution..
* Raspberry Pi 2 Model B Rev 1.1 hardware. `# cat /proc/cpuinfo | grep Model`
* Has a USB/RS485 port for monitoring pressure (to be connected soon)
1. Two Interface Boards, Velleman Model [k8000](https://www.velleman.eu/products/view/?id=9383)..
* connected to raspberry Pi through I2C interface;
* 8 isolated output connected to the relays (6 relays installed for the rotatory control)
* 4 isolated outputs connected to SEIKO unit controller
* Indicator leds for the relays in the front panel
* 24 V power supply
#### Software Platform
1. Linux Raspian "Stretch" (user :pi):
* IP addr:192.168.1.110 ( ISTTOK private network)
* NTP/timedatectl time conected to IPFN Gps NTP/PPS server IP:10.136.227.237 193.136.136.129
(this is mandatory, Rpi does not have a Real Time clock see https://www.raspberrypi.org/forums/viewtopic.php?t=178763)
* EPICS v7 base-7.0 from epics [github](https://github.com/epics-base)
* (in /home/pi/Apps/epics7/epics-base) including modules:
* asynDriver [asyn](https://github.com/epics-modules/asyn)
* [StreamDevice](https://paulscherrerinstitute.github.io/StreamDevice)
* State Notation Language and Sequence v.2.2 [seq](https://www-csr.bessy.de/control/SoftDist/sequencer)
* [autosave](https://github.com/epics-modules/autosave)
* IOC installed in '/home/pi/ISTTOK/epics/iocs/ISTTOKrpi'
* Running in `screen deamon` (see `/etc/rc.local`)
For installation EPICS in Linux/raspian see this [link](https://docs.epics-controls.org/projects/how-tos/en/latest/getting-started/installation.html)
#### Process Variables
Process Variables in this IOC Server:
* State machine PVs
|PV Name |PV Type |Archive|
|:----------|-------|---:|
|ISTTOK:central:AUTHORISATION | bo | no |
|ISTTOK:central:OPREQ | bo | no |
|ISTTOK:central:PROCESS-MODE | bo | no |
|ISTTOK:central:PROCESS-REQ | bo | no |
|ISTTOK:central:COUNTER | calc | no |
|ISTTOK:central:COUNTDOWN | mbbi | no |
|ISTTOK:central:PULSE-NUMBER | longout | yes |
|ISTTOK:central:OPSTATE |longout | yes |
|ISTTOK:central:UPS-OnBattery | bo | no |
|ISTTOK:central:UPS-Shutdown | bo | no |
|ISTTOK:central:CurrentTime | stringin | no |
|ISTTOK:central:TraceMessage | stringout | yes |
|ISTTOK:central:LogMessage | stringout | yes |
---
* Connected to PCF8574 I2C Address = 56 (Bottom Valleman)
|PV Name | PV Type | Bit |
|:----------|-------|---:|
| ISTTOK:central:TMPump1-ControllerOn | bo | 0 |
|ISTTOK:central:TMPump1-ControllerOff | bo | 1 |
|ISTTOK:central:TMPump1-MotorOn | bo | 2 |
|ISTTOK:central:TMPump1-MotorOff | bo | 3 |
|ISTTOK:central:TMPump1-Power | bi | 4 |
|ISTTOK:central:TMPump1-Acceleration | bi | 5 |
|ISTTOK:central:TMPump1-Emergency | bi | 6 |
|ISTTOK:central:TMPump1-NormalOperation | bi | 7 |
---
* Connected to PCF8574 I2C Address = 57 (Bottom Valleman board)
|PV Name | PV Type | Bit |
|:----------|-------|---:|
|ISTTOK:central:TMPump2-Emergency | bi | 0 |
|ISTTOK:central:TMPump2-Acceleration | bi | 1 |
|ISTTOK:central:TMPump2-MotorOn | bo | 2 |
|ISTTOK:central:Emergency-PhysButton| bi | 4 |
|ISTTOK:central:TTSystem-tzero| bi | 7 |
---
* Connected to PCF8574 Address = 60 (Top Valleman Board)
|PV Name | PV Type | Bit | Relay #/(NO/NC)|
|:----------|-------|---:|
|ISTTOK:central:RPump1-Motor| bo | 0 | 5 / NC |
|ISTTOK:central:RPump1-Valve| bo | 1 | 4 / NC |
|ISTTOK:central:RPump2-Motor (Not Used/Disabled)| bo | 2 | |
|ISTTOK:central:RPump2-Valve (Not Used/Disabled| bo | 3 | |
|ISTTOK:central:VVessel-Filament| bo | 4 | 1 / NO|
---
* Connected to TDA8444 DAC @ address 0x20=d32 (Bottom Valleman Board)
|PV Name |PV Type |Archive|
|:----------|-------|---:|
| ISTTOK:central:TDA8444:32:DAC_CH0| longout | no |
| ISTTOK:central:TDA8444:32:DAC_CH1| longout | no |
| ISTTOK:central:TDA8444:32:DAC_CH2| longout | no |
| ISTTOK:central:TDA8444:32:DAC_CH3| longout | no |
| ISTTOK:central:TDA8444:32:DAC_CH5| longout | no |
| ISTTOK:central:TDA8444:32:DAC_CH6| longout | no |
---
* Connected to PCF8591 ADC / DAC register @ address 0x48=d72
|PV Name |PV Type | CH |Archive|
|:----------|-------|---:|
| ISTTOK:central:TMPump2-Speed| ai | ch1 | no |
| ISTTOK:central:TMPump2-Current| ai | ch2 | no |
| ISTTOK:central:Shot-TorPSCurrentImage"| ai | ch3 | no |
---
* Connected to RS485 Bus (Using USB */dev/ttyUSB0*)
|PV Name |PV Type |Archive| RS485 request command|
|:----------|-------|---:|---|
|ISTTOK:central:VVessel-Pressure | ai | yes | out "0010074002=?106"|
|ISTTOK:central:RPump1-Pressure | ai | yes | out "0020074002=?107" |
|ISTTOK:central:RPump2-Pressure (Disabled) | ai | yes | |
|ISTTOK:central:TMPump1-PressureAdmission | ai | yes | out "0030074002=?108" |
---
* Connected to [Seeeduino](https://wiki.seeedstudio.com/Grove-4-Channel_SPDT_Relay) Grove - 4-Channel
SPDT Relay Address = 17
|PV Name | PV Type | Bit | Relay NO/NC|
|:----------|-------|---:|
|ISTTOK:central:GasIS-Valves| bo | 0 | NO |
|ISTTOK:central:PrimPneuBreaker| bo | 1 | NO |
|ISTTOK:central:CapBank-Discharge| bo | 2 | NO |
|ISTTOK:central:Clean-TorPneuBreaker| bo | 3 | NO |
* Connected to Seeeduino- 4-Channel SPDT Relay Address = 18
|PV Name | PV Type | Bit | Relay NO/NC|
|:----------|-------|---:|
|ISTTOK:central:Clean-PrimContactor| bo | 0 | Relay NO/NC|
|ISTTOK:central:Clean-TorContactor| bo | 1 | Relay NO/NC|
|ISTTOK:central:CapBank-Charge| bo | 2 | Relay NO/NC|
|ISTTOK:central:Buzzer| bo | 3 | Relay NO/NC|
* Connected to Seeeduino- 4-Channel SPDT Relay Address = 19
|PV Name | PV Type | Bit | Relay NO/NC|
|:----------|-------|---:|
| ISTTOK:central:Shot-TorPSDisable| bo | 0 | NO |
| ISTTOK:central:Lab-WarningLight| bo |1 | NO |
### Vacuum Node (**Not used, backup server only**)
* Vacuum Pfeiffer Sensors (RS485)
#### Hardware Platform
1. A Raspberry Pi 2, running a raspian Buster distribution..
* Has a USB/RS485 interface for monitoring pressure sensors
#### Process Variables
Process Variables in this IOC Server:
* Connected to RS485 Bus
|PV Name |PV Type |Archive|
|:----------|-------|---:|
| ISTTOK:vacuum:RPump1-Pressure (not used)| ai | yes |
|ISTTOK:vacuum:RPump2-Pressure (not used) | ai | yes |
|ISTTOK:vacuum:TMPump1-PressureAdmission (not used)| ai | yes |
|ISTTOK:vacuum:VVessel-Pressure (not used) | ai | yes |
---
#### Software Platform
1. Linux Raspian "buster" (user :pi):
* IP addr: 192.168.1.120 ( ISTTOK private network)
* NTP/timedatectl time conected to IPFN Gps NTP/PPS server IP:10.136.227.237 193.136.136.129
(this is mandatory, Rpi does not have a Real Time clock see https://www.raspberrypi.org/forums/viewtopic.php?t=178763)
* EPICS 7. To install follow [EPICS Docs](https://docs.epics-controls.org/projects/how-tos/en/latest/getting-started/installation.html)
## Download and configure CS-Studio
* Install JAVA JDK (version Java SE Development Kit 8) or
openjdk-8-jre linux package
* Download ISTTOK EPICS Files to a working folder
* `git clone https://bernardo@git.ipfn.tecnico.ulisboa.pt/r/ISTTOK.git`
* Goto site [CS-Studio](http://download.controlsystemstudio.org/release/4.5/) and download latest version to your OS
* Uncompress folder
* Run `cs-studio` executable
* Choose a workplace folder
* Goto to Menu EDIT->Preferences->CSS Core->Data Sources->Channel Access
* On Address List replace `localhost` with `epics.ipfn.tecnico.ulisboa.pt`
* Uncheck `Auto Address List`
* Restart CS-Studio
* Run File -> Import -> General-> Projects from folder
* point to cloned folder
* Navigate to `ISTTOK/epics/css/sys-mng-opi/CSS`
* Open `SystemManagerIsttok.opi` with "OPI Display"
### EPICS Channel Access Configuration
export EPICS_CA_ADDR_LIST="192.168.1.110 192.168.1.152"
export EPICS_CA_AUTO_ADDR_LIST="NO"
EPICS TOMCAT Channel Access
http://epics.ipfn.tecnico.ulisboa.pt:8080/dbwr/view.jsp?display=http://localhost/displays/isttok.bob
### References
*"EPICS IOC module development and implementation for the ISTTOK machine subsystem operation and control"*
Paulo Carvalho, André Duarte, Tiago Pereira, Bernardo Carvalho, Jorge Sousa, Horácio Fernandes, Carlos Correia, Bruno Gonçalves, Carlos Varandas
Fusion Engineering and Design 86 (2011) 10851090

349
epics/apcuspd/apcupsd.conf Normal file
View File

@@ -0,0 +1,349 @@
## apcupsd.conf v1.1 ##
#
# "apcupsd" POSIX config file
#
# Note that the apcupsd daemon must be restarted in order for changes to
# this configuration file to become active.
#
#
# ========= General configuration parameters ============
#
# UPSNAME xxx
# Use this to give your UPS a name in log files and such. This
# is particulary useful if you have multiple UPSes. This does not
# set the EEPROM. It should be 8 characters or less.
UPSNAME istokups
# UPSCABLE <cable>
# Defines the type of cable connecting the UPS to your computer.
#
# Possible generic choices for <cable> are:
# simple, smart, ether, usb
#
# Or a specific cable model number may be used:
# 940-0119A, 940-0127A, 940-0128A, 940-0020B,
# 940-0020C, 940-0023A, 940-0024B, 940-0024C,
# 940-1524C, 940-0024G, 940-0095A, 940-0095B,
# 940-0095C, 940-0625A, M-04-02-2000
#
UPSCABLE usb
# To get apcupsd to work, in addition to defining the cable
# above, you must also define a UPSTYPE, which corresponds to
# the type of UPS you have (see the Description for more details).
# You must also specify a DEVICE, sometimes referred to as a port.
# For USB UPSes, please leave the DEVICE directive blank. For
# other UPS types, you must specify an appropriate port or address.
#
# UPSTYPE DEVICE Description
# apcsmart /dev/tty** Newer serial character device, appropriate for
# SmartUPS models using a serial cable (not USB).
#
# usb <BLANK> Most new UPSes are USB. A blank DEVICE
# setting enables autodetection, which is
# the best choice for most installations.
#
# net hostname:port Network link to a master apcupsd through apcupsd's
# Network Information Server. This is used if the
# UPS powering your computer is connected to a
# different computer for monitoring.
#
# snmp hostname:port:vendor:community
# SNMP network link to an SNMP-enabled UPS device.
# Hostname is the ip address or hostname of the UPS
# on the network. Vendor can be can be "APC" or
# "APC_NOTRAP". "APC_NOTRAP" will disable SNMP trap
# catching; you usually want "APC". Port is usually
# 161. Community is usually "private".
#
# netsnmp hostname:port:vendor:community
# OBSOLETE
# Same as SNMP above but requires use of the
# net-snmp library. Unless you have a specific need
# for this old driver, you should use 'snmp' instead.
#
# dumb /dev/tty** Old serial character device for use with
# simple-signaling UPSes.
#
# pcnet ipaddr:username:passphrase:port
# PowerChute Network Shutdown protocol which can be
# used as an alternative to SNMP with the AP9617
# family of smart slot cards. ipaddr is the IP
# address of the UPS management card. username and
# passphrase are the credentials for which the card
# has been configured. port is the port number on
# which to listen for messages from the UPS, normally
# 3052. If this parameter is empty or missing, the
# default of 3052 will be used.
#
# modbus /dev/tty** Serial device for use with newest SmartUPS models
# supporting the MODBUS protocol.
# modbus <BLANK> Leave the DEVICE setting blank for MODBUS over USB
# or set to the serial number of the UPS to ensure
# that apcupsd binds to that particular unit
# (helpful if you have more than one USB UPS).
#
UPSTYPE usb
#DEVICE /dev/ttyS0
DEVICE
# POLLTIME <int>
# Interval (in seconds) at which apcupsd polls the UPS for status. This
# setting applies both to directly-attached UPSes (UPSTYPE apcsmart, usb,
# dumb) and networked UPSes (UPSTYPE net, snmp). Lowering this setting
# will improve apcupsd's responsiveness to certain events at the cost of
# higher CPU utilization. The default of 60 is appropriate for most
# situations.
#POLLTIME 60
# LOCKFILE <path to lockfile>
# Path for device lock file for UPSes connected via USB or
# serial port. This is the directory into which the lock file
# will be written. The directory must already exist; apcupsd will not create
# it. The actual name of the lock file is computed from DEVICE.
# Not used on Win32.
LOCKFILE /var/lock
# SCRIPTDIR <path to script directory>
# Directory in which apccontrol and event scripts are located.
SCRIPTDIR /etc/apcupsd
# PWRFAILDIR <path to powerfail directory>
# Directory in which to write the powerfail flag file. This file
# is created when apcupsd initiates a system shutdown and is
# checked in the OS halt scripts to determine if a killpower
# (turning off UPS output power) is required.
PWRFAILDIR /etc/apcupsd
# NOLOGINDIR <path to nologin directory>
# Directory in which to write the nologin file. The existence
# of this flag file tells the OS to disallow new logins.
NOLOGINDIR /etc
#
# ======== Configuration parameters used during power failures ==========
#
# The ONBATTERYDELAY is the time in seconds from when a power failure
# is detected until we react to it with an onbattery event.
#
# This means that, apccontrol will be called with the powerout argument
# immediately when a power failure is detected. However, the
# onbattery argument is passed to apccontrol only after the
# ONBATTERYDELAY time. If you don't want to be annoyed by short
# powerfailures, make sure that apccontrol powerout does nothing
# i.e. comment out the wall.
ONBATTERYDELAY 5
#ONBATTERYDELAY 60
#
# Note: BATTERYLEVEL, MINUTES, and TIMEOUT work in conjunction, so
# the first that occurs will cause the initation of a shutdown.
#
# If during a power failure, the remaining battery percentage
# (as reported by the UPS) is below or equal to BATTERYLEVEL,
# apcupsd will initiate a system shutdown.
BATTERYLEVEL 65
# If during a power failure, the remaining runtime in minutes
# (as calculated internally by the UPS) is below or equal to MINUTES,
# apcupsd, will initiate a system shutdown.
MINUTES 30
# If during a power failure, the UPS has run on batteries for TIMEOUT
# many seconds or longer, apcupsd will initiate a system shutdown.
# A value of 0 disables this timer.
#
# Note, if you have a Smart UPS, you will most likely want to disable
# this timer by setting it to zero. That way, you UPS will continue
# on batteries until either the % charge remaing drops to or below BATTERYLEVEL,
# or the remaining battery runtime drops to or below MINUTES. Of course,
# if you are testing, setting this to 60 causes a quick system shutdown
# if you pull the power plug.
# If you have an older dumb UPS, you will want to set this to less than
# the time you know you can run on batteries.
TIMEOUT 300
# Time in seconds between annoying users to signoff prior to
# system shutdown. 0 disables.
ANNOY 300
# Initial delay after power failure before warning users to get
# off the system.
ANNOYDELAY 60
# The condition which determines when users are prevented from
# logging in during a power failure.
# NOLOGON <string> [ disable | timeout | percent | minutes | always ]
NOLOGON disable
# If KILLDELAY is non-zero, apcupsd will continue running after a
# shutdown has been requested, and after the specified time in
# seconds attempt to kill the power. This is for use on systems
# where apcupsd cannot regain control after a shutdown.
# KILLDELAY <seconds> 0 disables
KILLDELAY 0
#
# ==== Configuration statements for Network Information Server ====
#
# NETSERVER [ on | off ] on enables, off disables the network
# information server. If netstatus is on, a network information
# server process will be started for serving the STATUS and
# EVENT data over the network (used by CGI programs).
NETSERVER on
# NISIP <dotted notation ip address>
# IP address on which NIS server will listen for incoming connections.
# This is useful if your server is multi-homed (has more than one
# network interface and IP address). Default value is 0.0.0.0 which
# means any incoming request will be serviced. Alternatively, you can
# configure this setting to any specific IP address of your server and
# NIS will listen for connections only on that interface. Use the
# loopback address (127.0.0.1) to accept connections only from the
# local machine.
NISIP 127.0.0.1
# NISPORT <port> default is 3551 as registered with the IANA
# port to use for sending STATUS and EVENTS data over the network.
# It is not used unless NETSERVER is on. If you change this port,
# you will need to change the corresponding value in the cgi directory
# and rebuild the cgi programs.
NISPORT 3551
# If you want the last few EVENTS to be available over the network
# by the network information server, you must define an EVENTSFILE.
EVENTSFILE /var/log/apcupsd.events
# EVENTSFILEMAX <kilobytes>
# By default, the size of the EVENTSFILE will be not be allowed to exceed
# 10 kilobytes. When the file grows beyond this limit, older EVENTS will
# be removed from the beginning of the file (first in first out). The
# parameter EVENTSFILEMAX can be set to a different kilobyte value, or set
# to zero to allow the EVENTSFILE to grow without limit.
EVENTSFILEMAX 10
#
# ========== Configuration statements used if sharing =============
# a UPS with more than one machine
#
# Remaining items are for ShareUPS (APC expansion card) ONLY
#
# UPSCLASS [ standalone | shareslave | sharemaster ]
# Normally standalone unless you share an UPS using an APC ShareUPS
# card.
UPSCLASS standalone
# UPSMODE [ disable | share ]
# Normally disable unless you share an UPS using an APC ShareUPS card.
UPSMODE disable
#
# ===== Configuration statements to control apcupsd system logging ========
#
# Time interval in seconds between writing the STATUS file; 0 disables
#STATTIME 0
STATTIME 10
# Location of STATUS file (written to only if STATTIME is non-zero)
STATFILE /var/log/apcupsd.status
# LOGSTATS [ on | off ] on enables, off disables
# Note! This generates a lot of output, so if
# you turn this on, be sure that the
# file defined in syslog.conf for LOG_NOTICE is a named pipe.
# You probably do not want this on.
LOGSTATS off
# Time interval in seconds between writing the DATA records to
# the log file. 0 disables.
DATATIME 0
# FACILITY defines the logging facility (class) for logging to syslog.
# If not specified, it defaults to "daemon". This is useful
# if you want to separate the data logged by apcupsd from other
# programs.
#FACILITY DAEMON
#
# ========== Configuration statements used in updating the UPS EPROM =========
#
#
# These statements are used only by apctest when choosing "Set EEPROM with conf
# file values" from the EEPROM menu. THESE STATEMENTS HAVE NO EFFECT ON APCUPSD.
#
# UPS name, max 8 characters
#UPSNAME UPS_IDEN
UPSNAME istokups
# Battery date - 8 characters
#BATTDATE mm/dd/yy
BATTDATE 11/24/2021
# Sensitivity to line voltage quality (H cause faster transfer to batteries)
# SENSITIVITY H M L (default = H)
#SENSITIVITY H
# UPS delay after power return (seconds)
# WAKEUP 000 060 180 300 (default = 0)
#WAKEUP 60
WAKEUP 000
# UPS Grace period after request to power off (seconds)
# SLEEP 020 180 300 600 (default = 20)
SLEEP 180
# Low line voltage causing transfer to batteries
# The permitted values depend on your model as defined by last letter
# of FIRMWARE or APCMODEL. Some representative values are:
# D 106 103 100 097
# M 177 172 168 182
# A 092 090 088 086
# I 208 204 200 196 (default = 0 => not valid)
LOTRANSFER 208
# High line voltage causing transfer to batteries
# The permitted values depend on your model as defined by last letter
# of FIRMWARE or APCMODEL. Some representative values are:
# D 127 130 133 136
# M 229 234 239 224
# A 108 110 112 114
# I 253 257 261 265 (default = 0 => not valid)
HITRANSFER 253
# Battery charge needed to restore power
# RETURNCHARGE 00 15 50 90 (default = 15)
#RETURNCHARGE 15
# Alarm delay
# 0 = zero delay after pwr fail, T = power fail + 30 sec, L = low battery, N = never
# BEEPSTATE 0 T L N (default = 0)
#BEEPSTATE T
# Low battery warning delay in minutes
# LOWBATT 02 05 07 10 (default = 02)
#LOWBATT 2
# UPS Output voltage when running on batteries
# The permitted values depend on your model as defined by last letter
# of FIRMWARE or APCMODEL. Some representative values are:
# D 115
# M 208
# A 100
# I 230 240 220 225 (default = 0 => not valid)
#OUTPUTVOLTS 230
# Self test interval in hours 336=2 weeks, 168=1 week, ON=at power on
# SELFTEST 336 168 ON OFF (default = 336)
SELFTEST 336

42
epics/apcuspd/doshutdown Executable file
View File

@@ -0,0 +1,42 @@
#!/bin/sh
#
# This shell script if placed in /etc/apcupsd
# will be called by /etc/apcupsd/apccontrol when the
# UPS goes to shutdown mode
#
# In ISTTOK we really don't do the shutdown
# We send an email message to root to notify him.
#
EPICSBIN='/home/pi/Apps/epics7/epics-base/bin/linux-arm'
$EPICSBIN/caput ISTTOK:central:UPS-Shutdown ON
HOSTNAME=`rpi-isttok`
SYSADMIN=humbfig@gmail.com
MSG="$HOSTNAME UPS $1 s going to to shutdown"
#
(
echo "$MSG"
echo " "
/sbin/apcaccess status
) | $APCUPSD_MAIL -s "$MSG" $SYSADMIN
sleep 50
# Now wait for Epics state machine to go to stopping state
STOPSTATE=$($EPICSBIN/caget -t -n ISTTOK:central:STOPPINGSTATE)
echo "Init:$STOPSTATE"
# dont forget spaces on [ ]
#while [ $STOPSTATE -lt 2 ];
#do
# STOPSTATE=$($EPICSBIN/caget -t -n ISTTOK:central:STOPPINGSTATE)
# echo "STOPSTATE = $STOPSTATE, Waiting =2"
# sleep 1
#done
echo "OK STOPSTATE: $STOPSTATE"
sleep 10
# allow shutdown and let UPS do poweroff (after ~90 s) on rpi-isttok
exit 0
# Do not shutdown raspberry pi host
#exit 99

22
epics/apcuspd/offbattery Executable file
View File

@@ -0,0 +1,22 @@
#!/bin/sh
#
# This shell script if placed in /etc/apcupsd
# will be called by /etc/apcupsd/apccontrol when the
# UPS goes back on to the mains after a power failure.
# We send an email message to root to notify him.
#
#echo "running script offbattery $MSG"
EPICS_BIN=/home/pi/Apps/epics7/epics-base/bin/linux-arm
$EPICS_BIN/caput ISTTOK:central:UPS-OnBattery OFF
$EPICS_BIN/caput ISTTOK:central:UPS-Shutdown OFF
SYSADMIN=bernardo.brotas@gmail.com
HOSTNAME=`hostname`
MSG="$HOSTNAME UPS $1 Power has returned"
#
(
echo "$MSG"
echo " "
/sbin/apcaccess status
) | $APCUPSD_MAIL -s "$MSG" $SYSADMIN
exit 0

25
epics/apcuspd/onbattery Executable file
View File

@@ -0,0 +1,25 @@
#!/bin/sh
#
# This shell script if placed in /etc/apcupsd
# will be called by /etc/apcupsd/apccontrol when the UPS
# goes on batteries.
# We send an email message to root to notify him.
#
## EPICS
EPICSBIN='/home/pi/Apps/epics7/epics-base/bin/linux-arm'
$EPICSBIN/caput ISTTOK:central:UPS-OnBattery ON
HOSTNAME=`rpi-isttok`
#SYSADMIN=bernardo.brotas@gmail.com
SYSADMIN=humbfig@gmail.com
MSG="$HOSTNAME UPS $1 Power Failure !!!"
#
(
echo "$MSG"
echo " "
/sbin/apcaccess status
) | $APCUPSD_MAIL -s "$MSG" $SYSADMIN
# echo "running script onbattery $MSG"
exit 0

View File

@@ -0,0 +1,10 @@
# ----------------------------
# Package org.csstudio.archive
# ----------------------------
# MySQL example
org.csstudio.archive/url=jdbc:mysql://localhost/archive?rewriteBatchedStatements=true
# RDB user and password
# Some applications also provide command-line option to override.
org.csstudio.archive/user=isttok
org.csstudio.archive/password=0p3rT0k

View File

@@ -0,0 +1,14 @@
#!/bin/bash
#
#JAVA_HOME=/opt/java/jdk/jdk1.8.0_231
JAVA_HOME=/usr/lib/jvm/java-11-openjdk-amd64
PATH=$JAVA_HOME/bin:$PATH
#cd /home/oper/CSS-Archive/archive-engine-4.6.6
cd /home/oper/CSS-Archive/archive-engine
#./ArchiveEngine -pluginCustomization isttok.ini -engine isttokDB -port 4812&
./archive-engine.sh -engine isttokDB -port 4812 -settings isttok.ini
#sleep 2s
#echo "Archive Started. Check browser at http://localhost:4812/main"

View File

@@ -0,0 +1,86 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Example for XML configuration file syntax -->
<engineconfig>
<!-- Engine can have one or more groups
Each group has a name and one or more channels
-->
<group>
<name>IsttokMainVacuum</name>
<!-- Each channel has a name and
a sample period (or expected change period).
The period is either in seconds or in HH:MM:SS format.
It is either using the 'monitor' or 'scan' sample mode.
<monitor/>
<monitor>0.0001</monitor>
-->
<channel>
<name>ISTTOK:central:VVessel-Pressure</name>
<period>10.0</period><scan/>
</channel>
<!-- Example for a monitor with engine-enforced
value change threshold of 2.5
-->
<channel>
<name>ISTTOK:central:OPSTATE</name>
<period>1.0</period>
<monitor/>
</channel>
<channel>
<name>ISTTOK:central:TraceMessage</name>
<period>1.0</period>
<monitor/>
</channel>
<channel>
<name>ISTTOK:central:TMPump1-Emergency</name>
<period>1.0</period>
<monitor/>
</channel>
<channel>
<name>ISTTOK:central:RPump1-Pressure</name>
<period>10.0</period><scan/>
</channel>
<channel>
<name>ISTTOK:central:TMPump1-PressureAdmission</name>
<period>10.0</period>
<monitor>1e-8</monitor>
<enable/>
</channel>
<!-- Channel that is scanned every 10 minutes
<channel>
<name>NSV:Enable</name>
<period>00:10:00</period><scan/>
<enable/>
</channel> -->
<!-- Channel that enables sampling of this group
<channel>
<name>NSV:Enable</name>
<period>1.0</period><monitor/>
<enable/>
</channel> -->
</group>
<group>
<name>IsttokTemperature</name>
<channel>
<name>ISTTOK:temperature:VVessel-Temperature</name>
<period>30.0</period>
<monitor>2.5</monitor>
<enable/>
</channel>
</group>
<!-- Other Group
<group>
<name>SouthSectorVacuum</name>
<channel>
<name>SSV:P1</name>
<period>1.0</period><monitor/>
</channel>
</group> -->
</engineconfig>

19
epics/css/epics-archive.sh Executable file
View File

@@ -0,0 +1,19 @@
#!/bin/bash
#
JAVA_HOME=/usr/lib/jvm/java-11-openjdk-amd64
#PATH=$JAVA_HOME/bin:$PATH
#cd /home/oper/CSS-Archive/archive-engine-4.1.0
TOP="/home/oper/CSS-Archive/archive-engine-4.6.6"
# CSS_ARCH_HOME=/home/oper/CSS-Archive/archive-engine-4.6.6
cd $TOP
#./ArchiveEngine -pluginCustomization isttok.ini -engine isttokDB -port 4812&
#./archive-engine.sh -engine isttokDB -port 4812 -settings isttok.ini
#JAR=`echo "${TOP}/service-archive-engine-*.jar"`
JAR=$(ls service-archive-engine-*.jar)
#$JAVA_HOME/bin/java -jar $JAR $OPT "$@"
$JAVA_HOME/bin/java -jar $JAR -engine isttokDB -port 4812 -settings isttok.ini -noshell
#sleep 2s
#echo "Archive Started. Check browser at http://localhost:4812/main"

View File

@@ -0,0 +1,26 @@
[Unit]
Description=EPICS CSS-Archive engine for ISTTOK Machine control
# After=network.target remote-fs.target
# Requires=network.target
After=network.target
[Service]
Type=simple
# Environment="EPICS_CA_ADDR_LIST=192.168.0.255"
# Environment="EPICS_AUTO_CA_ADDR_LIST=NO"
WorkingDirectory=/home/bernardo/git-repos/ISTTOK/epics/css
## EPICS IOC telnet port is usually 4051, this archive uses 4052
ExecStart=/usr/bin/procServ --foreground --quiet --port=4052 /home/bernardo/git-repos/ISTTOK/epics/css/start-epics-archive.sh
User=bernardo
RuntimeDirectory=epics-css-archive-isttok
StandardOutput=syslog
StandardError=inherit
SyslogIdentifier=procserv-css-archive
[Install]
WantedBy=multi-user.target
# telnet localhost 4052
# Connected to localhost.
# Escape character is '^]'. (Ctrl + AltGr + ])
# Ctrl + D
# > quit

8
epics/css/get_tracelog.sh Executable file
View File

@@ -0,0 +1,8 @@
#!/bin/bash
#mysql -u report -p"\$report" -D archive -e 'SELECT `smpl_time`, `severity_id`, `status_id`, `str_val` FROM `sample` WHERE `channel_id` = 12'
#mysql -u report -p"\$report" -D archive <<< 'show tables'
#mysql -u report -p"\$report" -D archive <<< "SELECT `smpl_time`, `severity_id`, `status_id`, `str_val` FROM `sample` WHERE `channel_id` = 13"
mysql -u report -h 193.136.136.88 -p"\$report" -D isttok_archiveDB <<< 'SELECT `smpl_time`, `str_val` , `severity_id`, `status_id` FROM sample WHERE channel_id = 12 ORDER by `smpl_time` DESC LIMIT 20'
#"SELECT `smpl_time`, `severity_id`, `status_id`, `str_val` FROM `sample` WHERE `channel_id` = 13"

34
epics/css/isttok.ini Normal file
View File

@@ -0,0 +1,34 @@
# make a link to this file in the archive-engine instalation folder. eg.
# ln -s ~/git-repos/ISTTOK/epics/css/isttok.ini /opt/epics/archive-engine/
# -------------------------
# Package org.phoebus.pv.ca
# -------------------------
# Channel Access address list
# org.phoebus.pv.ca/addr_list=192.168.1.255
org.phoebus.pv.ca/addr_list=192.168.1.110 192.168.1.152
org.phoebus.pv.ca/auto_addr_list=false
# -------------------------
# Package org.phoebus.pv.pva
# -------------------------
# PVAccess address list
org.phoebus.pv.pva/epics_pva_addr_list=192.168.1.110 192.168.1.152
# PVAccess auto address list - true/false
org.phoebus.pv.pva/epics_pva_auto_addr_list=false
# ----------------------------
# Package org.csstudio.archive
# ----------------------------
# MySQL DB access
# org.csstudio.archive/url=jdbc:mysql://localhost/isttok_archiveDB?rewriteBatchedStatements=true
# PostgreSQL:
org.csstudio.archive/url=jdbc:postgresql://db.tecnico.ulisboa.pt:5432/g03155_archive
# RDB user and password
# Some applications also provide command-line option to override.
#org.csstudio.archive/user=isttok
# org.csstudio.archive/url=jdbc:mysql://db.tecnico.ulisboa.pt/g03155_isttokDB?rewriteBatchedStatements=true
# Caused by: javax.net.ssl.SSLHandshakeException: The server selected protocol version TLS11 is not accepted by client preferences [TLS13, TLS12]
org.csstudio.archive/user=g03155_archive
org.csstudio.archive/password=XXXXXX

View File

@@ -0,0 +1,126 @@
# https://control-system-studio.readthedocs.io/en/latest/preferences.html
# Full list at
# https://control-system-studio.readthedocs.io/en/latest/preference_properties.html
#
# # -------------------------
# Package org.phoebus.pv.ca
# -------------------------
# Channel Access address list
org.phoebus.pv.ca/addr_list=192.168.1.110 192.168.1.152
org.phoebus.pv.ca/auto_addr_list=false
# to select the type of PV or network protocol.
# The preference setting
#
# org.phoebus.pv/default=ca
# -------------------------
# Package org.phoebus.pv.pva
# -------------------------
org.phoebus.pv.pva/epics_pva_addr_list=193.136.136.88
org.phoebus.pv.pva/epics_pva_auto_addr_list=false
# ----------------------
# Package org.phoebus.ui
# ----------------------
# Top resources to show in "File" menu and toolbar
#
# Format:
# uri1 | uri2,Display name 2 | uri3,Display name 3
# org.phoebus.ui/top_resources=$(user.home)/git-repos/esther-epics/phoebus-display-builder/CSS/EstherVacuum.bob?app=display_runtime,Esther Vacuum
org.phoebus.ui/top_resources=Examples:/01_main.bob?app=display_runtime,Example Display | pv://?sim://sine&app=probe,Probe Example | pv://?sim://sine&loc:
#//x(10)&app=pv_table,PV Tarchiveable Example | http://www.google.com?app=web, Google
# ----------------------------
# Package org.csstudio.archive
# ----------------------------
# RDB URL for archived data
#
# MySQL
org.csstudio.archive/url=jdbc:mysql://193.136.136.88/isttok_archiveDB?rewriteBatchedStatements=true
# RDB user and password
# Some applications also provide command-line option to override.
org.csstudio.archive/user=report
org.csstudio.archive/password=$report
# Schema name. Used with an added "." as prefix for table names.
# For now this is only used with Oracle URLs and ignored for MySQL
org.csstudio.archive/schema=
# Timeout [seconds] for certain SQL queries
# Setting the timeout to 0 disables calls to setQueryTimeout.
org.csstudio.archive/timeout_secs=0
#---------------------------------------
# Package org.phoebus.archive.reader.rdb
# --------------------------------------
# User and password for reading archived data
org.phoebus.archive.reader.rdb/user=report
org.phoebus.archive.reader.rdb/password=$report
# Use a BLOB to read array samples?
#
# The original SAMPLE table did not contain an ARRAY_VAL column
# for the array blob data, but instead used a separate ARRAY_VAL table.
# When running against an old database, this parameter must be set to false.
org.phoebus.archive.reader.rdb/use_array_blob=true
# Use stored procedures and functions for 'optimized' data readout?
# Set to procedure name, or nothing to disable stored procedure.
org.phoebus.archive.reader.rdb/stored_procedure=
org.phoebus.archive.reader.rdb/starttime_function=
# MySQL:
# stored_procedure=archive.get_browser_data
# JDBC Statement 'fetch size':
# Number of samples to read in one network transfer.
org.phoebus.archive.reader.rdb/fetch_size=1000
# ----------------------------------------
# Package org.csstudio.trends.databrowser3
# ----------------------------------------
# Default auto scale value
# Possible values are: true to enable the automatic calculation of the min/max Y-axis, or false to use min/max fixed values.
org.csstudio.trends.databrowser3/use_auto_scale=false
# Default time span displayed in plot in seconds
org.csstudio.trends.databrowser3/time_span=3600
# Default scan period in seconds. 0 for 'monitor'
org.csstudio.trends.databrowser3/scan_period=0.0
# Default plot update period in seconds
org.csstudio.trends.databrowser3/update_period=3.0
# .. elements in live sample buffer
org.csstudio.trends.databrowser3/live_buffer_size=5000
# Default line width
org.csstudio.trends.databrowser3/line_width=2
# Opacity of 'area'
# 0%: Area totally transparent (invisible)
# 20%: Area quite transparent
# 100%: Area uses solid color
org.csstudio.trends.databrowser3/opacity=40
# Default trace type for newly created traces.
# Allowed values are defined by org.csstudio.trends.databrowser3.model.TraceType:
# AREA, ERROR_BARS, SINGLE_LINE, AREA_DIRECT, SINGLE_LINE_DIRECT, SQUARES, ...
org.csstudio.trends.databrowser3/trace_type=AREA
# RDB URLs
# View Archive Data
org.csstudio.trends.databrowser3/urls=jdbc:mysql://193.136.136.88/isttok_archiveDB | RDB
org.csstudio.trends.databrowser3/archives=jdbc:mysql://193.136.136.88/isttok_archiveDB | RDB
# Default data sources for newly added channels
# Format: Same as 'urls'
#org.csstudio.trends.databrowser3/archives=jdbc:mysql://10.10.136.128/archive
# When opening existing data browser plot,
# use archive data sources specified in the configuration file (original default)
# or ignore saved data sources and instead use the preference settings?
org.csstudio.trends.databrowser3/use_default_archives=false

View File

@@ -0,0 +1,302 @@
/*
https://github.com/ControlSystemStudio/phoebus/blob/master/services/archive-engine/dbd/postgres_schema.txt
* These commands create a new PostGres SQL database for archiving.
*
* THIS WILL DELETE ANY DATA THAT MIGHT BE IN THERE!
*
* The Oracle schema should be similar, except:
* - Exact data types can vary (length of strings etc.)
* - Oracle TIMESTAMP already includes the nanosecond detail, so
* no separate "nanosecs" column is required
* - Support for partitioning
*
* Test setup:
* postgres 8.1.20 on a Linux Laptop
* (1.6 GHz, disk access hampered by pointsec)
* and INSERTs performed from a Java program
* on a 1.3 GHz OS X PowerBook G4
*
* Result of 10 min test run with MyISAM (no referential integrity check)
* About 2500 inserts per second,
* using ~33 bytes per value
* (overall database size / pure sample count).
* accl2 (about 20% CPU used by other people) -> ics-srv-softioc4: 1900 / sec
* fe-ics-opi1 (otherwise ~idle CPU) -> ics-srv-softioc4: 3400 / sec
* local, all on ics-srv-softioc4: 11000 / sec
*
* Result of 10 min test run with InnoDB (check sample.channel_id)
* About 750 inserts per second.
* Byte/sample unclear because not all data in a mysql/data subdir?
* accl2 -> ics-srv-softioc4: 1200 / sec
* local, all on ics-srv-softioc4: 3500 / sec
*/
-- Create 'archive' user who can remotely access the 'archive' tables,
-- but only change the table layout locally
--
-- Assume you are connected as the 'postgres' super user
/*
CREATE USER archive WITH PASSWORD '$archive';
ALTER USER archive WITH PASSWORD '$archive';
CREATE USER report WITH PASSWORD '$report';
SELECT * FROM pg_user;
-- The following would have to be executed _after_ creating the tables:
GRANT SELECT, INSERT, UPDATE, DELETE
ON smpl_eng, retent, smpl_mode, chan_grp, channel, status, severity, sample, array_val, num_metadata, enum_metadata
TO archive;
GRANT SELECT
ON smpl_eng, retent, smpl_mode, chan_grp, channel, status, severity, sample, array_val, num_metadata, enum_metadata
TO report;
-- Might have to check with \d which sequences were
-- created by Postgres to handle the SERIAL columns:
GRANT USAGE ON SEQUENCE
chan_grp_grpid_seq, channel_chid, retent_retentid_seq,
severity_sevid, smpl_eng_engid_seq, status_statid
TO archive;
DROP DATABASE IF EXISTS g03155_archive;
CREATE DATABASE g03155_archive;
*/
------------------------
\connect g03155_archive
------------------------
-- Sample engine
CREATE SEQUENCE smpl_eng_engid_seq;
DROP TABLE IF EXISTS archive_schema;
CREATE TABLE archive_schema(
id SERIAL PRIMARY KEY,
version VARCHAR(10)
);
DROP TABLE IF EXISTS smpl_eng;
CREATE TABLE smpl_eng
(
eng_id BIGINT NOT NULL PRIMARY KEY DEFAULT nextval('smpl_eng_engid_seq'),
name VARCHAR(100) NOT NULL,
descr VARCHAR(100) NOT NULL,
url VARCHAR(100) NOT NULL
);
INSERT INTO smpl_eng VALUES (1, 'Demo', 'Demo Engine', 'http://localhost:4812');
SELECT * FROM smpl_eng;
------------------------
-- Retention
-- Not used at this time
CREATE SEQUENCE retent_retentid_seq;
DROP TABLE IF EXISTS retent;
CREATE TABLE retent
(
retent_id BIGINT NOT NULL PRIMARY KEY DEFAULT nextval('retent_retentid_seq'),
descr VARCHAR(255) NOT NULL
);
INSERT INTO retent VALUES (30, 'Months');
INSERT INTO retent VALUES (9999, 'Forever');
SELECT * FROM retent;
------------------------
-- Channel Group
CREATE SEQUENCE chan_grp_grpid_seq;
DROP TABLE IF EXISTS chan_grp;
CREATE TABLE chan_grp
(
grp_id BIGINT NOT NULL PRIMARY KEY DEFAULT nextval('chan_grp_grpid_seq'),
name VARCHAR(100) NOT NULL,
eng_id BIGINT NOT NULL,
descr VARCHAR(100) NULL,
enabling_chan_id BIGINT NULL
);
INSERT INTO chan_grp VALUES (1, 'Demo', 1, 'Demo Group', NULL);
SELECT * FROM chan_grp;
------------------------
-- Sample modes
DROP TABLE IF EXISTS smpl_mode;
CREATE TABLE smpl_mode
(
smpl_mode_id BIGINT NOT NULL PRIMARY KEY,
name VARCHAR(100) NOT NULL,
descr VARCHAR(100) NOT NULL
);
INSERT INTO smpl_mode VALUES (1, 'Monitor', 'Store every received update');
INSERT INTO smpl_mode VALUES (2, 'Scan', 'Periodic scan');
SELECT * FROM smpl_mode;
------------------------
-- Channel: ID and name
CREATE SEQUENCE channel_chid;
DROP TABLE IF EXISTS channel;
CREATE TABLE channel
(
channel_id BIGINT NOT NULL PRIMARY KEY DEFAULT nextval('channel_chid'),
name VARCHAR(100) NOT NULL,
descr VARCHAR(100) NULL,
grp_id BIGINT NULL,
smpl_mode_id BIGINT NULL,
smpl_val double precision NULL,
smpl_per double precision NULL,
retent_id BIGINT NULL,
retent_val DOUBLE precision NULL
);
-- Need index on channel name
CREATE INDEX channel_name_idx ON channel ( name );
INSERT INTO channel(channel_id, name) VALUES (1, 'sim://sine(0, 10, 50, 0.1)');
INSERT INTO channel(channel_id, name) VALUES (2, 'sim://noiseWaveform(0,10,100,10)');
INSERT INTO channel(channel_id, name) VALUES (3, 'freddy');
INSERT INTO channel(channel_id, name) VALUES (4, 'jane');
UPDATE channel SET retent_val=9999 WHERE channel_id < 4;
UPDATE channel SET grp_id=1 WHERE channel_id < 4;
UPDATE channel SET smpl_val=1 WHERE channel_id = 1;
SELECT * FROM channel;
------------------------
-- Severity mapping of severity ID to string
CREATE SEQUENCE severity_sevid;
DROP TABLE IF EXISTS severity;
CREATE TABLE severity
(
severity_id BIGINT NOT NULL PRIMARY KEY default nextval('severity_sevid'),
name VARCHAR(100) NOT NULL
);
INSERT INTO severity VALUES (1, 'OK'), (2, 'MINOR'), (3, 'MAJOR'), (4, 'INVALID');
SELECT * FROM severity;
------------------------
-- Status mapping of status ID to string
create sequence status_statid;
DROP TABLE IF EXISTS status;
CREATE TABLE status
(
status_id BIGINT PRIMARY KEY default nextval('status_statid'),
name VARCHAR(100) NOT NULL UNIQUE
);
INSERT INTO status (name) VALUES ('OK'), ('disconnected');
SELECT * FROM status;
------------------------
-- Samples of a channel
-- Either the numeric, floating point or string value should be set,
-- not all of them.
--
-- See array_encoding.txt for handling of array data.
DROP TABLE IF EXISTS sample;
CREATE TABLE sample
(
channel_id BIGINT NOT NULL,
smpl_time TIMESTAMP NOT NULL,
nanosecs BIGINT NOT NULL,
severity_id BIGINT NOT NULL,
status_id BIGINT NOT NULL,
num_val INT NULL,
float_val double precision NULL,
str_val VARCHAR(120) NULL,
datatype CHAR(1) NULL DEFAULT ' ',
array_val BYTEA NULL,
-- Note that these foreign keys are good for data consistency,
-- but bad for performance.
-- Writing to the table will be almost twice as fast without
-- the following constraints
FOREIGN KEY (channel_id) REFERENCES channel (channel_id) ON DELETE CASCADE,
FOREIGN KEY (severity_id) REFERENCES severity (severity_id) ON DELETE CASCADE,
FOREIGN KEY (status_id) REFERENCES status (status_id) ON DELETE CASCADE
);
-- Need index on channel_id and smpl_time?
CREATE INDEX sample_id_time ON sample ( channel_id, smpl_time, nanosecs );
-- These inserts are in reverse time order to check retrieval
INSERT INTO sample (channel_id, smpl_time, nanosecs, severity_id, status_id, float_val)
VALUES (1, '2004-01-10 13:01:17', 1, 3, 2, 3.16),
(1, '2004-01-10 13:01:11', 2, 1, 1, 3.16),
(1, '2004-01-10 13:01:10', 3, 1, 2, 3.15),
(1, '2004-01-10 13:01:10', 4, 1, 2, 3.14);
------------------------
-- *** OLD Array element table. Replaced by array_val BLOB in sample table ***
-- See sample table: Array elements 1, 2, 3, ... beyond the element 0
-- that's in the sample table
DROP TABLE IF EXISTS array_val;
CREATE TABLE array_val
(
channel_id BIGINT NOT NULL,
smpl_time TIMESTAMP NOT NULL,
nanosecs BIGINT NOT NULL,
seq_nbr BIGINT NOT NULL,
float_val double precision NULL,
FOREIGN KEY (channel_id) REFERENCES channel (channel_id) ON DELETE CASCADE
);
CREATE INDEX array_val_id_time ON array_val ( channel_id, smpl_time, nanosecs );
------------------------
-- Channel Meta data: Units etc. for numeric channels
DROP TABLE IF EXISTS num_metadata;
CREATE TABLE num_metadata
(
channel_id BIGINT NOT NULL PRIMARY KEY,
low_disp_rng double precision NULL,
high_disp_rng double precision NULL,
low_warn_lmt double precision NULL,
high_warn_lmt double precision NULL,
low_alarm_lmt double precision NULL,
high_alarm_lmt double precision NULL,
prec INT NULL,
unit VARCHAR(100) NOT NULL
);
INSERT INTO num_metadata VALUES (1, 0, 10, 2, 8, 1, 9, 2, 'mA');
SELECT * FROM num_metadata;
------------------------
-- Enumerated channels have a sample.num_val that can also be interpreted
-- as an enumeration string via this table
DROP TABLE IF EXISTS enum_metadata;
CREATE TABLE enum_metadata
(
channel_id BIGINT NOT NULL,
enum_nbr INT NULL,
enum_val VARCHAR(120) NULL,
FOREIGN KEY (channel_id) REFERENCES channel (channel_id) ON DELETE CASCADE
);
------------------------
------------------------
------------------------
-- Dump all values for all channels
SELECT channel.name, smpl_time, severity.name, status.name, float_val
FROM channel, severity, status, sample
WHERE channel.channel_id = sample.channel_id AND
severity.severity_id = sample.severity_id AND
status.status_id = sample.status_id
ORDER BY channel.name, smpl_time
LIMIT 50;
-- Same with INNER JOIN
SELECT channel.name AS channel,
smpl_time,
severity.name AS severity,
status.name AS status,
float_val
FROM sample INNER JOIN channel ON sample.channel_id = channel.channel_id INNER JOIN severity ON sample.severity_id = severity.severity_id INNER JOIN status
ON sample.status_id = status.status_id
ORDER BY smpl_time
LIMIT 50;

5
epics/css/pyQt/config.py Normal file
View File

@@ -0,0 +1,5 @@
# git update-index --assume-unchanged config.py
host = "xx.tecnico.ulisboa.pt"
database = "YYYYY"
username = "XXXXXX"
password = "ZZZZZZ"

View File

@@ -0,0 +1,101 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
PyQt6 SQL App for Esther Reports
Python version of http://esther.tecnico.ulisboa.pt/esther-php/show_report.php
ssh -X -t golem 'cd /home/esther/git-repos/esther-python/sql; zsh -l'
"""
import os
import sys
from PyQt6.QtCore import QSize, QDate, Qt
# from PyQt6 import QtCore
from PyQt6.QtGui import QAction, QIcon, QPixmap # QFont
from PyQt6.QtSql import (
QSqlDatabase,
QSqlRelation,
# QSqlRelationalDelegate,
QSqlRelationalTableModel,
QSqlTableModel,
QSqlQuery,
QSqlQueryModel,
)
from PyQt6.QtWidgets import (
QWidget,
QApplication,
QLineEdit, QDateEdit,
QMainWindow,
QTableView,
QVBoxLayout, QHBoxLayout, QGridLayout, QFormLayout,
QDialog,
QDialogButtonBox, QPushButton,
QCheckBox,
QComboBox,
QSpinBox,
QRadioButton,
QLabel,
QTableWidget, QTableWidgetItem,
QStatusBar,
QSlider,
QToolBar,
QTabWidget,
# QSizePolicy,
QAbstractScrollArea,
)
import config as cfg
db = QSqlDatabase("QPSQL")
db.setHostName(cfg.host)
db.setDatabaseName(cfg.database)
db.setUserName(cfg.username)
db.setPassword(cfg.password)
"""
db.open()
query = QSqlQuery(db=db)
query.exec("SELECT * FROM channel")
while (query.next()):
print(query.value(0))
print(query.value(1))
"""
class MainWindow(QMainWindow):
def __init__(self):
super().__init__()
container = QWidget()
layoutMain = QHBoxLayout()
if not db.open():
print("DB not openned")
sys.exit(-1)
model = QSqlTableModel(db=db)
model.setTable('channel')
model.select()
self.tableViewReports = QTableView()
self.tableViewReports.setModel(model)
layoutMain.addWidget(self.tableViewReports)
self.setStatusBar(QStatusBar(self))
container.setLayout(layoutMain)
self.setMinimumSize(QSize(1200, 700))
self.setCentralWidget(container)
app = QApplication(sys.argv)
window = MainWindow()
window.show()
# sys.exit(app.exec())
app.exec()
# vim: syntax=python ts=4 sw=4 sts=4 sr exit

View File

@@ -0,0 +1,2 @@
python3-pyqt6
libqt6sql6-psql

View File

@@ -0,0 +1,12 @@
#!/bin/bash
#
JAVA_HOME=/usr/lib/jvm/java-17-openjdk-amd64
TOP="/opt/epics/archive-engine"
cd $TOP
#JAR=`echo "${TOP}/service-archive-engine-*.jar"`
JAR=$(ls service-archive-engine-*.jar)
#$JAVA_HOME/bin/java -jar $JAR $OPT "$@"
$JAVA_HOME/bin/java -jar $JAR -import /home/bernardo/git-repos/ISTTOK/epics/css/xml/isttokcontrol.xml -replace_engine -engine isttokDB -port 4812 -settings isttok.ini

View File

@@ -0,0 +1,14 @@
#!/bin/bash
#
JAVA_HOME=/usr/lib/jvm/java-17-openjdk-amd64
TOP="/opt/epics/archive-engine"
cd $TOP
#JAR=`echo "${TOP}/service-archive-engine-*.jar"`
JAR=$(ls service-archive-engine-*.jar)
#$JAVA_HOME/bin/java -jar $JAR $OPT "$@"
$JAVA_HOME/bin/java -jar $JAR -engine isttokDB -port 4812 -settings isttok.ini -noshell
#sleep 2s
#echo "Archive Started. Check browser at http://localhost:4812/main"

2
epics/css/sys-mng-opi/.gitignore vendored Normal file
View File

@@ -0,0 +1,2 @@
.metadata/
CSS/.project

View File

@@ -8,7 +8,7 @@
<scroll>true</scroll>
<update_period>3.0</update_period>
<scroll_step>5</scroll_step>
<start>-15 days 0.0 seconds</start>
<start>-1 days 0.0 seconds</start>
<end>now</end>
<archive_rescale>NONE</archive_rescale>
<background>
@@ -32,8 +32,8 @@
<green>0</green>
<blue>0</blue>
</color>
<min>4.923402629482079E-38</min>
<max>6.616152516271121E7</max>
<min>1.0E-8</min>
<max>100.0</max>
<grid>true</grid>
<autoscale>false</autoscale>
<log_scale>true</log_scale>
@@ -49,25 +49,42 @@
<green>0</green>
<blue>0</blue>
</color>
<min>5.137681385218519E-15</min>
<max>1.681969375676812E12</max>
<min>1.0E-12</min>
<max>0.01</max>
<grid>true</grid>
<autoscale>false</autoscale>
<log_scale>true</log_scale>
</axis>
<axis>
<visible>false</visible>
<name>Value 3</name>
<use_axis_name>false</use_axis_name>
<use_trace_names>true</use_trace_names>
<right>false</right>
<color>
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
<min>0.0</min>
<max>0.1</max>
<grid>false</grid>
<autoscale>false</autoscale>
<log_scale>true</log_scale>
</axis>
</axes>
<annotations>
</annotations>
<pvlist>
<pv>
<display_name>ISTTOK:vacuum:Pressure_Chamber1</display_name>
<display_name>RPump1-Pressure</display_name>
<visible>true</visible>
<name>ISTTOK:vacuum:Pressure_Chamber1</name>
<name>ISTTOK:central:RPump1-Pressure</name>
<axis>0</axis>
<color>
<red>21</red>
<green>21</green>
<blue>196</blue>
<red>255</red>
<green>0</green>
<blue>0</blue>
</color>
<trace_type>AREA</trace_type>
<linewidth>2</linewidth>
@@ -78,20 +95,20 @@
<ring_size>5000</ring_size>
<request>OPTIMIZED</request>
<archive>
<name>rdb</name>
<name>RDB</name>
<url>jdbc:mysql://192.168.1.152/archive</url>
<key>1</key>
</archive>
</pv>
<pv>
<display_name>ISTTOK:vacuum:Pressure_Primary1</display_name>
<display_name>RPump2-Pressure</display_name>
<visible>true</visible>
<name>ISTTOK:vacuum:Pressure_Primary1</name>
<axis>1</axis>
<name>ISTTOK:central:RPump2-Pressure</name>
<axis>0</axis>
<color>
<red>242</red>
<green>26</green>
<blue>26</blue>
<red>255</red>
<green>165</green>
<blue>0</blue>
</color>
<trace_type>AREA</trace_type>
<linewidth>2</linewidth>
@@ -102,7 +119,55 @@
<ring_size>5000</ring_size>
<request>OPTIMIZED</request>
<archive>
<name>rdb</name>
<name>RDB</name>
<url>jdbc:mysql://192.168.1.152/archive</url>
<key>1</key>
</archive>
</pv>
<pv>
<display_name>TMPump1-PressureAdmission</display_name>
<visible>true</visible>
<name>ISTTOK:central:TMPump1-PressureAdmission</name>
<axis>1</axis>
<color>
<red>0</red>
<green>0</green>
<blue>255</blue>
</color>
<trace_type>AREA</trace_type>
<linewidth>2</linewidth>
<point_type>NONE</point_type>
<point_size>2</point_size>
<waveform_index>0</waveform_index>
<period>0.0</period>
<ring_size>5000</ring_size>
<request>OPTIMIZED</request>
<archive>
<name>RDB</name>
<url>jdbc:mysql://192.168.1.152/archive</url>
<key>1</key>
</archive>
</pv>
<pv>
<display_name>VVessel-Pressure</display_name>
<visible>true</visible>
<name>ISTTOK:central:VVessel-Pressure</name>
<axis>1</axis>
<color>
<red>0</red>
<green>128</green>
<blue>0</blue>
</color>
<trace_type>AREA</trace_type>
<linewidth>2</linewidth>
<point_type>NONE</point_type>
<point_size>2</point_size>
<waveform_index>0</waveform_index>
<period>0.0</period>
<ring_size>5000</ring_size>
<request>OPTIMIZED</request>
<archive>
<name>RDB</name>
<url>jdbc:mysql://192.168.1.152/archive</url>
<key>1</key>
</archive>

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,98 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- XML configuration for ISTTOK COntrol
2018/01/25 14:28:06.826000000
Usage:
# To replace engine:
# ./archive-engine.sh -import ArchiveConfigTool/xml/isttokcontrol.xml -replace_engine -engine ISTTOKcontrol -settings isttok.ini
# To run:
# ./epics-archive-engine.sh -engine ISTTOKcontrol -settings isttok.ini
-->
<engineconfig>
<group>
<name>ISTTOKcontrol</name>
<channel><name>ISTTOK:central:VVessel-Pressure</name>
<period>00:01:00</period><scan/>
</channel>
<channel><name>ISTTOK:central:TMPump1-PressureAdmission</name>
<period>00:01:00</period><scan/>
</channel>
<channel><name>ISTTOK:central:RPump1-Pressure</name>
<period>00:01:00</period><scan/>
</channel>
<channel><name>ISTTOK:central:RPump2-Pressure</name>
<period>00:01:00</period><scan/>
</channel>
<channel><name>ISTTOK:central:PULSE-NUMBER</name>
<period>00:10:00</period><monitor/>
</channel>
<channel><name>ISTTOK:central:LogMessage</name>
<period>00:10:00</period><monitor/>
</channel>
<channel><name>ISTTOK:central:TraceMessage</name>
<period>00:10:00</period><monitor/>
</channel>
<channel><name>ISTTOK:temperature:VVessel-Temperature</name>
<period>00:02:00</period>
<monitor>1.0</monitor>
</channel>
<channel><name>ISTTOK:central:OPSTATE</name>
<period>00:10:00</period><monitor/>
</channel>
<channel><name>ISTTOK:central:Archive-Enable</name>
<period>00:10:00</period><monitor/>
<enable/>
</channel>
<!--
<channel><name>ISTTOK:temperature:RawTemperature_0</name>
<period>00:00:30</period><scan/>
</channel>
<channel><name>ISTTOK:temperature:Temperature_0</name>
<period>00:00:30</period><scan/>
</channel>
<channel><name>ISTTOK:temperature:Capbank_Voltage</name>
<period>00:00:30</period><scan/>
</channel>
<channel><name>ISTTOK:vacuum:Pressure_Chamber1</name>
<period>10.0</period>
<monitor>0.002e-6</monitor>
<scan/>
</channel>
<channel><name>ISTTOK:vacuum:Pressure_Chamber1calc</name>
<period>30.0</period>
<monitor>0.002e-6</monitor>
<monitor/>
</channel>
<channel><name>ISTTOK:temperature:Uptime</name><period>00:00:30</period><scan/></channel>
<channel><name> ISTTOK:galium:Temperature_0</name>
<period>30.0</period><monitor/>
</channel>
<channel><name> ISTTOK:galium:Temperature_1</name>
<period>30.0</period><monitor/>
</channel>
<channel><name> ISTTOK:galium:Temperature_2</name>
<period>30.0</period><monitor/>
</channel>
<channel><name> ISTTOK:galium:Temperature_3</name>
<period>30.0</period><monitor/>
</channel>
<channel><name> ISTTOK:galium:Temperature_4</name>
<period>30.0</period><monitor/>
</channel>
<channel><name> ISTTOK:galium:Temperature_5</name>
<period>30.0</period><monitor/>
</channel>
<channel><name>sim://noiseWaveform(0,10,100,10)</name>
<period>00:00:00.100</period><scan/>
</channel>
<channel>
<name>sim://sine(0, 10, 50, 0.1)</name>
<period>00:00:00.100</period>
<scan/>
</channel>
-->
</group>
</engineconfig>

View File

@@ -0,0 +1,210 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Thu Feb 8 16:34:35 2018
@author: joao_loureiro/bernardo carvalho
add EPICS path to /etc/apache2/envvars
"""
import epics
import time
import os
os.environ['MPLCONFIGDIR'] = '/var/www/html/matplotlib'
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
import matplotlib.ticker as mtick
from matplotlib.ticker import FuncFormatter
import mpld3
from mpld3 import plugins, utils
import numpy as np
import MySQLdb
os.environ['EPICS_CA_ADDR_LIST']= '192.168.1.110 192.168.1.152'
os.environ['EPICS_CA_AUTO_ADDR_LIST']= 'NO'
def format_tick_labels(x, pos):
return f"{x:5.2g}"
class HelloWorld(mpld3.plugins.PluginBase): # inherit from PluginBase
"""Hello World plugin"""
JAVASCRIPT = """
mpld3.register_plugin("helloworld", HelloWorld);
HelloWorld.prototype = Object.create(mpld3.Plugin.prototype);
HelloWorld.prototype.constructor = HelloWorld;
function HelloWorld(fig, props){
mpld3.Plugin.call(this, fig, props);
};
HelloWorld.prototype.draw = function(){
// FIXME: this is a very brittle way to select the y-axis element
var ax = this.fig.axes[0].elements[1];
// see https://github.com/mbostock/d3/wiki/Formatting#d3_format
// for d3js formating documentation
ax.axis.tickFormat(d3.format(",.3e"));
// TODO: use a function for tick values that
// updates when values pan and zoom
//ax.axis.tickValues([1,100,1000]);
// HACK: use reset to redraw figure
this.fig.reset();
}
"""
def __init__(self):
self.dict_ = {"type": "helloworld"}
style_tooltip = """
<style>
.tooltip {
position: relative;
display: inline-block;
border-bottom: 1px dotted black;
}
.tooltip .tooltiptext {
visibility: hidden;
width: 800px;
background-color: #555;
color: #fff;
text-align: center;
border-radius: 6px;
padding: 5px 0;
position: absolute;
z-index: 1;
bottom: 125%;
left: 50%;
margin-left: -60px;
opacity: 0;
transition: opacity 1s;
}
.tooltip .tooltiptext::after {
content: "";
position: absolute;
top: 100%;
left: 50%;
margin-left: -5px;
border-width: 5px;
border-style: solid;
border-color: #555 transparent transparent transparent;
}
.tooltip:hover .tooltiptext {
visibility: visible;
opacity: 1;
}
</style>
"""
def text_with_tooltip(text, tooltip):
html = '<div class="tooltip">'+text+'\n'\
' <span class="tooltiptext">'+tooltip+'</span></div>'
return html
def application(environ,start_response):
status = '200 OK'
valuePrimary1 = epics.caget('ISTTOK:central:RPump1-Pressure')
# valuePrimary2 = epics.caget('ISTTOK:central:RPump2-Pressure')
valueChamber1 = epics.caget('ISTTOK:central:VVessel-Pressure')
valueTMPadmission = epics.caget('ISTTOK:central:TMPump1-PressureAdmission')
now = time.ctime()
# Open database connection
# db = MySQLdb.connect(host = "192.168.1.152",user = "report", passwd="$report", db = "archive")
db = MySQLdb.connect(host = "192.168.1.100",user = "report", passwd="$report", db = "archive")
# prepare a cursor object using cursor() method
cursor = db.cursor()
# channel_id =5 | ISTTOK:central:VVessel-Pressure
sql_chamber ="SELECT `smpl_time`, `float_val` FROM `sample` WHERE `channel_id` = 5 " \
"AND `smpl_time` > addtime(now(),'-01:00:00') ORDER BY `smpl_time` DESC LIMIT 100;"
# sql_chamber ="SELECT `smpl_time`, `float_val` FROM `sample` WHERE `channel_id` = 5 ORDER BY `smpl_time` DESC LIMIT 250;"
# 21 | ISTTOK:central:RPump1-Pressure
sql_primary ="SELECT `smpl_time`, `float_val` FROM `sample` WHERE `channel_id` = 6 " \
"AND `smpl_time` > addtime(now(),'-01:00:00') ORDER BY `smpl_time` DESC LIMIT 100;"
# sql_primary ="SELECT `smpl_time`, `float_val` FROM `sample` WHERE `channel_id` = 6 ORDER BY `smpl_time` DESC LIMIT 250;"
# Execute the SQL command
cursor.execute(sql_chamber)
# Fetch all the rows in a list of lists.
results = cursor.fetchall()
data_chamber = []
for row in results:
data_chamber.append([row[0],row[1]])
# Execute the SQL command
cursor.execute(sql_primary)
# Fetch all the rows in a list of lists.
results = cursor.fetchall()
data_primary = []
for row in results:
data_primary.append([row[0],row[1]])
# disconnect from server
db.close()
#
data_chamber = np.array(data_chamber)
data_primary = np.array(data_primary)
fig,axr = plt.subplots(1, sharex=True)
axr.set_yscale('log')
axr.yaxis.set_major_formatter(FuncFormatter(format_tick_labels))
axr.semilogy(data_chamber[:,0],data_chamber[:,1], color='red')
axr.set_ylim(1e-8, 1e-4)
# axr.legend(['Tokamak Chamber', 'Primary pump'], loc =2)
axr.legend(['Tokamak Chamber'], loc='upper left')
axr.set_xlabel('Time', fontsize = 15)
axr.set_ylabel('TMP1Pressure/mbar', fontsize = 15, color = 'red')
ax2 = axr.twinx()
ax2.plot(data_primary[:,0],data_primary[:,1], color='blue')
ax2.set_ylabel('Rpump Pressure/mbar', fontsize = 15, color = 'blue')
ax2.yaxis.set_major_formatter(mtick.FormatStrFormatter('%.3e'))
ax2.set_ylim(1e-4, 1e-2)
fig.set_size_inches(12,5, forward=True)
fig.tight_layout()
ax_fmt = HelloWorld()
mpld3.plugins.connect(fig, ax_fmt)
html2 = mpld3.fig_to_html(fig)
html = '<html>\n' \
'<head>' \
'<title>ISTTOK EPICS WSGI Page</title>' \
'</head>\n' \
'<body>\n' \
'<div>'+style_tooltip+'</div>\n'\
'<div style="width: 100%; font-size: 40px; font-weight: bold; text-align: center;">\n' \
'mod_wsgi EPICS ISTTOK info Page\n' \
'</div>\n' \
'<div style="width: 100%; font-size: 20px; font-weight: bold; text-align: center;">\n' \
' '+text_with_tooltip('Rpump1 pressure: '+ '{0:.3e}'.format(valuePrimary1)+ ' mBar','ISTTOK:central:RPump1-Pressure')+'\n' \
'</div>\n' \
'<div style="width: 100%; font-size: 20px; font-weight: bold; text-align: center;">\n' \
' '+text_with_tooltip('Turbopump 1 admission pressure: '+ '{0:.3e}'.format(valueTMPadmission)+ ' mBar','ISTTOK:central:TMPump1-PressureAdmission')+'\n' \
'</div>\n' \
'<div style="width: 100%; font-size: 20px; font-weight: bold; text-align: center;">\n' \
' '+text_with_tooltip('Tokamak Vessel pressure: '+ '{0:.3e}'.format(valueChamber1)+ ' mBar','ISTTOK:central:VVessel-Pressure')+'\n' \
'</div>\n' \
'<div style="width: 100%; font-size: 20px; font-weight: bold; text-align: center;">\n' \
'Current Time: ' +now+ '\n' \
'</div><center>\n'+html2 +'</center>\n' \
'</body>\n' \
'</html>\n'
response_header = [('Content-type','text/html')]
start_response(status,response_header)
html = bytes(html, encoding= 'utf-8')
return [html]
#'</div><center>\n'+html2.encode('utf8')+'</center>\n' \
# '<p> sys path: ' + os.environ['PATH'] + '</p>' \

View File

@@ -0,0 +1,77 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# if you change this script "touch" it to reload by apache
# e.g touch /var/www/html/wsgi_isttok_status.py
"""
Created on December 8 16:34:35 2019
https://tecadmin.net/install-apache-mod-wsgi-on-ubuntu-16-04-xenial
Install:
Include in /etc/apache2/conf-available/mod-wsgi.conf :
WSGIScriptAlias /isttok /var/www/html/wsgi_isttok_status.py
and do:
systemctl restart apache2
@author: bernardo carvalho@IPFN
"""
#
from epics import caget, caput, cainfo, PV
import os
#os.environ['EPICS_CA_ADDR_LIST'] = 'localhost 192.168.1.110 192.168.1.120'
#os.environ['EPICS_CA_ADDR_LIST'] = 'localhost 192.168.1.110'
os.environ['EPICS_CA_ADDR_LIST'] = '192.168.1.110'
os.environ['EPICS_CA_AUTO_ADDR_LIST'] = 'NO'
def application(environ,start_response):
status = '200 OK'
html = '<html>\n' \
'<head> <meta charset="UTF-8"/> <title>ISTTOK Status page</title>' \
'<meta http-equiv="refresh" content="5"> </head>' \
'<body>\n <h1> ISTTOK Present Vaccum Condition </h1> \n'
RP1pv = PV('ISTTOK:central:RPump1-Pressure')
if RP1pv.connect(timeout=0.2):
RPpreAlarm = caget('ISTTOK:central:RPump1-Pressure.SEVR', as_string=True)
RP1A = caget('ISTTOK:central:RPump1-Pressure.SEVR')
RPump1press = RP1pv.get(as_string=True)
TMPump1press = caget('ISTTOK:central:TMPump1-PressureAdmission', as_string=True)
VVesselpress = caget('ISTTOK:central:VVessel-Pressure', as_string=True)
rpiCurrentTime = caget('ISTTOK:central:CurrentTime', as_string=True)
opState = caget('ISTTOK:central:OPSTATE.VAL', as_string=True)
opReq = caget('ISTTOK:central:OPREQ.VAL', as_string=True)
opReqN = caget('ISTTOK:central:OPREQ.VAL')
pulseNum = caget('ISTTOK:central:PULSE-NUMBER', as_string=True)
OnBattery = caget('ISTTOK:central:UPS-OnBattery', as_string=True)
RPump1Info = cainfo("ISTTOK:central:RPump1-Pressure", print_out=False)
if RP1A == 0:
html += '<p>RPump1-Pressure: ' + RPump1press + ' mBar. ALARM Status:' +RPpreAlarm+' </p>'
else:
html += '<h3 style="color: #FF0000">RPump1-Pressure: ' + RPump1press + ' mBar. ALARM Status:' +RPpreAlarm+' </h3>'
html += '<p>TMPump1-PressureAdmission: ' + TMPump1press + ' mBar </p>'
html += '<p>VVessel-Pressure: ' + VVesselpress + ' mBar </p>'
html += '<p>OPSTATE: ' + opState + ', UPS-OnBattery: '+ OnBattery+ '</p>'
html += '<p>OPREQ: ' + opReq + '</p>'
if opReqN == 0:
html += '<p>Note: you can try to login to rpi-isttok machine and do: '
html += '<pre>caput ISTTOK:central:OPREQ START</pre> </p>'
html += '<p>PULSE-NUMBER: ' + pulseNum + ' </p>'
html += '<p>Rpi CurrentTime: ' + rpiCurrentTime + ' </p>'
else:
html += '<h2 style="color: #FF0000">Sorry, cannot connect to EPICS.</h2>'
html += '</body>\n' \
'</html>\n'
response_header = [('Content-type','text/html'),
('Content-Length', str(len(html)))]
start_response(status,response_header)
return [html.encode('UTF-8')]
# html = bytes(html, encoding= 'utf-8')
# html += '<p>RPump1-Pressure: ' + str(RPump1press) + ' mBar </p>'
# return [html]
# RPump1press = caget('ISTTOK:vacuum:RPump1-Pressure')
# RPump2press = caget('ISTTOK:vacuum:RPump2-Pressure')
# html += '<p>RPump2-Pressure: ' + str(RPump2press) + ' mBar </p>'
# TMPump1press = caget('ISTTOK:vacuum:TMPump1-PressureAdmission')
# VVesselpress = caget('ISTTOK:vacuum:VVessel-Pressure')
# RPump2press = caget('ISTTOK:central:RPump2-Pressure')
# html += '<pre> ' + RPump1Info + '</pre>'

Binary file not shown.

After

Width:  |  Height:  |  Size: 84 KiB

View File

@@ -0,0 +1,133 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Thu Feb 8 16:34:35 2018
@author: bernardo carvalho
https://pypi.org/project/influxdb/
http://influxdb-python.readthedocs.io/en/latest/api-documentation.html#influxdb.DataFrameClient.write_points
"""
import epics
import time
import os
import sys
import json
from datetime import datetime
#from influxdb_client import InfluxDBClient
from influxdb import InfluxDBClient
import numpy as np
sys.path
os.environ['EPICS_CA_ADDR_LIST'] = '192.168.1.110'
os.environ['EPICS_CA_AUTO_ADDR_LIST'] = 'NO'
client = InfluxDBClient('localhost', 8086, 'oper', 'opertok', 'epics_isttok')
client.create_database('epics_isttok')
#client = InfluxDBClient('http://127.0.0.1:8086', username='oper', password='opertok')
#def onChanges(pvname=None, value=None, char_value=None, **kw):
# pass
SCAN_PERIOD = 15
opstate_pv = epics.PV('ISTTOK:central:OPSTATE')
vv_press_pv = epics.PV('ISTTOK:central:VVessel-Pressure')
vv_press_pv.get(timeout=10)
#client.get_list_database()
def on_opstate_change(pvname=None, value=None, char_value=None, timestamp=None, **kw):
print('PV opstate Changed! {} {} {}'.format(pvname, char_value, timestamp))
dt = datetime.fromtimestamp(timestamp)
json_body = [{
"measurement": "central",
"tags": {"OPSTATE": opstate_pv.char_value},
"time": dt.strftime('%Y-%m-%dT%H:%M:%SZ'),
"fields": {"VVessel-Pressure": vv_press_pv.value}
}]
print(json_body)
client.write_points(json_body)
def on_vv_press_change(pvname=None, value=None, char_value=None, timestamp=None, **kw):
print('PV Changed! {} {} {}'.format(pvname, value, timestamp))
#data = [{"measurement": "central", "tags": {"host": "server01"}, "time": "2009-11-10T23:00:00Z", "fields": {
# "value": value }}]
dt = datetime.fromtimestamp(timestamp)
#json_data = json.dumps(data)
json_body = [
{
"measurement": "central",
"tags": {},
"time": dt.strftime('%Y-%m-%dT%H:%M:%SZ'), # "2009-11-10T23:00:00Z",
"fields": {
"VVessel-Pressure": value}
}
]
print(json_body)
# convert to datetime
# https://stackoverflow.com/questions/51014779/how-send-proper-timestamp-to-influxdb-with-influxdb-python
# write_points(points, time_precision=None, database=None, retention_policy=None, tags=None, batch_size=None, protocol=u'json', consistency=None)
client.write_points(json_body)
#client.write('epics_isttok','central', fields={'value': value})
#print('PV Changed! {} {} {}'.format(pvname, value, time.ctime()))
#vv_press_pv.add_callback(on_vv_press_change)
tmp1_press_admission_pv = epics.PV('ISTTOK:central:TMPump1-PressureAdmission')
rpump1_press_pv = epics.PV('ISTTOK:central:RPump1-Pressure')
opstate_pv.add_callback(on_opstate_change)
# https://medium.com/greedygame-engineering/an-elegant-way-to-run-periodic-tasks-in-python-61b7c477b679
while True:
#print('Hello from the Python Demo Service')
pv1_m_data = rpump1_press_pv.get_with_metadata()
pv2_m_data = tmp1_press_admission_pv.get_with_metadata()
pv3_m_data = vv_press_pv.get_with_metadata()
# pv4_m_data = i
opstate_pv.get()
dt = datetime.fromtimestamp(pv1_m_data['timestamp'])
json_body = [{
"measurement": "central",
"tags": {'OPSTATE': opstate_pv.char_value},
"time": dt.strftime('%Y-%m-%dT%H:%M:%SZ'),
"fields": {
"RPump1-Pressure": pv1_m_data['value'],
"TMPump1-PressureAdmission": pv2_m_data['value'],
"VVessel-Pressure": pv3_m_data['value']
}
}]
print(json_body)
client.write_points(json_body)
time.sleep(SCAN_PERIOD)
# valuePrimary2 = epics.caget('ISTTOK:central:RPump2-Pressure')
#valueChamber1 = epics.caget('ISTTOK:central:VVessel-Pressure')
#valueTMPadmission = epics.caget('ISTTOK:central:TMPump1-PressureAdmission')
#now = time.ctime()
# Open database connection
# 19 | ISTTOK:central:VVessel-Pressure
#sql_chamber ="SELECT `smpl_time`, `float_val` FROM `sample` WHERE `channel_id` = 5 " \
"AND `smpl_time` > addtime(now(),'-01:00:00') ORDER BY `smpl_time` DESC LIMIT 100;"
# 21 | ISTTOK:central:RPump1-Pressure
#sql_primary ="SELECT `smpl_time`, `float_val` FROM `sample` WHERE `channel_id` = 6 " \
"AND `smpl_time` > addtime(now(),'-01:00:00') ORDER BY `smpl_time` DESC LIMIT 100;"
# ORDER BY `smpl_time` DESC LIMIT 250;"
# Execute the SQL command
print("result sql1")
# Fetch all the rows in a list of lists.
print("result sql2")

View File

@@ -0,0 +1,34 @@
# systemd unit file for the Python Demo Service
# copy this file to /lib/systemd/system
# sudo systemctl daemon-reload
# sudo systemctl enable python_isttok_influx.service
# https://www.codementor.io/@ufukafak/how-to-run-a-python-script-in-linux-with-systemd-1nh2x3hi0e
[Unit]
# Human readable name of the unit
Description=Python Influx write Service
After=network.target
[Service]
# Command to execute when the service is started
#ExecStart=/usr/bin/pythoni3 /usr/local/lib/python_demo_service/python_demo_service.py
ExecStart=/bin/bash -c 'cd /home/bernardo/EPICS/ISTTOK/epics/influxDB && /usr/bin/python3 isttok_to_influx.py'
# Disable Python's buffering of STDOUT and STDERR, so that output from the
# service shows up immediately in systemd's logs
Environment=PYTHONUNBUFFERED=1
# Automatically restart the service if it crashes
Restart=on-failure
# Our service will notify systemd once it is up and running
Type=notify
# Use a dedicated user to run our service
User=bernardo
[Install]
# Tell systemd to automatically start this service when the system boots
# (assuming the service is enabled)
WantedBy=default.target

View File

@@ -0,0 +1,146 @@
###################################################################
# This records is the dspPIC uptime in seconds from last reset #
###################################################################
record(longin, "$(P)$(R)Uptime")
{
field(DESC, "Reads dsPIC Uptime")
field(DTYP, "stream")
field(INP, "@dspic.proto getUP $(PORT)")
field(SCAN, "I/O Intr")
field(FLNK,"$(P)$(R)Diff_Uptime") #Link to update Diff_Uptime
field(ADEL,100)
field(MDEL,0)
}
record(calc, "$(P)$(R)Diff_Uptime") {
field(DESC, "Uptime diff. between I/O Intr scans")
field(CALC,"B-A")
field(SCAN,"Passive")
field(INPA,"$(P)$(R)Last_Uptime.VAL NPP")
field(INPB,"$(P)$(R)Uptime")
field(FLNK,"$(P)$(R)Last_Uptime")
field(HIHI,"100.0")
field(HIGH,"2.0")
field(LOW, "0.0")
field(LOLO,"-10.0")
}
record(calc, "$(P)$(R)Last_Uptime") {
field(DESC, "Last Uptime for diff. calc")
field(CALC,"A")
field(SCAN,"Passive")
field(INPA,"$(P)$(R)Uptime")
}
###################################################################
# These records read Temperatures #
###################################################################
record(ai, "$(P)$(R)VVessel-Temperature")
{
field(DESC, "Reads TE01 Temperature")
field(DTYP, "stream")
field(INP, "@dspic.proto getTE01 $(PORT) $(A)")
field(SCAN, "I/O Intr")
field(EGU, "C")
field(PREC, "4")
field(LINR, "LINEAR")
# field(ESLO, "0.00001163358")
# See https://paulscherrerinstitute.github.io/StreamDevice/ai.html
# field(EGUL, "-1.02376")
# x 30
field(ESLO, "0.000349007")
#field(EGUL, "-30.71")
field(EOFF, "-30.71")
field(HOPR, "140.0")
field(LOPR, "0.0")
field(HIHI,"120.0")
field(HIGH,"100.0")
field(LOW, "0.0")
field(LOLO,"-10.0")
field(HHSV,"MAJOR")
field(HSV, "MINOR")
# field(LSV, "MINOR")
# field(LLSV,"MAJOR")
field(ADEL, "1.0") # Archive Deadband
}
# Precision
# Engineering Units
# field(EGU, "Raw")
# Convertion
# val = val * ESLO + EGUL
# field(ESLO, "0.000011633582866550557")
# field(DESC,"Thermocouple 0")
# field(HIHI,"90.0")
# field(HIGH,"50.0")
# field(LOW, "20.0")
# field(LOLO,"0.0")
# field(HHSV,"MAJOR")
# field(HSV, "MINOR")
# field(LSV, "MINOR")
# field(LLSV,"MAJOR")
# field(MDEL, "0.0") # Monitor Deadband
record(ai, "$(P)$(R)Temperature_1")
{
field(DESC, "Reads TE02 Temperature")
field(DTYP, "stream")
field(INP, "@dspic.proto getTE02 $(PORT) $(A)")
field(SCAN, "I/O Intr")
field(EGU, "C")
field(PREC, "4")
field(LINR, "LINEAR")
# field(CALC,"A*0.000011633582866550557-1.02376")
field(ESLO, "0.00001163358")
field(EGUL, "-1.02376")
}
record(ai, "$(P)$(R)Temperature_2")
{
field(DESC, "Reads TE03 Temperature")
field(DTYP, "stream")
field(INP, "@dspic.proto getTE03 $(PORT)")
field(SCAN, "I/O Intr")
field(EGU, "C")
field(PREC, "4")
field(LINR, "LINEAR")
field(ESLO, "0.00001163358")
field(EGUL, "-1.02376")
}
record(ai, "$(P)$(R)Temperature_3") {
field(DESC, "Reads TE04 Temperature")
field(DTYP, "stream")
field(INP, "@dspic.proto getTE04 $(PORT)")
field(SCAN, "I/O Intr")
field(EGU, "C")
field(PREC, "4")
field(LINR, "LINEAR")
field(ESLO, "0.00001163358")
field(EGUL, "-1.02376")
}
record(ai, "$(P)$(R)Capbank_Voltage") {
field(DESC, "Reads PRD01, Capitor bank Voltage PWM")
field(DTYP, "stream")
field(INP, "@dspic.proto getPRD01 $(PORT)")
field(SCAN, "I/O Intr")
field(LINR, "LINEAR")
# # val = val * ESLO + EGUL
field(ESLO, "1.0")
field(EGUL, "0.0")
# Precision
field(PREC, "1")
# Units
field(EGU, "V")
# # Alarms
}
record(stringin, $(P)$(R)idn) {
field(DESC, "Debug info blabla")
field(DTYP, "stream")
field(INP, "@dspic.proto getStr $(PORT) $(A)")
field(SCAN, "I/O Intr")
}
record(stringin, "$(P)$(R)CurrentTime") {
field(DESC, "Current Date and Time of the IOC")
field(SCAN, "1 second")
field(DTYP, "Soft Timestamp")
field(PINI, "YES")
field(INP, "@%d/%m/%Y %H:%M:%S")
}

View File

@@ -0,0 +1,23 @@
TOP=../..
include $(TOP)/configure/CONFIG
#----------------------------------------
# ADD MACRO DEFINITIONS AFTER THIS LINE
#----------------------------------------------------
# Optimization of db files using dbst (DEFAULT: NO)
#DB_OPT = YES
#----------------------------------------------------
# Create and install (or just install) into <top>/db
# databases, templates, substitutions like this
DB += ISTTOKtemperature.db
DB += dspic.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,37 @@
# https://epics.anl.gov/tech-talk/2013/msg02051.php
Terminator = CR LF;
MaxInput = 110;
ReadTimeout = 200;
#ExtraInput = Ignore;
getTE01 {
in "TE01_%10u TE02_%*10u %*80c";
}
getTE02 {
# in "TE01_%*s TE02_%10u TE03_%*10u %*70c";
in "TE01_%*u TE02_%10u TE03_%*10u TE04_%*10u PRD01_%*10u UP_%*10u %*u %+<sum8>";
}
getTE03 {
# in "TE01_%*s TE02_%*10u TE03_%10u %*80c";
in "TE01_%*u TE02_%*10u TE03_%10u TE04_%*10u PRD01_%*10u UP_%*10u %*u %+<sum8>";
}
getTE04 {
# in "TE01_%*s TE02_%*10u TE03_%*10u TE04_%10u %*40c";
in "TE01_%*u TE02_%*10u TE03_%*10u TE04_%10u PRD01_%*10u UP_%*10u %*u %+<sum8>";
}
getPRD01 {
# in "TE01_%*s TE02_%*10u TE03_%*10u TE04_%*10u PRD01_%10u %*30c";
in "TE01_%*s TE02_%*10u TE03_%*10u TE04_%*10u PRD01_%10u UP_%*10u %*u %+<sum8>";
}
getUP {
in "TE01_%*s TE02_%*10u TE03_%*10u TE04_%*10u PRD01_%*10u UP_%10u %*u %+<sum8>";
}
getStr{
in "TE01_%10s%*93c";
}

View File

@@ -0,0 +1,43 @@
# CONFIG_SITE
# Make any application-specific changes to the EPICS build
# configuration variables in this file.
#
# Host/target specific settings can be specified in files named
# CONFIG_SITE.$(EPICS_HOST_ARCH).Common
# CONFIG_SITE.Common.$(T_A)
# CONFIG_SITE.$(EPICS_HOST_ARCH).$(T_A)
# CHECK_RELEASE controls the consistency checking of the support
# applications pointed to by the RELEASE* files.
# Normally CHECK_RELEASE should be set to YES.
# Set CHECK_RELEASE to NO to disable checking completely.
# Set CHECK_RELEASE to WARN to perform consistency checking but
# continue building even if conflicts are found.
CHECK_RELEASE = YES
# Set this when you only want to compile this application
# for a subset of the cross-compiled target architectures
# that Base is built for.
#CROSS_COMPILER_TARGET_ARCHS = vxWorks-ppc32
# To install files into a location other than $(TOP) define
# INSTALL_LOCATION here.
INSTALL_LOCATION=/opt/epics/apps/ISTTOK
# Set this when the IOC and build host use different paths
# to the install location. This may be needed to boot from
# a Microsoft FTP server say, or on some NFS configurations.
#IOCS_APPL_TOP = </IOC's/absolute/path/to/install/top>
# For application debugging purposes, override the HOST_OPT and/
# or CROSS_OPT settings from base/configure/CONFIG_SITE
#HOST_OPT = NO
#CROSS_OPT = NO
# These allow developers to override the CONFIG_SITE variable
# settings without having to modify the configure/CONFIG_SITE
# file itself.
-include $(TOP)/../CONFIG_SITE.local
-include $(TOP)/configure/CONFIG_SITE.local

View File

@@ -0,0 +1,45 @@
# RELEASE - Location of external support modules
#
# IF YOU MAKE ANY CHANGES to this file you must subsequently
# do a "gnumake rebuild" in this application's top level
# directory.
#
# The build process does not check dependencies against files
# that are outside this application, thus you should do a
# "gnumake rebuild" in the top level directory after EPICS_BASE
# or any other external module pointed to below is rebuilt.
#
# Host- or target-specific settings can be given in files named
# RELEASE.$(EPICS_HOST_ARCH).Common
# RELEASE.Common.$(T_A)
# RELEASE.$(EPICS_HOST_ARCH).$(T_A)
#
# This file is parsed by both GNUmake and an EPICS Perl script,
# so it can ONLY contain definititions of paths to other support
# modules, variable definitions that are used in module paths,
# and include statements that pull in other RELEASE files.
# Variables may be used before their values have been set.
# Build variables that are NOT used in paths should be set in
# the CONFIG_SITE file.
# Variables and paths to dependent modules:
MODULES = /opt/epics/modules
#MYMODULE = $(MODULES)/my-module
ASYN=$(MODULES)/asyn
STREAM=$(MODULES)/stream
# If using the sequencer, point SNCSEQ at its top directory:
#SNCSEQ = $(MODULES)/seq-ver
# EPICS_BASE should appear last so earlier modules can override stuff:
EPICS_BASE = /opt/epics/base-3.15.7
# Set RULES here if you want to use build rules from somewhere
# other than EPICS_BASE:
#RULES = $(MODULES)/build-rules
# These allow developers to override the RELEASE variable settings
# without having to modify the configure/RELEASE file itself.
-include $(TOP)/../RELEASE.local
-include $(TOP)/configure/RELEASE.local

View File

@@ -0,0 +1,6 @@
epicsEnvSet("IOC","iocISTTOKdsPIC")
epicsEnvSet("TOP","/opt/epics/apps/ISTTOK")
epicsEnvSet("MODULES","/opt/epics/modules")
epicsEnvSet("ASYN","/opt/epics/modules/asyn")
epicsEnvSet("STREAM","/opt/epics/modules/stream")
epicsEnvSet("EPICS_BASE","/opt/epics/base-3.15.7")

View File

@@ -0,0 +1,37 @@
#!../../bin/linux-x86_64/ISTTOKdsPIC
## You may have to change ISTTOKdsPIC to something else
## everywhere it appears in this file
< envPaths
epicsEnvSet ("STREAM_PROTOCOL_PATH","$(TOP)/db")
cd "${TOP}"
## Register all support components
dbLoadDatabase "dbd/ISTTOKdsPIC.dbd"
ISTTOKdsPIC_registerRecordDeviceDriver pdbbase
## Load record instances
#dbLoadRecords("db/xxx.db","user=codac-dev")
# Setup serial port 2
drvAsynSerialPortConfigure("COM2","/dev/ttyS2",0,0,0)
asynSetOption("COM2", -1, "baud", "115200")
asynSetOption("COM2", -1, "bits", "8")
asynSetOption("COM2", -1, "parity", "none")
asynSetOption("COM2", -1, "stop", "1")
asynSetOption("COM2", -1, "clocal", "Y")
asynSetOption("COM2", -1, "crtscts", "N")
#### Uncomment for ASYNS debuging ####
#asynSetTraceMask("COM2", 0, 9)
#asynSetTraceIOMask("COM2",0, 0x2)
## Setup support for dsPIC interface 2
dbLoadRecords("db/ISTTOKtemperature.db","P=ISTTOK:,R=temperature:,PORT=COM2,A=0")
cd "${TOP}/iocBoot/${IOC}"
iocInit
## Start any sequence programs
#seq sncxxx,"user=codac-dev"

View File

@@ -0,0 +1,43 @@
# vim: sta:et:sw=4:ts=4:sts=4
# 11/12/2024 Initial configuration
#record (ai, "$(P)$(R)Inficon1")
# field (DESC, "ISTTOK:central:Inficon1")
record (ai, "$(P)$(R)VVessel-Pressure")
{
field (DESC, "ISTTOK:central:VVessel-Pressure")
field (DTYP, "stream")
field (INP, "@inficon.proto readIonGauge1 $(bus)")
field (SCAN, "1 second")
field(PHAS, "2")
field(EGU, "mBar")
field(HIHI,"1.0e-2")
field(HIGH,"1.0e-3")
field(LOW,"1.0e-9")
field(LOLO,"0.5e-9")
field(HHSV,"MAJOR")
field(HSV, "MINOR")
field(LSV, "MINOR")
field(LLSV,"MAJOR")
}
#record (ai, "$(P)$(R)Inficon3")
record (ai, "$(P)$(R)TMPump1-PressureAdmission")
{
# field (DESC, "ISTTOK:central:Inficon3")
field(DESC, "ISTTOK:central:TMPump1-PressureAdmission")
field (DTYP, "stream")
field (INP, "@inficon.proto readIonGauge3 $(bus)")
field (SCAN, "1 second")
field(PHAS, "2")
field(EGU, "mBar")
field(HIHI,"1.0e-2")
field(HIGH,"1.0e-3")
field(LOW,"1.0e-9")
field(LOLO,"0.5e-9")
field(HHSV,"MAJOR")
field(HSV, "MINOR")
field(LSV, "MINOR")
field(LLSV,"MAJOR")
}

View File

@@ -0,0 +1,531 @@
#############################################
## Project : ISTTOK slow Control
##
## File :
## Description : Records for ISTTOK Control I/O channels connected to 2 Velleman board
##
##
## Author : Bernardo Carvalho (IPFN-IST)
##
## Copyright (c) : IPFN-IST 2015-2020
## Created 3-Mar-2019
##
##
##########################################
################
###############
# REGISTER 56 #
###############
###############
#####################################
### 24V commands - Optocoupler Out###
#####################################
record(bo, "$(P)$(R)TMPump1-ControllerOn" ) {
field(DESC,"Signal to TMP 1, goes HIGH and LW")
field(ZNAM, "Off" )
field(ONAM, "Pulse" )
field(HIGH, "2.5")
# Disabled until further notice
field(FLNK, "$(P)$(R)TMPump1-ControllerOnInv" )
field(VAL,"0")
}
record(calcout, "$(P)$(R)TMPump1-ControllerOnInv") {
field(INPA, "$(P)$(R)TMPump1-ControllerOn NPP MS")
# Disabled until further notice
# field(OUT, "$(P)$(R)PCF8574:56:REGISTER.B0 PP MS")
field(OOPT, "On Change")
field(CALC, "A?0:1")
field(VAL,"1")
}
record(bo, "$(P)$(R)TMPump1-ControllerOff" ) {
# field(DESC," Sinal p/ TMP 1, desliga a alimentação do controlador, LOW->HIGH-> LOW")
# record(bo, "$(P)$(R)TMPControllerOff" ) {
field(ZNAM, "Off" )
field(ONAM, "Pulse" )
field(HIGH, "2.5")
# Disabled until further notice
field(FLNK, "$(P)$(R)TMPump1-ControllerOffInv" )
field(VAL,"0")
}
record(calcout, "$(P)$(R)TMPump1-ControllerOffInv") {
field(INPA, "$(P)$(R)TMPump1-ControllerOff NPP MS" )
# Disabled until further notice
# field(OUT, "$(P)$(R)PCF8574:56:REGISTER.B1 PP MS")
field(OOPT, "On Change")
field(CALC, "A?0:1")
field(VAL,"1")
}
record(bo, "$(P)$(R)TMPump1-MotorOn" ) {
field( ZNAM, "Off")
field( ONAM, "Pulse")
field( HIGH, "2.5")
field( FLNK, "$(P)$(R)TMPump1-MotorOnInv")
}
record(calcout, "$(P)$(R)TMPump1-MotorOnInv" ) {
field( INPA, "$(P)$(R)TMPump1-MotorOn NPP MS")
field( OUT, "$(P)$(R)PCF8574:56:REGISTER.B2 PP MS")
field( OOPT, "On Change")
field( CALC, "A?0:1" )
}
record(bo, "$(P)$(R)TMPump1-MotorOff") {
field( ZNAM, "Off")
field( ONAM, "Pulse")
field( HIGH, "2.5")
field( FLNK, "$(P)$(R)TMPump1-MotorOffInv")
field(VAL,"0")
}
record(calcout, "$(P)$(R)TMPump1-MotorOffInv") {
field( INPA, "$(P)$(R)TMPump1-MotorOff NPP MS")
field( OUT, "$(P)$(R)PCF8574:56:REGISTER.B3 PP MS")
field( OOPT, "On Change")
field( CALC, "A?0:1")
}
#############################
### TMP1 Controller inputs###
#############################
record(fanout, "$(P)$(R)PCF8574:56:REGISTER:READ:FNOUT"){
field(LNK1, "$(P)$(R)TMPump1-Power")
field(LNK2, "$(P)$(R)TMPump1-Emergency")
field(LNK3, "$(P)$(R)TMPump1-Acceleration")
field(LNK4, "$(P)$(R)TMPump1-NormalOperation")
}
record(bi , "$(P)$(R)TMPump1-Power" ) {
field(DESC," TMP1 Alimentada 220V ")
field( INP, "$(P)$(R)PCF8574:56:REGISTER:READ.B4 NPP NMS")
field( ZNAM, "ON" )
field( ONAM, "OFF" )
}
record(bi , "$(P)$(R)TMPump1-Emergency") {
field(DESC," TMP1 Falha ")
field( INP, "$(P)$(R)PCF8574:56:REGISTER:READ.B6 NPP NMS")
# field(VAL,"1")
field( ZNAM, "ON" )
field( ONAM, "OFF" )
field(ZSV,"MAJOR")
}
record(bi , "$(P)$(R)TMPump1-Acceleration") {
field(DESC," TMP1 Motor em aceleração ")
field( INP, "$(P)$(R)PCF8574:56:REGISTER:READ.B5 NPP NMS")
field( ZNAM, "ON" )
field( ONAM, "OFF" )
field(ZSV,"MINOR")
}
record(bi , "$(P)$(R)TMPump1-NormalOperation" ) {
field(DESC," TMP1 Operação Normal ")
field( INP, "$(P)$(R)PCF8574:56:REGISTER:READ.B7 NPP NMS")
field( ZNAM, "ON" )
field(ONAM, "OFF" )
field(OSV,"MINOR")
}
###############
###############
# REGISTER 57 #
###############
###############
##############################
### TMP2 Controller Inputs ###
##############################
record(fanout, "$(P)$(R)PCF8574:57:REGISTER:READ:FNOUT"){
field(LNK1, "$(P)$(R)TMPump2-Emergency")
field(LNK2, "$(P)$(R)TMPump2-Acceleration")
field(LNK3, "$(P)$(R)TTSystem-tzero")
field(LNK4, "$(P)$(R)Emergency-PhysButton")
}
record(bi , "$(P)$(R)TMPump2-Emergency") {
field(DESC," TMP2 Falha ")
# field(INP, "$(P)$(R)PCF8574:57:REGISTER:READ.B0 NPP NMS")
field(VAL,"1")
field(ZNAM, "ON" )
field(ONAM, "OFF" )
field(ZSV,"MAJOR")
}
record(bi , "$(P)$(R)TMPump2-Acceleration") {
field(DESC," TMP2 START until Normal ")
field( INP, "$(P)$(R)PCF8574:57:REGISTER:READ.B1 NPP NMS")
field( ZNAM, "ON" )
field( ONAM, "OFF" )
}
####################################
# TIMING TRIGGER ON/OFF #
####################################
record(bi , "$(P)$(R)TTSystem-tzero" ) {
field(DESC,"Trigger control 60s before shot")
field(INP, "$(P)$(R)PCF8574:57:REGISTER:READ.B7")
# field(VAL,"1")
field(ZNAM, "OFF" )
field(ONAM, "ON" )
}
###############################
### TMP2 Controller Outputs ###
###############################
record(bo, "$(P)$(R)TMPump2-Motor" ) {
field(DESC," Motor On/Off ")
# record(bo, "$(P)$(R)TMP2MotorOnOff" ) {
field( OUT, "$(P)$(R)PCF8574:57:REGISTER.B2 PP MS")
field( ZNAM, "ON")
field( ONAM, "OFF")
}
##############################
# EMERGENCY MODE #
##############################
record(bi, "$(P)$(R)Emergency-PhysButton" ) {
field(DESC,"External Physical Emergency Button")
field(INP, "$(P)$(R)PCF8574:57:REGISTER:READ.B4 NPP NMS")
field(ZNAM, "ON")
field(ONAM, "OFF" )
field(FLNK, "$(P)$(R)Emergency" )
}
record(bo, "$(P)$(R)Emergency-UserButton" ) {
field(DESC,"Soft User Emergency Button")
field(ZNAM, "OFF" )
field(ONAM, "ON")
field(FLNK, "$(P)$(R)Emergency" )
}
record(calc, "$(P)$(R)Emergency" ) {
field(DESC, "Emergency State")
field(INPA, "$(P)$(R)Emergency-PhysButton.RVAL NPP" )
field(INPB, "$(P)$(R)Emergency-UserButton.RVAL NPP" )
field(CALC, "A || B" ) # ! Not
}
############
# NOT USED #
############
#$(P)$(R)PCF8574:57:REGISTER:READ.B5
#$(P)$(R)PCF8574:57:REGISTER:READ.B6
###############
###############
# REGISTER 60 #
###############
###############
###################################
# ROTARY1 PUMP Relay 5 NC #
###################################
record( bo, "$(P)$(R)RPump1-Motor" ) {
field(DESC,"Power to Rotatory Pump 1. Relay 5")
field(OUT, "$(P)$(R)PCF8574:60:REGISTER.B0 PP" )
field(ZNAM, "Off" )
field(ONAM, "On" )
field(VAL,"1")
field(ZSV,"MINOR")
}
####################################
# ROTARY1 VALVE Relay 4 NC #
####################################
record( bo, "$(P)$(R)RPump1-Valve" ) {
field(DESC,"Abre a valvula da bomba rot. Relay 4")
field(OUT, "$(P)$(R)PCF8574:60:REGISTER.B1 PP" )
field(ZNAM, "Closed" )
field(ONAM, "Open" )
field(VAL,"1")
}
#############################
# ROTARY2 PUMP NO LONGUER USED (RESERVED) #
#############################
record( bo, "$(P)$(R)RPump2-Motor" ) {
field(DESC,"Power On Rotatory Pump 2")
# field(OUT, "$(P)$(R)PCF8574:60:REGISTER.B2 PP" )
field(ZNAM, "Off" )
field(ONAM, "On" )
field(VAL,"1")
field(ZSV,"MINOR")
}
#############################
# ROTARY2 VALVE NO LONGUER USED (RESERVED) #
#############################
record( bo, "$(P)$(R)RPump2-Valve" ) {
field(DESC," Abre a valvula da bomba rotatoria 2 ")
# field(OUT,"$(P)$(R)PCF8574:60:REGISTER.B3 PP" )
field(ZNAM,"Closed" )
field(ONAM,"Open" )
field(VAL,"1")
}
################################
# FILAMENT ON/OFF #
################################
record(bo, "$(P)$(R)VVessel-Filament" ) {
field(DESC,"Vacuum Vessel Filament power")
field( OUT, "$(P)$(R)PCF8574:60:REGISTER.B4 PP" )
field( ZNAM, "On" )
field( ONAM, "Off" )
field(VAL,"1")
field(PINI,"YES")
}
################################
# ELCO Security Relay #
################################
record(bo, "$(P)$(R)ELCO-Enable") {
field(DESC,"ELCO Charging Relay Enable")
field(OUT, "$(P)$(R)PCF8574:60:REGISTER.B2 PP" )
field(ZNAM, "On" )
field(ONAM, "Off" )
field(VAL,"1")
field(ZSV,"MINOR")
}
############
# NOT USED #
############
#$(P)$(R)PCF8574:60:REGISTER:READ.B6
###############
###############
# REGISTER 61 #
###############
###############
record(bo, "$(P)$(R)Shot-TorPSTrigger" ) {
field(DESC," Trigger da FRAEP")
field( ZNAM, "Off" )
field( ONAM, "Pulse" )
field( HIGH, "2.5")
field( FLNK, "$(P)$(R)Shot-TorPSTriggerInv" )
field(VAL,"0")
}
record(calcout, "$(P)$(R)Shot-TorPSTriggerInv" ) {
# field(DESC," $(R)")
field( INPA, "$(P)$(R)ToroidalShotTriggerOnOff NPP MS" )
field( OUT, "$(P)$(R)PCF8574:61:REGISTER.B2 PP MS" )
field( OOPT, "On Change" )
field( CALC, "A?0:1" )
}
record(calcout, "$(P)$(R)REGISTER61-BLINK" ) {
# field(DESC," $(R)")
field(INPA, "$(P)$(R)REGISTER61-BLINK" )
field(OUT, "$(P)$(R)PCF8574:61:REGISTER.B7 PP MS" )
field(OOPT, "Every Time" )
field(CALC, "A?0:1" )
field(VAL, "0" )
field(SCAN, "1 second" )
field(FLNK, "$(P)$(R)REGISTER56-BLINK" )
}
record(calcout, "$(P)$(R)REGISTER56-BLINK" ) {
# field(DESC," $(R)")
field(INPA, "$(P)$(R)REGISTER61-BLINK" )
field(OUT, "$(P)$(R)PCF8574:56:REGISTER.B0 PP MS")
field(OOPT, "On Change")
field(CALC, "A?0:1" )
}
############################################################
##################################
# GIS VALVES ON/OFF #
##################################
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")
# record(bo, "$(P)$(R)GISValvesOnOff" ) {
field( OUT, "$(P)$(R)SEEED4RELAY:17:REGISTER.B0 PP" )
field( ZNAM, "OFF" )
field( ONAM, "ON" )
field(VAL,"0")
}
#record(bo,"$(P)$(R)Primary-PressureCondition"){
# field(ZNAM, "OFF" )
# field(ONAM, "ON" )
# field(VAL,"0")
#}
record(ai,"$(P)$(R)TMPump2-Speed"){
# field(DESC," ADC Pump speed 0-10V ")
#record(ai,"$(P)$(R)Turbo2_Speed"){
field(PREC,"3")
field(EGU,"RPM")
field(VAL,"0")
}
#######################
###TMP1 Manual Valve###
#######################
record(bo, "$(P)$(R)TMPump1-ManualValve"){
# field(DESC," $(R)")
#record(bo, "$(P)$(R)TMPManualValve"){
info(autosaveFields, "VAL")
field( DESC, "State of manual valve")
field( ZNAM, "Closed")
field( ONAM, "Open")
}
### SEEED 4-RELAY I2C BOARDS ADDR 0x11 & 0x12
#
#
##################################
# GIS VALVES ON/OFF #
##################################
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")
# record(bo, "$(P)$(R)GISValvesOnOff" ) {
field( OUT, "$(P)$(R)SEEED4RELAY:17:REGISTER.B0 PP" )
field( ZNAM, "OFF" )
field( ONAM, "ON" )
field(VAL,"0")
field(OSV,"MINOR")
}
####################################
### PRIMARY CLEAN BREAKER ON/OFF ###
####################################
record(bo, "$(P)$(R)Clean-PrimPneuBreaker"){
#record(bo, "$(P)$(R)PrimaryCleanBreakerOnOff"){
field( DESC, "Primary Cleaning OnOff")
field( OUT, "$(P)$(R)SEEED4RELAY:17:REGISTER.B1 PP" )
field( ZNAM, "OFF" )
field( ONAM, "ON" )
field(VAL,"0")
field(OSV,"MAJOR")
}
##########################################
# CAP BANK DISCHARGE ON/OFF #
##########################################
record(bo, "$(P)$(R)CapBank-Discharge" ) {
field(DESC,"Liga o circuito de descarga do ELCO ")
field( OUT,"$(P)$(R)SEEED4RELAY:17:REGISTER.B2 PP" )
field( ZNAM,"OFF" )
field( ONAM,"ON" )
field( VAL,"0")
field(OSV,"MINOR")
}
############################
# TOR CLEAN BREAKER ON/OFF #
############################
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(OUT,"$(P)$(R)SEEED4RELAY:17:REGISTER.B3 PP" )
field(ZNAM,"OFF" )
field(ONAM, "ON" )
field(VAL,"0")
field(OSV,"MAJOR")
}
######################################
# PRIMARY CLEAN CONTACTOR ON/OFF #
######################################
record(bo, "$(P)$(R)Clean-PrimContactor") {
field(DESC,"220V Contactor for Clean Primary")
field(OUT,"$(P)$(R)SEEED4RELAY:18:REGISTER.B0 PP")
field(ZNAM,"OFF")
field(ONAM, "ON")
field(VAL,"0")
field(OSV,"MINOR")
}
######################################
# TOR CLEAN CONTACTOR ON/OFF #
######################################
record(bo, "$(P)$(R)Clean-TorContactor" ) {
field(DESC,"220V Contactor for Clean Toroidal PS")
# field(DESC," Contactor 220V do transformador para a fonte de campo toroidal das descargas de limpeza (500 A) ")
field(OUT,"$(P)$(R)SEEED4RELAY:18:REGISTER.B1 PP")
field(ZNAM,"OFF")
field(ONAM, "ON")
field(VAL, "0")
field(OSV,"MINOR")
}
#######################################
# CAP BANK CHARGE ON/OFF #
#######################################
record(bo, "$(P)$(R)CapBank-Charge" ) {
field(DESC,"220V Contactor for ELCO Charger")
## field(DESC," Contactor 220V do circuito de carga do banco de condensadores p/ SHOT (ELCO) ")
field(OUT,"$(P)$(R)SEEED4RELAY:18:REGISTER.B2 PP")
field(ZNAM,"OFF")
field(ONAM, "ON")
field(VAL, "0")
field(OSV,"MINOR")
}
##############################
# BUZZER ON/OFF #
##############################
record(bo, "$(P)$(R)Buzzer" ) {
field(DESC," Lab Buzzer ")
field(OUT,"$(P)$(R)SEEED4RELAY:18:REGISTER.B3 PP")
field(ZNAM,"OFF")
field(ONAM, "Pulse")
field(HIGH, "2.5")
field(VAL, "0")
field(OSV,"MINOR")
}
######################################
# Tor Power Supply Disable #
# É desligado na emergência e em qualquer estado que
# não seja Process ou Wait Shot.
######################################
record(bo, "$(P)$(R)Shot-TorPSDisable" ) {
field(DESC,"Tor Power Supply Disable")
####field( OUT, "$(P)$(R)PCF8574:61:REGISTER.B1 PP" )
field(OUT,"$(P)$(R)SEEED4RELAY:19:REGISTER.B0 PP")
field( ZNAM, "Enabled" )
field( ONAM, "Disabled" )
field(VAL,"0")
field(OSV,"MINOR")
}
##############################
# LIGHTS ON/OFF #
##############################
record(bo, "$(P)$(R)Lab-WarningLight" ) {
field(DESC,"Luzes de sinalização, 220V ")
# ####field(OUT, "$(P)$(R)PCF8574:60:REGISTER.B5 PP" )
field(OUT,"$(P)$(R)SEEED4RELAY:19:REGISTER.B1 PP")
field(ZNAM,"OFF")
field(ONAM, "ON")
field(VAL, "0")
field(OSV,"MINOR")
}
##############################
# HEAT BLANKET #
##############################
record(bo, "$(P)$(R)Blanket") {
field(DESC,"Mantas de Aquecimento dos Portos, 220VAC ")
field(OUT,"$(P)$(R)SEEED4RELAY:19:REGISTER.B2 PP")
field(ZNAM,"OFF")
field(ONAM, "ON")
field(VAL, "0")
field(OSV,"MINOR")
}
# field(ZNAM, "On" )
# field(ONAM, "Off" )
# field(VAL,"1")
#}
# field( ZNAM, "Off" )
# field( ONAM, "On" )
# field(VAL,"1")
#}
# field(ZNAM, "Off" )
# field(ONAM, "Pulse" )
# field(HIGH, "2.5")
# field(FLNK, "$(P)$(R)BuzzerInv" )
# field(VAL, "0")
#}
#record(calcout, "$(P)$(R)BuzzerInv" ) {
# field(INPA, "$(P)$(R)Buzzer NPP MS" )
# field(OUT, "$(P)$(R)PCF8574:57:REGISTER.B3 PP MS" )
# field(OOPT, "On Change" )
# field(CALC, "A?0:1" )
#}

View File

@@ -0,0 +1,65 @@
# vim: sta:et:sw=4:ts=4:sts=4
#
# Project : ISTTOK slow Control
#
# File :
# Description : Records for ISTTOK MARTe2 Control
#
##
# Author : Bernardo Carvalho (IPFN-IST)
#
# Copyright (c) : (IPFN-IST)
# Created 14-Apr-2024
#
##
#### PVs for ATCA-MARTe2 operation
record(mbbi, "$(P)$(R)MARTe2-Status")
{
field(DTYP, "Soft Channel")
# Writen by MARTe2 Datasource
field(ZRVL, "0")
field(ONVL, "1")
field(TWVL, "2")
field(FFVL, "15")
#
field(ZRST, "IDLE")
field(ONST, "WAITING_FOR_PRE")
field(TWST, "PULSING")
field(FFST, "ERROR")
field(ONSV, "MINOR")
field(TWSV, "MINOR")
field(FFSV, "MAJOR")
}
record(mbbo, "$(P)$(R)MARTe2-Command")
{
field(DTYP, "Soft Channel")
field(ZRVL, "0")
field(ONVL, "1")
field(TWVL, "2")
field(ZRST, "GOTO_IDLE")
field(ONST, "GOTO_WAITING_FOR_PRE")
field(TWST, "GOTO_PULSING")
field(VAL, "0")
}
record( longin, "$(P)$(R)MARTe2-Reset")
{
field(DTYP, "Soft Channel")
}
record(waveform, "$(P)$(R)ATCAIOP1-EO")
{
field(DESC, "EO parameters for ATCA-IOP Board 1")
field(DTYP, "Soft Channel")
field(NELM, 16)
field(FTVL, "LONG")
}
record(waveform, "$(P)$(R)ATCAIOP1-WO")
{
field(DESC, "WO parameters for ATCA-IOP Board 1")
field(DTYP, "Soft Channel")
field(NELM, 16)
field(FTVL, "FLOAT")
}

View File

@@ -18,62 +18,62 @@
# ### Read/Write pcf8574 address 0x38=56 register ### #
###################################################
record( mbboDirect, "$(P)$(R)PCF8574:56:REGISTER") {
field( DTYP, "stream")
field( OUT, "@pcf8574.proto wReg(56) I2C")
field( SHFT, "0")
field( NOBT, "8")
# Has @init on protocol
# field(VAL, 255)
field(DTYP, "stream")
field(OUT, "@pcf8574.proto wReg(56) $(BUS)")
field(SHFT, "0")
field(NOBT, "8")
field(VAL, 255)
# field(PINI,"YES")
}
record( mbbiDirect, "$(P)$(R)PCF8574:56:REGISTER:READ" ) {
field( DTYP, "stream")
field( INP, "@pcf8574.proto rReg(56) I2C")
field(NOBT, "8")
field(SCAN, "1 second")
field(FLNK, "$(P)$(R)PCF8574:56:REGISTER:READ:FNOUT")
# field(PINI,"YES")
field(DTYP, "stream")
field(INP, "@pcf8574.proto rReg(56) $(BUS)")
field(NOBT, "8")
field(SCAN, "1 second")
field(FLNK, "$(P)$(R)PCF8574:56:REGISTER:READ:FNOUT")
}
#####################################################
# ### Read/Write pcf8574 address 0x39=57 register ### #
###################################################
record( mbboDirect, "$(P)$(R)PCF8574:57:REGISTER") {
field( DTYP, "stream")
field( OUT, "@pcf8574.proto wReg(57) I2C")
field( SHFT, "0")
field( NOBT, "8")
field(DTYP, "stream")
field(OUT, "@pcf8574.proto wReg(57) $(BUS)")
field(SHFT, "0")
field(NOBT, "8")
field(VAL, 255)
field(PINI,"YES")
# field(PINI,"YES")
}
record( mbbiDirect, "$(P)$(R)PCF8574:57:REGISTER:READ" ) {
field( DTYP, "stream")
field( INP, "@pcf8574.proto rReg(57) I2C")
field(DTYP, "stream")
field(INP, "@pcf8574.proto rReg(57) $(BUS)")
field(NOBT, "8")
field(SCAN, "1 second")
field(PINI,"YES")
field(FLNK, "$(P)$(R)PCF8574:57:REGISTER:READ:FNOUT")
}
#####################################################
# ### Read/Write pcf8574 address 0x3c=60 register ### #
###################################################
################################################################
# ### Read/Write pcf8574 address 0x3c=60 register #
# I2C power up with output at 1 (Relay coils are de-energized)#
################################################################
record( mbboDirect, "$(P)$(R)PCF8574:60:REGISTER") {
field( DTYP, "stream")
field( OUT, "@pcf8574.proto wReg(60) I2C")
field( OUT, "@pcf8574.proto wReg(60) $(BUS)")
field( SHFT, "0")
field( NOBT, "8")
field(VAL, 255)
field(PINI,"YES")
#field(PINI,"YES")
}
record( mbbiDirect, "$(P)$(R)PCF8574:60:REGISTER:READ" ) {
field( DTYP, "stream")
field( INP, "@pcf8574.proto rReg(60) I2C")
field( INP, "@pcf8574.proto rReg(60) $(BUS)")
field(NOBT, "8")
field(SCAN, "1 second")
field(PINI,"YES")
# field(FLNK, "$(P)$(R)PCF8574:60:REGISTER:READ:FNOUT")
#field(PINI,"YES")
}
#####################################################
@@ -81,17 +81,18 @@ record( mbbiDirect, "$(P)$(R)PCF8574:60:REGISTER:READ" ) {
###################################################
record( mbboDirect, "$(P)$(R)PCF8574:61:REGISTER") {
field( DTYP, "stream")
field( OUT, "@pcf8574.proto wReg(61) I2C")
field( OUT, "@pcf8574.proto wReg(61) $(BUS)")
field( SHFT, "0")
field( NOBT, "8")
field(VAL, 255)
field(PINI,"YES")
#field(PINI,"YES")
}
record( mbbiDirect, "$(P)$(R)PCF8574:61:REGISTER:READ" ) {
field( DTYP, "stream")
field( INP, "@pcf8574.proto rReg(61) I2C")
field( INP, "@pcf8574.proto rReg(61) $(BUS)")
field(NOBT, "8")
field(SCAN, "1 second")
field(PINI,"YES")
#field(PINI,"YES")
# field(FLNK, "$(P)$(R)PCF8574:61:REGISTER:READ:FNOUT")
}

View File

@@ -9,27 +9,26 @@
# ### ### #
# ### macros: ID I2C address of ADC ### #
# ### Description: ### #
# ### This is an example DB file using ### #
# ### stream(asynI2C) to read/write ### #
# ### This DB file is using ### #
# ### stream(asynI2C) to read/write ### #
# ### an PCF8591 ADDA chip ### #
#######################################################
#####################################################
# Read/Write pcf8591 register @ address 0x48=d72 ### #
#####################################################
record( mbboDirect, "$(P)$(R)PCF8591:72:CTRLREGISTER") {
field(DTYP, "stream")
field(OUT, "@pcf8591.proto wReg(72) I2C")
field(SHFT, "0")
field(NOBT, "8")
field(VAL, 255)
field(PINI,"YES")
record(mbboDirect, "$(P)$(R)PCF8591:72:CTRLREGISTER") {
field(DTYP, "stream")
field(OUT, "@pcf8591.proto wReg(72) $(BUS)")
field(SHFT, "0")
field(NOBT, "8")
field(VAL, 255)
field(PINI,"YES")
}
# Receiving two bytes. last one counts
record( longin, "$(P)$(R)PCF8591:72:ADC_CH1" ) {
field(DTYP, "stream")
field(INP, "@pcf8591.proto rConvAdc0(72) I2C")
# field( FLNK, "$(P)$(R)PCF8591:72:CHANNEL1" )
field(DTYP, "stream")
field(INP, "@pcf8591.proto rConvAdc0(72) $(BUS)")
}
record( calc, "$(P)$(R)PCF8591:72:BYTE2_CH1" ) {
field(INPA, "$(P)$(R)PCF8591:72:ADC_CH1 PP NMS")
@@ -37,36 +36,85 @@ record( calc, "$(P)$(R)PCF8591:72:BYTE2_CH1" ) {
field(CALC, " (A & 255 )" )
}
record( ai, "$(P)$(R)TMP2Speed" ) {
field( DTYP, "Raw Soft Channel" )
field( INP, "$(P)$(R)PCF8591:72:BYTE2_CH1 PP NMS")
field( SCAN, "1 second")
field( ASLO, "16" )
field( AOFF, "0" )
field( EGU, "RPM" )
field( PREC, "3" )
field( HOPR, "5000" )
field( LOPR, "0" )
record( ai, "$(P)$(R)TMPump2-Speed" ) {
field(DESC, "TMPump2-Speed")
field(DTYP, "Raw Soft Channel" )
field(INP, "$(P)$(R)PCF8591:72:BYTE2_CH1 PP NMS")
# field(SCAN, "1 second")
field(ASLO, "16" )
field(AOFF, "0" )
field(EGU, "RPM" )
field(PREC, "3" )
field(HOPR, "5000" )
field(LOPR, "0" )
field(LOW, "200.0")
# field(LOLO,"0.0")
field(LSV, "MINOR")
# field(LLSV,"MAJOR")
}
record( longin, "$(P)$(R)PCF8591:72:ADC_CH2" ) {
field(DTYP, "stream")
field(INP, "@pcf8591.proto rConvAdc1(72) I2C")
#field( FLNK, "
field(DTYP, "stream")
field(INP, "@pcf8591.proto rConvAdc1(72) $(BUS)")
}
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
field(CALC, " (A & 255)" )
field(CALC, "(A & 255)" )
}
record( ai, "$(P)$(R)TMP2Current" ) {
record( ai, "$(P)$(R)TMPump2-Current" ) {
field(DESC, "TMPump2-Current")
field(DTYP, "Raw Soft Channel" )
field(INP, "$(P)$(R)PCF8591:72:BYTE2_CH2 PP NMS")
field(SCAN, "1 second")
field(INP, "$(P)$(R)PCF8591:72:BYTE2_CH2 PP NMS")
# field(SCAN, "1 second")
field(ASLO, "0.1" )
field(AOFF, "0" )
field(EGU, "mA" )
field(PREC, "3" )
field(HOPR, "50" )
field(LOPR, "0" )
field(LOW, "2.0")
# # field(LOLO,"0.0")
field(LSV, "MINOR")
# # field(LLSV,"MAJOR")
}
# Receiving two bytes. last one counts
record( longin, "$(P)$(R)PCF8591:72:ADC_CH3" ) {
field(DTYP, "stream")
field(INP, "@pcf8591.proto rConvAdc2(72) $(BUS)")
}
record( calc, "$(P)$(R)PCF8591:72:BYTE2_CH3" ) {
field(INPA, "$(P)$(R)PCF8591:72:ADC_CH3 PP NMS")
# extract LSB =last byte received
field(CALC, " (A & 255 )" )
}
record(ai, "$(P)$(R)Shot-TorPSCurrentImage" ) {
field(DESC, "Toroidal Current Image")
field(DTYP, "Raw Soft Channel" )
field(INP, "$(P)$(R)PCF8591:72:BYTE2_CH3 PP NMS")
field(SCAN, ".2 second")
#Scan Disable Input Link Value
field(DISA, "1")
field(ASLO, "39.215686275" )
field(AOFF, "0.0" )
field(EGU, "A" )
field(PREC, "3" )
field(HOPR, "10000" )
field(LOPR, "0" )
field(MDEL, "20" )
# field(LOW, "200.0")
# # field(LOLO,"0.0")
# field(LSV, "MINOR")
# # field(LLSV,"MAJOR")
}
record( longout, "$(P)$(R)PCF8591:72:DAC") {
field(DTYP, "stream")
field(OUT, "@pcf8591.proto wDac(72) $(BUS)")
field(DRVH, "255" )
field(DRVL, "0" )
field(VAL, 128)
field(PINI,"YES")
}

View File

@@ -1,99 +1,125 @@
record (longin, "$(P)$(R)P001:M")
{
field (DESC, "getPressure001 $(bus)")
field (DTYP, "stream")
field (INP, "@pfeiffer.proto getPressure001($(P)$(R)P001:E) $(bus)")
field (SCAN, "1 second")
field (FLNK, "$(P)$(R)VVessel-Pressure")
}
record (longin, "$(P)$(R)P001:E")
{
field (DESC, "Pressure001 exponent $(bus)")
}
record (calc, "$(P)$(R)VVessel-Pressure")
{
field (DESC, "ISTTOK:central:VVessel-Pressure")
field(INPA, "$(P)$(R)P001:M")
field(INPB, "$(P)$(R)P001:E")
field(CALC, "(A*0.001)*10.0**(B-20)")
field(PREC, "3")
field(EGU, "mBar")
}
# vim: sta:et:sw=4:ts=4:sts=4
# 8/5/2021 Only sensor 2 is working. Running with dspIC
# 20/9/2021 sensors 1,2,3 are working. Running with dspIC
# 20/9/2021 sensors 1,2,3 are working. Running with tty USB
# 11/12/2024 replaced with Inficon Probes
#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(PHAS, "1")
# field (FLNK, "$(P)$(R)VVessel-Pressure")
#}
#record (longin, "$(P)$(R)P001:E")
#{
# field (DESC, "Pressure001 exponent $(bus)")
#}
#record (ao, "$(P)$(R)VVessel-Pressure")
#{
# field (DESC, "ISTTOK:central:VVessel-Pressure")
#
# field(VAL,"2.0E-9")
# # Maximize Status and Severity, MSS propagate all alarms
# field(INPA, "$(P)$(R)P001:M MSS")
# 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,"1.0e-9")
# field(LOLO,"0.5e-9")
# field(LOW, "20.0")
# field(LOLO,"0.0")
# field(HHSV,"MAJOR")
# field(HSV, "MINOR")
# field(LSV, "MINOR")
# field(LLSV,"MAJOR")
#}
# out "0020074002=?107";
record (longin, "$(P)$(R)P002:M")
{
field (DESC, "getPressure002 $(bus)")
field (DTYP, "stream")
field (INP, "@pfeiffer.proto getPressure002($(P)$(R)P002:E) $(bus)")
field (SCAN, "2 second")
field (FLNK, "$(P)$(R)RPump1-Pressure")
field (DESC, "getPressure002 $(bus)")
field (DTYP, "stream")
field (INP, "@pfeiffer.proto getPressure002($(P)$(R)P002:E) $(bus)")
field (SCAN, "1 second")
field(PHAS, "0")
field (FLNK, "$(P)$(R)RPump1-Pressure")
}
record (longin, "$(P)$(R)P002:E")
{
field (DESC, "Pressure002 exponent $(bus)")
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 (DESC, "ISTTOK:central:RPump1-Pressure")
field(INPA, "$(P)$(R)P002:M MSS")
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)TMPump1-PressureAdmission")
}
# # out "0030074002=?108";
#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(PHAS, "2")
# field (SCAN, "I/O Intr")
# field (FLNK, "$(P)$(R)TMPump1-PressureAdmission")
#}
record (longin, "$(P)$(R)P003:E")
{
field (DESC, "Pressure003 Exponent $(bus)")
}
record (calc, "$(P)$(R)TMPump1-PressureAdmission")
{
field(DESC, "ISTTOK:central:TMPump1-PressureAdmission")
field(INPA, "$(P)$(R)P003:M")
field(INPB, "$(P)$(R)P003:E")
field(CALC, "(A*0.001)* 10.0**(B-20)")
field(PREC, "3")
field(EGU, "mBar")
}
#record (longin, "$(P)$(R)P003:E")
#{
# field (DESC, "Pressure003 Exponent $(bus)")
#}
#
#record (calc, "$(P)$(R)TMPump1-PressureAdmission")
#{
# field(DESC, "ISTTOK:central:TMPump1-PressureAdmission")
# field(INPA, "$(P)$(R)P003:M MSS")
# 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(LOW,"1.0e-9")
# field(LOLO,"0.5e-9")
# field(HHSV,"MAJOR")
# field(HSV, "MINOR")
# field(LSV, "MINOR")
# field(LLSV,"MAJOR")
#}
record (longin, "$(P)$(R)P004:M")
{
field (DESC, "getPressure004 Mantissa $(bus)")
field (DTYP, "stream")
field (INP, "@pfeiffer.proto getPressure004($(P)$(R)P004:E) $(bus)")
field (SCAN, "1 second")
field (FLNK, "$(P)$(R)RPump2-Pressure")
}
record (longin, "$(P)$(R)P004:E")
{
field (DESC, "Pressure004 Exponent $(bus)")
}
record (calc, "$(P)$(R)RPump2-Pressure")
{
field(DESC, "ISTTOK:central:RPump2-Pressure")
field(INPA, "$(P)$(R)P004:M")
field(INPB, "$(P)$(R)P004:E")
field(CALC, "(A*0.001)* 10.0**(B-20)")
field(PREC, "3")
field(EGU, "mBar")
}
# out "0040074002=?109";
# NOT connected 26/10/2021
record(stringout,"$(P)$(R)RS485Debug") {
field(DESC, "")
field(DTYP, "stream")
field(OUT, "@pfeiffer.proto debug $(bus)")
field(VAL,"")
field(DESC, "")
field(DTYP, "stream")
field(OUT, "@pfeiffer.proto debug $(bus)")
field(VAL,"")
}
record(stringout,"$(P)$(R)RS485Debug-CS") {
field(DESC, "")
field(DTYP, "stream")
field(OUT, "@pfeiffer.proto debugCS $(bus)")
field(VAL,"")
}

View File

@@ -1,7 +1,8 @@
# vim: sta:et:sw=4:ts=4:sts=4
#
# Project : ISTTOK slow Control
#
# File : $Id: ISTTOKcontrol.db 4709 2013-05-03 13:44:29Z bernardo $
# File :
# Description : Records for ISTTOK Control
#
##
@@ -10,267 +11,310 @@
# Copyright (c) : (IPFN-IST)
# Created 3-Mar-2013
#
# SVN keywords
# $Date: 2013-05-03 14:44:29 +0100 (Fri, 03 May 2013) $
# $Revision: 4709 $
# $URL: http://metis.ipfn.ist.utl.pt/svn/cdaq/ISTTOK/Software/EPICS/ISTTOKcontrol/trunk/ISTTOKApp/Db/ISTTOKcontrol.db $
##
record(mbbi, "$(P)$(R)OPSTATE") {
field(DESC, "Multiple Pulse Sequence State")
field(ZRVL, "0")
field(ONVL, "1")
field(TWVL, "2")
field(THVL, "3")
field(FRVL, "4")
field(FVVL, "5")
field(SXVL, "6")
field(ZRST, "Stopped")
field(ONST, "Starting")
field(TWST, "Process")
field(THST, "Clean")
field(FRST, "WaitShot")
field(FVST, "Stopping")
field(SXST, "Emergency")
field(VAL, "0")
record(mbbo, "$(P)$(R)OPSTATE") {
field(DESC, "Multiple Pulse Sequence State")
field(ZRVL, "0")
field(ONVL, "1")
field(TWVL, "2")
field(THVL, "3")
field(FRVL, "4")
field(FVVL, "5")
field(SXVL, "6")
field(SVVL, "7")
field(EIVL, "8")
field(ZRST, "Stopped")
field(ONST, "Starting")
field(TWST, "Idle")
field(THST, "Clean")
field(FRST, "WaitShot")
field(FVST, "Stopping")
field(SXST, "Emergency")
field(SVST, "UPSEmergency")
field(EIST, "IdleLimbo")
field(VAL, "0")
field(FLNK, "$(P)$(R)OPCALCSTATE")
#field(PINI, "YES")
}
record(mbbo, "$(P)$(R)LASTOPSTATE") {
info(autosaveFields, "VAL")
field(DESC, "Pulse Sequence Last Saved State")
field(ZRVL, "0")
field(ONVL, "1")
field(TWVL, "2")
field(THVL, "3")
field(FRVL, "4")
field(FVVL, "5")
field(SXVL, "6")
field(SVVL, "7")
field(EIVL, "8")
field(ZRST, "Stopped")
field(ONST, "Starting")
field(TWST, "Idle")
field(THST, "Clean")
field(FRST, "WaitShot")
field(FVST, "Stopping")
field(SXST, "Emergency")
field(SVST, "UPSEmergency")
field(EIST, "IdleLimbo")
field(PINI, "YES")
# field(VAL, "0")
}
record(calc, "$(P)$(R)Archive-Enable") {
field(DESC, "CSS Archive Enable")
field(CALC,"A==0?0:1")
field(SCAN,"1 second")
field(INPA,"$(P)$(R)OPSTATE.VAL NPP NMS")
}
# record for bit leds
record(calc, "$(P)$(R)OPCALCSTATE") {
field(DESC, "Pulse Calculated State")
field(CALC,"2^A")
field(SCAN,"1 second")
field(INPA,"$(P)$(R)OPSTATE.VAL PP NMS")
field(DESC, "Pulse Calculated State")
field(CALC,"2^A")
#field(SCAN,"1 second")
field(INPA,"$(P)$(R)OPSTATE.VAL NPP NMS")
}
record(calc, "$(P)$(R)OPCALCSTARTSTATE") {
field(DESC, "Start Calculated State")
field(CALC,"2^A")
field(SCAN,"1 second")
field(INPA,"$(P)$(R)STARTINGSTATE.VAL PP NMS")
record(calc, "$(P)$(R)STARTCALCSTATE") {
field(DESC, "Start Calculated State")
field(CALC,"2^A")
field(SCAN,"1 second")
field(INPA,"$(P)$(R)STARTINGSTATE.VAL PP NMS")
}
record(calc, "$(P)$(R)OPCALCSTOPSTATE") {
field(DESC, "Stop Calculated State")
field(CALC,"2^A")
field(SCAN,"1 second")
field(INPA,"$(P)$(R)STOPPINGSTATE.VAL PP NMS")
record(calc, "$(P)$(R)STOPPINGCALCSTATE") {
field(DESC, "Stop Calculated State")
field(CALC,"2^A")
field(SCAN,"1 second")
field(INPA,"$(P)$(R)STOPPINGSTATE.VAL PP NMS")
}
record(calc, "$(P)$(R)OPCALCACLEANSTATE") {
field(DESC, "Clean Automatic Calculated State")
field(CALC,"(2^(A+1))-1")
field(SCAN,"1 second")
field(INPA,"$(P)$(R)CLEANINGSTATE.VAL PP NMS")
record(calc, "$(P)$(R)CLEANCALCSTATE") {
field(DESC, "Clean Automatic Calculated State")
field(CALC,"(2^(A+1))-1")
field(SCAN,"1 second")
field(INPA,"$(P)$(R)CLEANINGSTATE.VAL PP NMS")
}
record(calc, "$(P)$(R)OPCALCMCLEANSTATE") {
field(DESC, "Clean Manual Calculated State")
field(CALC,"2^A")
field(SCAN,"1 second")
field(INPA,"$(P)$(R)CLEANINGSTATE.VAL PP NMS")
record(calc, "$(P)$(R)WSHOTCALCSTATE") {
field(DESC, "WaitShot Calculated State")
field(CALC,"2^A")
field(SCAN,"1 second")
field(INPA,"$(P)$(R)WSHOTINGSTATE.VAL PP NMS")
}
record(calc, "$(P)$(R)OPCALCWSHOTSTATE") {
field(DESC, "WaitShot Calculated State")
field(CALC,"2^A")
field(SCAN,"1 second")
field(INPA,"$(P)$(R)WSHOTINGSTATE.VAL PP NMS")
#record(ai, "$(P)$(R)Temperature_0") {
# field(DESC, "ISTTOK Temperature 0 Calculated")
# field(EGU, "C")
# 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(PINI, "YES")
field(ZNAM, "OFF")
field(ONAM, "ON")
field(OSV, "MAJOR")
}
record(ai, "$(P)$(R)Temperature_0") {
field(DESC, "ISTTOK Temperature 0 Calculated")
field(EGU, "C")
field(SCAN,"1 second")
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")
field(PINI, "YES")
}
record(bo, "$(P)$(R)OPREQ") {
field(DESC, "Pulse Sequence Start/Stop")
field(VAL, "0")
field(ZNAM, "STOP")
field(ONAM, "START")
info(autosaveFields, "VAL")
field(DESC, "Pulse Sequence Start/Stop")
# field(VAL, "0")
field(PINI, "YES")
field(ZNAM, "STOP")
field(ONAM, "START")
}
record(bo, "$(P)$(R)CLEANINGMASTATE") {
field(DESC, "Cleaning Manual/Auto")
field(VAL, "1")
field(ZNAM, "M")
field(ONAM, "A")
record(bo, "$(P)$(R)CLEANINGMANMODE") {
info(autosaveFields, "VAL")
field(DESC, "Cleaning Manual/Auto")
info(autosaveFields, "VAL")
# field(VAL, "1")
field(ZNAM, "M")
field(ONAM, "A")
}
record(ai, "$(P)$(R)CLEANINGINOUTSTATE") {
field(DESC, "Cleaning Automatic In/Out")
field(VAL, "1")
}
record(ai, "$(P)$(R)CLEANINGINOUTSTATE0") {
field(DESC, "Cleaning Automatic In/Out")
field(VAL, "-2")
}
record(ai, "$(P)$(R)CLEANINGINOUTSTATE1") {
field(DESC, "Cleaning Automatic In/Out")
field(VAL, "-2")
}
record(ai, "$(P)$(R)CLEANINGINOUTSTATE2") {
field(DESC, "Cleaning Automatic In/Out")
field(VAL, "-2")
}
record(ai, "$(P)$(R)CLEANINGINOUTSTATE3") {
field(DESC, "Cleaning Automatic In/Out")
field(VAL, "-2")
}
record(ai, "$(P)$(R)CLEANINGINOUTSTATE4") {
field(DESC, "Cleaning Automatic In/Out")
field(VAL, "-2")
}
record(ai, "$(P)$(R)CLEANINGINOUTSTATE5") {
field(DESC, "Cleaning Automatic In/Out")
field(VAL, "-2")
}
record(bo, "$(P)$(R)FSTriggerState") {
field(DESC, "FireSignal Trigger Start")
field(VAL, "0")
field(ZNAM, "STOP")
field(ONAM, "START")
record(bo, "$(P)$(R)FSTriggerStart") {
field(DESC, "FireSignal Trigger Start")
field(VAL, "0")
field(PINI, "YES")
field(ZNAM, "STOP")
field(ONAM, "START")
}
record(bo, "$(P)$(R)PROCESS-MODE") {
info(autosaveFields, "VAL")
field(DESC, "Plasma Process Mode")
#field(VAL, "0")
field(ZNAM, "CLEAN")
field(ONAM, "SHOT")
info(autosaveFields, "VAL")
field(DESC, "Plasma Process Mode")
#field(VAL, "0")
#field(PINI, "YES")
field(ZNAM, "CLEAN")
field(ONAM, "SHOT")
}
record(bo, "$(P)$(R)PROCESS-REQ") {
field(DESC, "Plasma Process sub-states Start/Stop")
field(VAL, "0")
field(ZNAM, "STOP")
field(ONAM, "START")
field(DESC, "Plasma Process sub-states Start/Stop")
field(VAL, "0")
field(PINI, "YES")
field(ZNAM, "STOP")
field(ONAM, "START")
field(SCAN,"Passive")
field(FLNK, "$(P)$(R)PULSE-NUMBER")
}
record(bo, "$(P)$(R)AUTHORISATION") {
field(DESC, "Pulse Sequence Authorisation Start/Abort")
field(ZNAM, "ABORT")
field(ONAM, "START")
field(VAL, "0")
field(DESC, "Pulse Sequence Authorisation Start/Abort")
field(ZNAM, "ABORT")
field(ONAM, "START")
field(VAL, "0")
}
record(longout, "$(P)$(R)PULSE-NUMBER") {
info(autosaveFields, "VAL")
field(DESC, "Pulse Number")
record(calc, "$(P)$(R)PULSE-NUMBER") {
info(autosaveFields, "VAL")
field(DESC, "Pulse Number")
field(INPA, "$(P)$(R)PROCESS-REQ NPP")
field(INPB, "$(P)$(R)PULSE-NUMBER")
field(INPC, "$(P)$(R)PROCESS-MODE NPP")
field(CALC, "(A=1)? B+C :B")
field(SCAN,"Passive")
# field(PINI, "YES")
}
record(calc, "$(P)$(R)COUNTDOWN") {
field(DESC, "Countdown Increment")
field(INPA,"$(P)$(R)COUNTDOWN")
field(SCAN,"Passive")
field(CALC,"A+1")
field(VAL, "160")
field(DESC, "Countdown Increment")
field(INPA,"$(P)$(R)COUNTDOWN")
field(DISA,"1")
#field(SCAN,"Passive")
field(SCAN,"1 second")
field(CALC,"A+1")
field(VAL, "160")
}
record(calc, "$(P)$(R)COUNTER") {
field(DESC, "0.1 s counter")
field(INPA, "$(P)$(R)COUNTER")
field(SCAN, ".1 second")
field(CALC, "A + .1")
field(DESC, "0.1 s counter")
field(INPA, "$(P)$(R)COUNTER")
field(SCAN, ".1 second")
field(CALC, "A + .1")
}
record(stringin, "$(P)$(R)CurrentTime") {
field(DESC, "Current Date and Time of the IOC")
field(SCAN, "1 second")
field(DTYP, "Soft Timestamp")
field(PINI, "YES")
field(INP, "@%d/%m/%Y %H:%M:%S")
field(DESC, "Current Date and Time of the IOC")
field(SCAN, "1 second")
field(DTYP, "Soft Timestamp")
#field(PINI, "YES")
field(INP, "@%d/%m/%Y %H:%M:%S")
}
record(stringout, "$(P)$(R)TraceMessage") {
field(DESC, "Trace Message from IOC")
field(VAL, "Trace mode ON")
field(DESC, "Trace Message from IOC")
field(VAL, "Trace mode ON")
}
record(mbbi, "$(P)$(R)STARTINGSTATE") {
field(DESC, "Starting State Sequence")
field(ZRVL, "0")
field(ONVL, "1")
field(TWVL, "2")
field(THVL, "3")
field(FRVL, "4")
field(FVVL, "5")
field(ZRST, "NonStarting")
field(ONST, "Starting1")
field(TWST, "Starting2")
field(THST, "Starting3")
field(FRST, "Starting4")
field(FVST, "Starting5")
field(VAL, "0")
record(stringout, "$(P)$(R)LogMessage") {
field(DESC, "Log Message ")
# field(VAL, "Trace mode ON")
}
record(mbbi, "$(P)$(R)STOPPINGSTATE") {
field(DESC, "Stopping State Sequence")
field(ZRVL, "0")
field(ONVL, "1")
field(TWVL, "2")
field(THVL, "3")
field(FRVL, "4")
field(FVVL, "5")
field(ZRST, "NonStopped")
field(ONST, "Stopping1")
field(TWST, "Stopping2")
field(THST, "Stopping3")
field(FRST, "Stopping4")
field(FVST, "Stopping5")
field(VAL, "0")
record(mbbo, "$(P)$(R)STARTINGSTATE") {
field(DESC, "Starting State Sequence")
field(ZRVL, "0")
field(ONVL, "1")
field(TWVL, "2")
field(THVL, "3")
field(FRVL, "4")
field(FVVL, "5")
field(ZRST, "NonStarting")
field(ONST, "Starting1")
field(TWST, "WaitManV")
field(THST, "WaitPress")
field(FRST, "WaitTMP")
field(FVST, "StartEnd")
field(VAL, "0")
}
record(mbbi, "$(P)$(R)CLEANINGSTATE") {
field(DESC, "Cleaning State Sequence")
field(ZRVL, "0")
field(ONVL, "1")
field(TWVL, "2")
field(THVL, "3")
field(FRVL, "4")
field(FVVL, "5")
field(ZRST, "NonCleaning")
field(ONST, "Cleaning1")
field(TWST, "Cleaning2")
field(THST, "Cleaning3")
field(FRST, "Cleaning4")
field(FVST, "Cleaning5")
field(VAL, "0")
record(mbbo, "$(P)$(R)CLEANINGSTATE") {
field(DESC, "Cleaning State Sequence")
field(ZRVL, "0")
field(ONVL, "1")
field(TWVL, "2")
field(THVL, "3")
field(FRVL, "4")
field(FVVL, "5")
field(SXVL, "6")
field(SVVL, "7")
field(ZRST, "NonCleaning")
field(ONST, "Cleaning1")
field(TWST, "Cleaning2")
field(THST, "Cleaning3")
field(FRST, "Cleaning4")
field(FVST, "Cleaning5")
field(SXST, "Cleaning6")
field(SVST, "Manual")
field(VAL, "0")
}
record(mbbi, "$(P)$(R)WSHOTINGSTATE") {
field(DESC, "Shoting State Sequence")
field(ZRVL, "0")
field(ONVL, "1")
field(TWVL, "2")
field(THVL, "3")
field(FRVL, "4")
field(FVVL, "5")
field(SXVL, "6")
field(SVVL, "7")
field(EIVL, "8")
field(NIVL, "9")
field(TEVL, "10")
field(ELVL, "11")
field(ZRST, "NonShoting")
field(ONST, "Shoting1")
field(TWST, "Shoting2")
field(THST, "Shoting3")
field(FRST, "Shoting4")
field(FVST, "Shoting5")
field(SXST, "Shoting6")
field(SVST, "Shoting7")
field(EIST, "Shoting8")
field(NIST, "Shoting9")
field(TEST, "Shoting10")
field(ELST, "Shoting11")
field(VAL, "0")
record(mbbo, "$(P)$(R)WSHOTINGSTATE") {
field(DESC, "Plasma Shot State Sequence")
field(ZRVL, "0")
field(ONVL, "1")
field(TWVL, "2")
field(THVL, "3")
field(FRVL, "4")
field(FVVL, "5")
field(SXVL, "6")
field(SVVL, "7")
field(EIVL, "8")
field(NIVL, "9")
field(TEVL, "10")
field(ELVL, "11")
field(TVVL, "12")
field(TTVL, "13")
field(ZRST, "NonShooting")
field(ONST, "ShotWTrig")
field(TWST, "Shooting2")
field(THST, "Shooting3")
field(FRST, "Shooting4")
field(FVST, "Shooting5")
field(SXST, "Shooting6")
field(SVST, "Shooting7")
field(EIST, "Shooting8")
field(NIST, "Shooting9")
field(TEST, "Shooting10")
field(ELST, "Shooting11")
field(TVST, "Shooting12")
field(TTST, "ShotEnd")
field(VAL, "0")
}
record(mbbo, "$(P)$(R)STOPPINGSTATE") {
field(DESC, "Stopping State Sequence")
field(ZRVL, "0")
field(ONVL, "1")
field(TWVL, "2")
field(THVL, "3")
field(FRVL, "4")
field(FVVL, "5")
field(ZRST, "NonStopping")
field(ONST, "WaitTMP")
field(TWST, "WaitManV")
field(THST, "Stopping3")
field(FRST, "StoppingEnd")
field(FVST, "Stopping5")
field(VAL, "0")
}

View File

@@ -0,0 +1,84 @@
#######################################################
# ### ### #
# ### EPICS Database for ### #
# ### I2C PCF8591 board ### #
# ### ### #
# ### author: B. Carvalho IPFN ### #
# ### ### #
# ### Ref 2.0; 2019-10-14 ### #
# ### ### #
# ### macros: ID I2C address of DAC ### #
# ### Description: ### #
# ### This DB file is using ### #
# ### stream(asynI2C) to write ### #
# ### an TDA8444 DAC chip ### #
#######################################################
#####################################################
# Read/Write tda8444 register @ address 0x20=d32 ## #
#####################################################
record( longout, "$(P)$(R)TDA8444:32:DAC_CH0") {
field(DTYP, "stream")
field(OUT, "@tda8444.proto wDac0(32) $(BUS)")
field(DRVH, "63" )
field(DRVL, "0" )
field(VAL, 32)
field(PINI,"YES")
}
record( longout, "$(P)$(R)TDA8444:32:DAC_CH1") {
field(DTYP, "stream")
field(OUT, "@tda8444.proto wDac1(32) $(BUS)")
field(DRVH, "63" )
field(DRVL, "0" )
field(VAL, 32)
field(PINI,"YES")
}
record( longout, "$(P)$(R)TDA8444:32:DAC_CH2") {
field(DTYP, "stream")
field(OUT, "@tda8444.proto wDac2(32) $(BUS)")
field(DRVH, "63" )
field(DRVL, "0" )
field(VAL, 32)
field(PINI,"YES")
}
record( longout, "$(P)$(R)TDA8444:32:DAC_CH3") {
field(DTYP, "stream")
field(OUT, "@tda8444.proto wDac3(32) $(BUS)")
field(DRVH, "63" )
field(DRVL, "0" )
field(VAL, 32)
field(PINI,"YES")
}
record( longout, "$(P)$(R)TDA8444:32:DAC_CH4") {
field(DTYP, "stream")
field(OUT, "@tda8444.proto wDac4(32) $(BUS)")
field(DRVH, "63" )
field(DRVL, "0" )
field(VAL, 32)
field(PINI,"YES")
}
record( longout, "$(P)$(R)TDA8444:32:DAC_CH5") {
field(DTYP, "stream")
field(OUT, "@tda8444.proto wDac5(32) $(BUS)")
field(DRVH, "63" )
field(DRVL, "0" )
field(VAL, 32)
field(PINI,"YES")
}
record( longout, "$(P)$(R)TDA8444:32:DAC_CH6") {
field(DTYP, "stream")
field(OUT, "@tda8444.proto wDac6(32) $(BUS)")
field(DRVH, "63" )
field(DRVL, "0" )
field(VAL, 32)
field(PINI,"YES")
}
#record( longout, "$(P)$(R) TDA8444:32:DAC_CH7") {
record( longout, "$(P)$(R)Shot-TorPSCurrent") {
field(DTYP, "stream")
field(OUT, "@tda8444.proto wDac7(32) $(BUS)")
field(DRVH, "63" )
field(DRVL, "0" )
field(VAL, 1)
field(PINI,"YES")
}

View File

@@ -1,360 +0,0 @@
###############
###############
# REGISTER 56 #
###############
###############
#####################################
### 24V commands - Optocoupler Out###
#####################################
record(bo, "$(P)$(R)TMPControllerOn" ) {
field( ZNAM, "Off" )
field( ONAM, "Pulse" )
field( HIGH, "2.5")
field( FLNK, "$(P)$(R)TMPControllerOnInv" )
}
record(calcout, "$(P)$(R)TMPControllerOnInv" ) {
field( INPA, "$(P)$(R)TMPControllerOn NPP MS" )
field( OUT, "$(P)$(R)PCF8574:56:REGISTER.B0 PP MS" )
field( OOPT, "On Change" )
field( CALC, "A?0:1" )
}
record(bo, "$(P)$(R)TMPControllerOff" ) {
field( ZNAM, "Off" )
field( ONAM, "Pulse" )
field( HIGH, "2.5")
field( FLNK, "$(P)$(R)TMPControllerOffInv" )
}
record(calcout, "$(P)$(R)TMPControllerOffInv") {
field( INPA, "$(P)$(R)TMPControllerOff NPP MS" )
field( OUT, "$(P)$(R)PCF8574:56:REGISTER.B1 PP MS")
field( OOPT, "On Change" )
field( CALC, "A?0:1" )
}
record(bo, "$(P)$(R)TMPMotorOn" ) {
field( ZNAM, "Off")
field( ONAM, "Pulse")
field( HIGH, "2.5")
field( FLNK, "$(P)$(R)TMPMotorOnInv")
}
record(calcout, "$(P)$(R)TMPMotorOnInv" ) {
field( INPA, "$(P)$(R)TMPMotorOn NPP MS")
field( OUT, "$(P)$(R)PCF8574:56:REGISTER.B2 PP MS")
field( OOPT, "On Change")
field( CALC, "A?0:1" )
}
record(bo, "$(P)$(R)TMPMotorOff") {
field( ZNAM, "Off")
field( ONAM, "Pulse")
field( HIGH, "2.5")
field( FLNK, "$(P)$(R)TMPMotorOffInv")
}
record(calcout, "$(P)$(R)TMPMotorOffInv") {
field( INPA, "$(P)$(R)TMPMotorOff NPP MS")
field( OUT, "$(P)$(R)PCF8574:56:REGISTER.B3 PP MS")
field( OOPT, "On Change")
field( CALC, "A?0:1")
}
#############################
### TMP1 Controller inputs###
#############################
record(fanout, "$(P)$(R)PCF8574:56:REGISTER:READ:FNOUT"){
field(LNK1, "$(P)$(R)Turbo_PW_Ind")
field(LNK2, "$(P)$(R)Turbo_Emergency")
}
record(bi , "$(P)$(R)Turbo_PW_Ind" ) {
field( INP, "$(P)$(R)PCF8574:56:REGISTER:READ.B4 NPP NMS")
# field( SCAN, "1 second")
field( ZNAM, "ON" )
field( ONAM, "OFF" )
# field(FLNK, "$(P)$(R)Turbo_Emergency")
}
record(bi , "$(P)$(R)Turbo_Emergency") {
field( INP, "$(P)$(R)PCF8574:56:REGISTER:READ.B5 NPP NMS")
field( ZNAM, "ON" )
field( ONAM, "OFF" )
field(FLNK, "$(P)$(R)Turbo_Acceleration")
}
record(bi , "$(P)$(R)Turbo_Acceleration") {
field( INP, "$(P)$(R)PCF8574:56:REGISTER:READ.B6 NPP NMS")
field( ZNAM, "ON" )
field( ONAM, "OFF" )
field(FLNK, "$(P)$(R)Turbo_NormalOperation")
}
record(bi , "$(P)$(R)Turbo_NormalOperation" ) {
field( INP, "$(P)$(R)PCF8574:56:REGISTER:READ.B7 NPP NMS")
field( ZNAM, "ON" )
field( ONAM, "OFF" )
}
###############
###############
# REGISTER 57 #
###############
###############
##############################
### TMP2 Controller Inputs ###
##############################
record(bi , "$(P)$(R)Turbo2_Emergency") {
field( INP, "$(P)$(R)PCF8574:57:REGISTER:READ.B0 NPP NMS")
field( ZNAM, "ON" )
field( ONAM, "OFF" )
field(FLNK, "$(P)$(R)Turbo2_Acceleration")
}
record(bi , "$(P)$(R)Turbo2_Acceleration") {
field( INP, "$(P)$(R)PCF8574:57:REGISTER:READ.B1 NPP NMS")
field( ZNAM, "ON" )
field( ONAM, "OFF" )
}
###############################
### TMP2 Controller Outputs ###
###############################
record(bo, "$(P)$(R)TMP2MotorOnOff" ) {
field( OUT, "$(P)$(R)PCF8574:57:REGISTER.B2 PP MS")
field( ZNAM, "ON")
field( ONAM, "OFF")
}
##############################
# BUZZER ON/OFF #
##############################
record(bo, "$(P)$(R)BuzzerOnOff" ) {
field( ZNAM, "Off" )
field( ONAM, "Pulse" )
field( HIGH, "2.5")
field( FLNK, "$(P)$(R)BuzzerOnOffInv" )
}
record(calcout, "$(P)$(R)BuzzerOnOffInv" ) {
field( INPA, "$(P)$(R)BuzzerOnOff NPP MS" )
field( OUT, "$(P)$(R)PCF8574:57:REGISTER.B3 PP MS" )
field( OOPT, "On Change" )
field( CALC, "A?0:1" )
}
##############################
# EMERGENCY MODE #
##############################
record( bo, "$(P)$(R)EmergencyOnOff" ) {
field( OUT, "$(P)$(R)PCF8574:57:REGISTER.B4 PP" )
field( ZNAM, "On" )
field( ONAM, "Off")
}
############
# NOT USED #
############
#$(P)$(R)PCF8574:57:REGISTER:READ.B5
#$(P)$(R)PCF8574:57:REGISTER:READ.B6
####################################
# TIMING TRIGGER ON/OFF #
####################################
record(bi , "$(P)$(R)TimingTriggerSignal" ) {
field( INP, "$(P)$(R)PCF8574:57:REGISTER:READ.B7")
field( SCAN, "1 second" )
field( ZNAM, "OFF" )
field( ONAM, "ON" )
}
###############
###############
# REGISTER 60 #
###############
###############
#############################
# ROTARY1 PUMP #
#############################
record( bo, "$(P)$(R)RotatoryPump" ) {
field( OUT, "$(P)$(R)PCF8574:60:REGISTER.B0 PP" )
field( ZNAM, "On" )
field( ONAM, "Off" )
}
#############################
# ROTARY1 VALVE #
#############################
record( bo, "$(P)$(R)RotatoryValve" ) {
field( OUT, "$(P)$(R)PCF8574:60:REGISTER.B1 PP" )
field( ZNAM, "Open" )
field( ONAM, "Closed" )
}
#############################
# ROTARY2 PUMP #
#############################
record( bo, "$(P)$(R)RotatoryPump2" ) {
field( OUT, "$(P)$(R)PCF8574:60:REGISTER.B2 PP" )
field( ZNAM, "On" )
field( ONAM, "Off" )
}
#############################
# ROTARY2 VALVE #
#############################
record( bo, "$(P)$(R)RotatoryValve2" ) {
field( OUT, "$(P)$(R)PCF8574:60:REGISTER.B3 PP" )
field( ZNAM, "Open" )
field( ONAM, "Closed" )
}
################################
# FILAMENT ON/OFF #
################################
record(bo, "$(P)$(R)FilamentOnOff" ) {
field( OUT, "$(P)$(R)PCF8574:60:REGISTER.B4 PP" )
field( ZNAM, "On" )
field( ONAM, "Off" )
}
##############################
# LIGHTS ON/OFF #
##############################
record(bo, "$(P)$(R)LightsOnOff" ) {
field( OUT, "$(P)$(R)PCF8574:60:REGISTER.B5 PP" )
field( ZNAM, "On" )
field( ONAM, "Off" )
}
############
# NOT USED #
############
#$(P)$(R)PCF8574:60:REGISTER:READ.B6
##############################
# TOR CLEAN CONTACTOR ON/OFF #
##############################
record(bo, "$(P)$(R)ToroidalCleanContactorOnOff" ) {
field( OUT, "$(P)$(R)PCF8574:60:REGISTER.B7 PP" )
field( ZNAM, "On" )
field( ONAM, "Off" )
}
###############
###############
# REGISTER 61 #
###############
###############
############################
# TOR CLEAN BREAKER ON/OFF #
############################
record(bo, "$(P)$(R)ToroidalCleanBreakerOnOff" ) {
field( OUT, "$(P)$(R)PCF8574:61:REGISTER.B0 PP" )
field( ZNAM, "On" )
field( ONAM, "Off" )
}
record(bo, "$(P)$(R)ToroidalShotEnableOnOff" ) {
field( OUT, "$(P)$(R)PCF8574:61:REGISTER.B1 PP" )
field( ZNAM, "Off" )
field( ONAM, "On" )
}
record(bo, "$(P)$(R)ToroidalShotTriggerOnOff" ) {
field( ZNAM, "Off" )
field( ONAM, "Pulse" )
field( HIGH, "2.5")
field( FLNK, "$(P)$(R)ToroidalShotTriggerOnOffInv" )
}
record(calcout, "$(P)$(R)ToroidalShotTriggerOnOffInv" ) {
field( INPA, "$(P)$(R)ToroidalShotTriggerOnOff NPP MS" )
field( OUT, "$(P)$(R)PCF8574:61:REGISTER.B2 PP MS" )
field( OOPT, "On Change" )
field( CALC, "A?0:1" )
}
############################################################
#######################################
# CAP BANK CHARGE ON/OFF #
#######################################
record(bo, "$(P)$(R)CapBankChargeOnOff" ) {
field( OUT, "$(P)$(R)PCF8574:61:REGISTER.B3 PP" )
field( ZNAM, "On" )
field( ONAM, "Off" )
}
########################################
# PRIMARY CLEAN CONTACTOR ON/OFF #
########################################
record(bo, "$(P)$(R)PrimaryCleanContactorOnOff" ) {
field( OUT, "$(P)$(R)PCF8574:61:REGISTER.B4 PP MS" )
field( ZNAM, "On" )
field( ONAM, "Off" )
}
####################################
### PRIMARY CLEAN BREAKER ON/OFF ###
####################################
record(bo, "$(P)$(R)PrimaryCleanBreakerOnOff"){
field( DESC, "Primary Cleaning OnOff")
field( OUT, "$(P)$(R)PCF8574:61:REGISTER.B5 PP" )
field( ZNAM, "On")
field( ONAM, "Off")
}
##################################
# GIS VALVES ON/OFF #
##################################
record(bo, "$(P)$(R)GISValvesOnOff" ) {
field( OUT, "$(P)$(R)PCF8574:61:REGISTER.B6 PP" )
field( ZNAM, "On" )
field( ONAM, "Off" )
}
##########################################
# CAP BANK DISCHARGE ON/OFF #
##########################################
record(bo, "$(P)$(R)CapBankDischargeOnOff" ) {
field( OUT, "$(P)$(R)PCF8574:61:REGISTER.B7 PP" )
field( ZNAM, "On" )
field( ONAM, "Off" )
}
#########################
###Pressure Conditions###
#########################
record(ao,"$(P)$(R)Pressure_PrimaryCondition"){
field(VAL,"5.0e-3")
field(PREC,"3")
field(EGU,"mBar")
}
record(ao,"$(P)$(R)Pressure_Primary2Condition"){
field(VAL,"5.0e-3")
field(PREC,"3")
field(EGU,"mBar")
}
record(ai,"$(P)$(R)Bypass_Condition"){
field(VAL,"0")
}
record(ai,"$(P)$(R)Turbo2_Speed"){
field(PREC,"3")
field(EGU,"RPM")
field(VAL,"0")
}
#######################
###TMP1 Manual Valve###
#######################
record(bo, "$(P)$(R)TMPManualValve"){
info(autosaveFields, "VAL")
field( DESC, "State of manual valve")
field( ZNAM, "Closed")
field( ONAM, "Open")
}

View File

@@ -5,10 +5,22 @@ include $(TOP)/configure/CONFIG
# Install databases, templates & substitutions like this
DB += ISTTOKstates.db
DB += ISTTOKvacummPumps.db
DB += ISTTOKmarte2.db
DB += ISTTOKmachineControl.db
DB += ISTTOKpcf8574.db
DB += ISTTOKpcf8591.db
DB += ISTTOKpfeiffer.db
DB += ISTTOKtda8444.db
DB += sendmail.db
DB += seeed4relay.db
DB += pcf8591.proto
DB += tda8444.proto
DB += sendmail.proto
DB += pcf8574.proto
DB += pfeiffer.proto
DB += seeed4relay.proto
DB += inficon.proto
DB += ISTTOKinficon.db
# If <anyname>.db template is not named <anyname>*.template add
# <anyname>_TEMPLATE = <templatename>

View File

@@ -0,0 +1,38 @@
# CR and LF are control characters, respectively coded 0x0D (13 decimal) and 0x0A (10 decimal)
Terminator = CR;
inTerminator = CR;
MaxInput = 30;
#MaxInput = 20;
ExtraInput = Ignore;
# Values in millisecond
LockTimeout = 500;
# Affects first out command in a protocol.
# If other records currently use the device, how many milliseconds to wait for
# exclusive access to the device before giving up?
# Protocol for the Inficon BAG302-S
#ReadTimeout = 1500;
ReplyTimeout = 300;
#PollPeriod = $ReplyTimeout;
#Integer. Affects first in command in I/O Intr mode (see chapter Record Processing).
PollPeriod = 200;
#out *03 7.97E-07
# Using redirection to read 2 records, mantissa and exponent
#-Pressure
readIonGauge1{
out "#01RD";
in "*01 %E";
}
readIonGauge3{
out "#03RD";
in "*03 %E";
}

View File

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

View File

@@ -1,5 +1,5 @@
Terminator = "";
LockTimeout = 500;
LockTimeout = 200;
ReplyTimeout = 100;
ReadTimeout = 100;
WriteTimeout = 100;
@@ -8,7 +8,7 @@ ExtraInput = Error;
rReg {
out ${1};
in "%.1r";
in "%01r";
}
# To read adc write control Byte
# Bits 0,1 ADC channel Selection
@@ -19,26 +19,29 @@ rReg {
# Bits 7 : =0
rConvAdc0 {
out ${1} 0;
out ${1} 64;
in "%02r";
}
rConvAdc1 {
out ${1} 1;
out ${1} 65;
in "%02r";
}
rConvAdc2 {
out ${1} 2;
out ${1} 66;
in "%02r";
}
rConvAdc3 {
out ${1} 3;
out ${1} 67;
in "%02r";
}
## @init { rReg; }
##
wReg {
out ${1} "%.1r";
}
wDac {
out ${1} 64 "%.1r";
}

View File

@@ -0,0 +1,74 @@
Terminator = CR;
inTerminator = CR;
# CR and LF are control characters, respectively coded 0x0D (13 decimal) and 0x0A (10 decimal)
MaxInput = 30;
#MaxInput = 20;
ExtraInput = Ignore;
# Values in millisecond
LockTimeout = 500;
# Affects first out command in a protocol.
# If other records currently use the device, how many milliseconds to wait for
# exclusive access to the device before giving up?
#ReadTimeout = 1500;
ReplyTimeout = 300;
#PollPeriod = $ReplyTimeout;
#Integer. Affects first in command in I/O Intr mode (see chapter Record Processing).
PollPeriod = 200;
# Using redirection to read 2 records, mantissa and exponent
#VVessel-Pressure
getPressure001 {
out "0010074002=?106";
in "0011074006%4u%(\$1)2u%+<sum8>";
}
#RPump1-Pressure
getPressure002 {
out "0020074002=?107";
in "0021074006%4u%(\$1)2u%+<sum8>";
}
# TMPump1-PressureAdmission
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"
}
debugCS {
ExtraInput = Ignore;
out "%s%+<sum8>"; in "%39c"
}
# Example:
# VVessel Degass
# caput ISTTOK:central:RS485Debug-CS "00110040011"
#
# TPump1 Degass:
# caput ISTTOK:central:RS485Debug-CS "00310040011"
# Check Errors:
# caput ISTTOK:central:RS485Debug-CS "0010030302=?"
# ( Repeat to see answer)

View File

@@ -0,0 +1,19 @@
##############################################################
# ### Read/Write SEEED Relay Board address 0x11=17 register ##
#############################################################
record( mbboDirect, "$(P)$(R)SEEED4RELAY:$(A):REGISTER") {
#record(longout, "$(P)$(R)SEEED4RELAY:$(A):REGISTER") {
field(DTYP, "stream")
field(OUT, "@seeed4relay.proto wReg($(A)) I2C")
# field(DRVH, "15" )
# field(DRVL, "0" )
field(SHFT, "0")
field(NOBT, "4")
field(VAL, 0)
# field(PINI,"YES")
}
record( mbbiDirect, "$(P)$(R)SEEED4RELAY:$(A):REGISTER:READ") {
field(DTYP, "stream")
field(INP, "@seeed4relay.proto rReg($(A)) I2C")
}

View File

@@ -0,0 +1,32 @@
Terminator = "";
LockTimeout = 500;
ReplyTimeout = 100;
ReadTimeout = 100;
WriteTimeout = 100;
MaxInput = 1;
ExtraInput = Error;
# IMPORTANT: Compile drvAsynI2C with flag STREAM_WORKAROUND = 1
#define CMD_CHANNEL_CTRL 0x10
#define CMD_SAVE_I2C_ADDR 0x11
#define CMD_READ_I2C_ADDR 0x12
#define CMD_READ_FIRMWARE_VER 0x13
rReg {
out ${1} 16;
in "%01r";
}
rFw {
out ${1} 18;
in "%01r";
}
## @init { rReg; }
##
wReg {
out ${1} 16 "%.1r";
}
# @init { out ${1}; in "%.1r"; }

View File

@@ -0,0 +1,7 @@
record(stringout, $(P)$(R)sendmail){
field(DESC, "Send email")
field(DTYP, "stream")
field(OUT, "@sendmail.proto send(isttok@ipfn.tecnico.ulisboa.pt,fernando@ipfn.tecnico.ulisboa.pt) $(PORT) $(A)")
# field(PINI, "YES")
}

View File

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

View File

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

View File

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

File diff suppressed because it is too large Load Diff

View File

@@ -4,18 +4,38 @@ include $(TOP)/configure/CONFIG
#----------------------------------------
# ADD MACRO DEFINITIONS BELOW HERE
# Use typed rset structure (see 3.16.1 release notes)
USR_CPPFLAGS += -DUSE_TYPED_RSET
# xxxRecord.h will be created from xxxRecord.dbd
#DBDINC += xxxRecord
# Install xxxSupport.dbd into <top>/dbd
#DBD += xxxSupport.dbd
# Build an IOC support library
LIBRARY_IOC += ISTTOKrpiSupport
# Compile and add the code to the support library
# Compile and add code to the support library
#ISTTOKrpiSupport_SRCS += xxxRecord.c
#ISTTOKrpiSupport_SRCS += devXxxSoft.c
# Link locally-provided code into the support library,
# rather than directly into the IOC application.
# This is required for Windows DLL builds.
# rather than directly into the IOC application, that
# causes problems on Windows DLL builds
#ISTTOKrpiSupport_SRCS += dbSubExample.c
#ISTTOKrpiSupport_SRCS += devISTTOKrpiVersion.c
#ISTTOKrpiSupport_SRCS += ISTTOKrpiHello.c
ISTTOKrpiSupport_SRCS += initTrace.c
ISTTOKrpiSupport_LIBS += $(EPICS_BASE_IOC_LIBS)
# Auto-generate a header file containing a version string.
# Version comes from the VCS if available, else date+time.
#GENVERSION = ISTTOKrpiVersion.h
# Macro name
#GENVERSIONMACRO = ISTTOKrpiVERSION
# Build the IOC application
PROD_IOC = ISTTOKrpi
@@ -27,16 +47,24 @@ ISTTOKrpi_DBD += base.dbd
ISTTOKrpi_DBD += initTrace.dbd
# Include dbd files from all support applications:
ISTTOKrpi_DBD += asyn.dbd
#ISTTOKrpi_DBD += calc.dbd
ISTTOKrpi_DBD += stream.dbd
ISTTOKrpi_DBD += drvAsynI2C.dbd
ISTTOKrpi_DBD += drvAsynSerialPort.dbd
ISTTOKrpi_DBD += drvAsynIPPort.dbd
ISTTOKrpi_DBD += asSupport.dbd
# PVA support
ISTTOKrpi_DBD += qsrv.dbd
ISTTOKrpi_DBD += PVAServerRegister.dbd
# Add all the support libraries needed by this IOC
ISTTOKrpi_LIBS += asyn
#ISTTOKrpi_LIBS += calc
ISTTOKrpi_LIBS += stream
ISTTOKrpi_LIBS += drvAsynI2C
ISTTOKrpi_LIBS += autosave
# PVA support
ISTTOKrpi_LIBS += qsrv
# ISTTOKrpi_registerRecordDeviceDriver.cpp derives from ISTTOKrpi.dbd
ISTTOKrpi_SRCS += ISTTOKrpi_registerRecordDeviceDriver.cpp
@@ -51,14 +79,21 @@ ISTTOKrpi_LIBS += ISTTOKrpiSupport
# To build SNL programs, SNCSEQ must be defined
# in the <top>/configure/RELEASE file
ifneq ($(SNCSEQ),)
# Build sncExample into ISTTOKrpiSupport
IsttokSeqExec_SNCFLAGS += +r
# Build sncExample into ISTTOKrpiSupport , Safe Mode : +s
IsttokSeqExec_SNCFLAGS += +r +s
ISTTOKrpi_DBD += IsttokSeqExec.dbd
# A .stt sequence program is *not* pre-processed:
ISTTOKrpiSupport_SRCS += IsttokSeqExec.stt
ISTTOKrpiSupport_LIBS += seq pv
ISTTOKrpi_LIBS += seq pv
endif
# Link QSRV (pvAccess Server) if available
ifdef EPICS_QSRV_MAJOR_VERSION
ISTTOKrpi_LIBS += qsrv
ISTTOKrpi_LIBS += $(EPICS_BASE_PVA_CORE_LIBS)
ISTTOKrpi_DBD += PVAServerRegister.dbd
ISTTOKrpi_DBD += qsrv.dbd
endif
# Finally link IOC to the EPICS Base libraries
@@ -68,3 +103,5 @@ include $(TOP)/configure/RULES
#----------------------------------------
# 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
# INSTALL_LOCATION here.
INSTALL_LOCATION=/opt/epics/iocs/ISTTOKrpi
#</absolute/path/to/install/top>
#INSTALL_LOCATION=</absolute/path/to/install/top>
# Set this when the IOC and build host use different paths
# to the install location. This may be needed to boot from

View File

@@ -1,13 +1,12 @@
# RELEASE - Location of external support modules
#
# IF YOU MAKE ANY CHANGES to this file you must subsequently
# do a "gnumake rebuild" in this application's top level
# directory.
# IF YOU CHANGE ANY PATHS in this file or make API changes to
# any modules it refers to, you should do a "make rebuild" in
# this application's top level directory.
#
# The build process does not check dependencies against files
# that are outside this application, thus you should do a
# "gnumake rebuild" in the top level directory after EPICS_BASE
# or any other external module pointed to below is rebuilt.
# The EPICS build process does not check dependencies against
# any files from outside the application, so it is safest to
# rebuild it completely if any modules it depends on change.
#
# Host- or target-specific settings can be given in files named
# RELEASE.$(EPICS_HOST_ARCH).Common
@@ -15,7 +14,7 @@
# RELEASE.$(EPICS_HOST_ARCH).$(T_A)
#
# 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,
# and include statements that pull in other RELEASE files.
# Variables may be used before their values have been set.
@@ -23,25 +22,21 @@
# the CONFIG_SITE file.
# 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:
SNCSEQ = $(SUPPORT)/seq-2-2-1
ASYN = $(SUPPORT)/asyn-4-26
STREAM = $(SUPPORT)/stream-2-6a
AUTOSAVE = $(SUPPORT)/autosave-5-6-1
DRVASYNI2C = $(EPICS_BASE)/../modules/drvAsynI2C
#SNCSEQ = $(MODULES)/seq-ver
#
# 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
# other than EPICS_BASE:
#RULES = $(MODULES)/build-rules
# These allow developers to override the RELEASE variable settings
# without having to modify the configure/RELEASE file itself.
# These lines allow developers to override these RELEASE settings
# without having to modify this file directly.
-include $(TOP)/../RELEASE.local
-include $(TOP)/../RELEASE.$(EPICS_HOST_ARCH).local
-include $(TOP)/configure/RELEASE.local

View File

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

View File

@@ -7,3 +7,6 @@ and check the executable name on the first line of the st.cmd file
You may need to change the name of the .dbd file given in the
st.cmd's dbLoadDatabase() command before starting the ioc.
Purge save files older than 15 days
$ find ./save/ -mindepth 1 -mtime +15 -delete

View File

@@ -1,5 +1,6 @@
UAG(uag) {pi,opertok,codac-dev,pricardofc}
HAG(hag) {rpi-isttok,opertok-desktop,atca2}
#UAG(uag) {pi,root,opertok,codac-dev}
UAG(uag) {pi,root,opertok,codac-dev,oper}
HAG(hag) {rpi-isttok,opertok-desktop,atca-marte2,debian-timing}
ASG(DEFAULT) {
RULE(1,READ)
RULE(1,WRITE) {

View File

@@ -1,9 +1,10 @@
epicsEnvSet("IOC","iocISTTOKrpi")
epicsEnvSet("TOP","/opt/epics/iocs/ISTTOKrpi")
epicsEnvSet("SUPPORT","/usr/local/epics/base/../synApps_5_8/support")
epicsEnvSet("SNCSEQ","/usr/local/epics/base/../synApps_5_8/support/seq-2-2-1")
epicsEnvSet("ASYN","/usr/local/epics/base/../synApps_5_8/support/asyn-4-26")
epicsEnvSet("STREAM","/usr/local/epics/base/../synApps_5_8/support/stream-2-6a")
epicsEnvSet("AUTOSAVE","/usr/local/epics/base/../synApps_5_8/support/autosave-5-6-1")
epicsEnvSet("DRVASYNI2C","/usr/local/epics/base/../modules/drvAsynI2C")
epicsEnvSet("EPICS_BASE","/usr/local/epics/base")
epicsEnvSet("TOP","/home/pi/ISTTOK/epics/iocs/ISTTOKrpi")
epicsEnvSet("EPICS_BASE","/home/pi/Apps/epics7/epics-base")
epicsEnvSet("HOME","/home/pi")
epicsEnvSet("SUPPORT","/home/pi/Apps/epics7/support")
epicsEnvSet("ASYN","/home/pi/Apps/epics7/support/asyn")
epicsEnvSet("STREAM","/home/pi/Apps/epics7/support/stream")
epicsEnvSet("AUTOSAVE","/home/pi/Apps/epics7/support/autosave")
epicsEnvSet("DRVASYNI2C","/home/pi/Apps/epics7/support/drvAsynI2C")
epicsEnvSet("SNCSEQ","/home/pi/Apps/epics7/support/seq-2-2")

View File

@@ -1,24 +1,24 @@
ISTTOK:central:PULSE-NUMBER.VAL
# P=ISTTOK:,R=central:
$(P)$(R)PULSE-NUMBER.VAL
ISTTOK:central:LogMessage.VAL
ISTTOK:central:LASTOPSTATE.VAL
ISTTOK:central:OPREQ.VAL
ISTTOK:central:PROCESS-MODE.VAL
ISTTOK:central:CLEANINGMANMODE.VAL
ISTTOK:central:TMPManualValve.VAL
ISTTOK:central:Emergency-UserButton.VAL
ISTTOK:central:TMPump1-ManualValve.VAL
ISTTOK:central:Shot-TorPSCurrent
#ISTTOK:central:UPS-Shutdown
#ALARM Limits
$(P)$(R)RPump1-Pressure.HIGH
ISTTOK:central:RPump1-Pressure.HIHI
#ISTTOK:central:RPump2-Pressure.HIGH
#ISTTOK:central:RPump2-Pressure.HIHI
# MARTe2 AtcaIop
ISTTOK:central:ATCAIOP1-EO
ISTTOK:central:ATCAIOP1-WO
ISTTOK:central:OPREQ
ISTTOK:central:PROCESS-MODE.VAL
ISTTOK:central:PROCESS-REQ.VAL
ISTTOK:central:STARTINGSTATE.VAL
ISTTOK:central:STOPPINGSTATE.VAL
ISTTOK:central:CLEANINGSTATE.VAL
ISTTOK:central:CLEANINGMASTATE.VAL
ISTTOK:central:CLEANINGINOUTSTATE.VAL
ISTTOK:central:CLEANINGINOUTSTATE0.VAL
ISTTOK:central:CLEANINGINOUTSTATE1.VAL
ISTTOK:central:CLEANINGINOUTSTATE2.VAL
ISTTOK:central:CLEANINGINOUTSTATE3.VAL
ISTTOK:central:CLEANINGINOUTSTATE4.VAL
ISTTOK:central:CLEANINGINOUTSTATE5.VAL
ISTTOK:central:WSHOTINGSTATE.VAL
ISTTOK:central:Pressure_PrimaryCondition.VAL
ISTTOK:central:Pressure_Primary2Condition.VAL
ISTTOK:central:EmergencyOnOff.VAL

View File

@@ -0,0 +1,171 @@
ISTTOK:central:CurrentTime
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:OPCALCSTATE
ISTTOK:central:STARTCALCSTATE
ISTTOK:central:STOPPINGCALCSTATE
ISTTOK:central:CLEANCALCSTATE
ISTTOK:central:WSHOTCALCSTATE
ISTTOK:central:PULSE-NUMBER
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:UPS-OnBattery
ISTTOK:central:UPS-Shutdown
ISTTOK:central:OPREQ
ISTTOK:central:CLEANINGMANMODE
ISTTOK:central:FSTriggerStart
ISTTOK:central:PROCESS-MODE
ISTTOK:central:PROCESS-REQ
ISTTOK:central:AUTHORISATION
ISTTOK:central:TMPump1-ControllerOn
ISTTOK:central:TMPump1-ControllerOff
ISTTOK:central:TMPump1-MotorOn
ISTTOK:central:TMPump1-MotorOff
ISTTOK:central:TMPump2-Motor
ISTTOK:central:Emergency-UserButton
ISTTOK:central:RPump1-Motor
ISTTOK:central:RPump1-Valve
ISTTOK:central:RPump2-Motor
ISTTOK:central:RPump2-Valve
ISTTOK:central:VVessel-Filament
ISTTOK:central:ELCO-Enable
ISTTOK:central:Shot-TorPSTrigger
ISTTOK:central:GasIS-Valves
ISTTOK:central:TMPump1-ManualValve
ISTTOK:central:Clean-PrimPneuBreaker
ISTTOK:central:CapBank-Discharge
ISTTOK:central:Clean-TorPneuBreaker
ISTTOK:central:Clean-PrimContactor
ISTTOK:central:Clean-TorContactor
ISTTOK:central:CapBank-Charge
ISTTOK:central:Buzzer
ISTTOK:central:Shot-TorPSDisable
ISTTOK:central:Lab-WarningLight
ISTTOK:SR_heartbeat
ISTTOK:SR_i_am_alive
ISTTOK:SR_deadIfZero
ISTTOK:SR_disable
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:READ:FNOUT
ISTTOK:central:PCF8574:57:REGISTER:READ:FNOUT
ISTTOK:central:TMPump2-Speed
ISTTOK:central:TMPump2-Current
ISTTOK:central:Shot-TorPSCurrentImage
ISTTOK:central:PCF8574:56:REGISTER:READ
ISTTOK:central:PCF8574:57:REGISTER:READ
ISTTOK:central:PCF8574:60:REGISTER:READ
ISTTOK:central:PCF8574:61:REGISTER:READ
ISTTOK:central:SEEED4RELAY:17:REGISTER:READ
ISTTOK:central:SEEED4RELAY:18:REGISTER:READ
ISTTOK:central:SEEED4RELAY:19:REGISTER:READ
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:SEEED4RELAY:17:REGISTER
ISTTOK:central:SEEED4RELAY:18:REGISTER
ISTTOK:central:SEEED4RELAY:19:REGISTER
ISTTOK:central:MARTe2-Status
ISTTOK:central:TraceMessage
ISTTOK:central:LogMessage
ISTTOK:central:RS485Debug
ISTTOK:central:RS485Debug-CS
ISTTOK:central:sendmail
ISTTOK:SR_recentlyStr
ISTTOK:SR_rebootStatusStr
ISTTOK:SR_rebootTime
ISTTOK:SR_statusStr
ISTTOK:SR_0_Name
ISTTOK:SR_0_StatusStr
ISTTOK:SR_0_Time
ISTTOK:SR_1_Name
ISTTOK:SR_1_StatusStr
ISTTOK:SR_1_Time
ISTTOK:SR_2_Name
ISTTOK:SR_2_StatusStr
ISTTOK:SR_2_Time
ISTTOK:SR_3_Name
ISTTOK:SR_3_StatusStr
ISTTOK:SR_3_Time
ISTTOK:SR_4_Name
ISTTOK:SR_4_StatusStr
ISTTOK:SR_4_Time
ISTTOK:SR_5_Name
ISTTOK:SR_5_StatusStr
ISTTOK:SR_5_Time
ISTTOK:SR_6_Name
ISTTOK:SR_6_StatusStr
ISTTOK:SR_6_Time
ISTTOK:SR_7_Name
ISTTOK:SR_7_StatusStr
ISTTOK:SR_7_Time
ISTTOK:central:OPSTATE
ISTTOK:central:LASTOPSTATE
ISTTOK:central:STARTINGSTATE
ISTTOK:central:CLEANINGSTATE
ISTTOK:central:WSHOTINGSTATE
ISTTOK:central:STOPPINGSTATE
ISTTOK:central:MARTe2-Command
ISTTOK:SR_rebootStatus
ISTTOK:SR_status
ISTTOK:SR_0_Status
ISTTOK:SR_1_Status
ISTTOK:SR_2_Status
ISTTOK:SR_3_Status
ISTTOK:SR_4_Status
ISTTOK:SR_5_Status
ISTTOK:SR_6_Status
ISTTOK:SR_7_Status
ISTTOK:central:PCF8591:72:ADC_CH1
ISTTOK:central:PCF8591:72:ADC_CH2
ISTTOK:central:PCF8591:72:ADC_CH3
ISTTOK:central:P001:M
ISTTOK:central:P001:E
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:MARTe2-Reset
ISTTOK:central:ATCAIOP1-EO
ISTTOK:central:ATCAIOP1-WO
ISTTOK:central:TMPump1-ControllerOnInv
ISTTOK:central:TMPump1-ControllerOffInv
ISTTOK:central:TMPump1-MotorOnInv
ISTTOK:central:TMPump1-MotorOffInv
ISTTOK:central:Shot-TorPSTriggerInv
ISTTOK:central:REGISTER61-BLINK
ISTTOK:central:REGISTER56-BLINK

View File

@@ -0,0 +1,17 @@
#!/bin/sh
PID=$(ps ax |awk '/[0-9] ..\/..\/bin\/linux-arm\/ISTTOKrpi st.cmd/ {print $1}')
QUERY=$(ps ax |awk '/[0-9] ..\/..\/bin\/linux-arm\/ISTTOKrpi st.cmd/ {print}')
echo $PID
echo $QUERY
read -p "Proceed" ANS
#if [ $ANS = y]
#then
kill -9 $PID
echo Killed
./run-ioc.sh
exit 0
#else
# exit 0
# echo abort
#fi

0
epics/iocs/ISTTOKrpi/iocBoot/iocISTTOKrpi/run-ioc.sh Normal file → Executable file
View File

View File

@@ -0,0 +1,15 @@
# autosave R5.3 Automatically generated - DO NOT MODIFY - 241008-092411
ISTTOK:central:PULSE-NUMBER.VAL 51596
ISTTOK:central:LogMessage.VAL
ISTTOK:central:LASTOPSTATE.VAL 5
ISTTOK:central:OPREQ.VAL 0
ISTTOK:central:PROCESS-MODE.VAL 1
ISTTOK:central:CLEANINGMANMODE.VAL 1
ISTTOK:central:Emergency-UserButton.VAL 0
ISTTOK:central:TMPump1-ManualValve.VAL 1
ISTTOK:central:Shot-TorPSCurrent 32
ISTTOK:central:RPump1-Pressure.HIGH 0.05
ISTTOK:central:RPump1-Pressure.HIHI 0.1
ISTTOK:central:ATCAIOP1-EO @array@ { "-152" "113" "-423" "-40" "-205" "6" "134" "-70" "-240" "-317" "-127" "-183" "-468" "-322" }
ISTTOK:central:ATCAIOP1-WO @array@ { "0.191" "0.174" "-0.036" "-0.044" "0.183" "0.126" "0.02" "0.14" "-0.461" "-0.572" "0.022" "-0.262" "0.475" "0.353" }
<END>

View File

@@ -4,9 +4,9 @@
## everywhere it appears in this file
< envPaths
epicsEnvSet( "STREAM_PROTOCOL_PATH", "$(TOP)/protocols" )
epicsEnvSet( "STREAM_PROTOCOL_PATH", "$(TOP)/db" )
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}"
@@ -15,29 +15,25 @@ dbLoadDatabase "dbd/ISTTOKrpi.dbd"
ISTTOKrpi_registerRecordDeviceDriver pdbbase
## Load I2C drivers
# *** IMPORTANT: Compile drvAsynI2C with flag STREAM_WORKAROUND = 1
drvAsynI2CConfigure( "I2C", "/dev/i2c-1", 1 )
## Load Serial drivers
#drvAsynSerialPortConfigure("RS0","/dev/ttyUSB0")
#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")
## Load record instances
dbLoadRecords("db/ISTTOKstates.db","P=ISTTOK:,R=central:")
dbLoadRecords("db/ISTTOKpcf8574.db","P=ISTTOK:,R=central:")
dbLoadRecords("db/ISTTOKpcf8591.db","P=ISTTOK:,R=central:")
#dbLoadRecords("db/ISTTOKpcf8574.db","P=ISTTOK:,R=central:,ID=57")
dbLoadRecords("db/ISTTOKvacummPumps.db","P=ISTTOK:,R=central:")
dbLoadRecords("db/ISTTOKpcf8574.db","P=ISTTOK:,R=central:,BUS=I2C")
dbLoadRecords("db/ISTTOKpcf8591.db","P=ISTTOK:,R=central:,BUS=I2C")
dbLoadRecords("db/ISTTOKtda8444.db","P=ISTTOK:,R=central:,BUS=I2C")
dbLoadRecords("db/ISTTOKmachineControl.db","P=ISTTOK:,R=central:")
## SEEED RELAY BOARD
dbLoadRecords("db/seeed4relay.db","P=ISTTOK:,R=central:,A=17")
dbLoadRecords("db/seeed4relay.db","P=ISTTOK:,R=central:,A=18")
dbLoadRecords("db/seeed4relay.db","P=ISTTOK:,R=central:,A=19")
## Load Serial drivers
drvAsynSerialPortConfigure("RS0","/dev/ttyUSB0")
#drvAsynSerialPortConfigure("RS0","/dev/ttyAMA0")
#drvAsynSerialPortConfigure("RS0","/dev/ttyUSB0")
drvAsynSerialPortConfigure("RS0","/dev/tty_rs485USB0")
asynSetOption("RS0", 0, "baud", "9600")
asynSetOption("RS0", 0, "bits", "8")
asynSetOption("RS0", 0, "parity", "none")
@@ -45,23 +41,38 @@ asynSetOption("RS0", 0, "stop", "1")
asynSetOption("RS0", 0, "clocal", "Y")
asynSetOption("RS0", 0, "crtscts", "N")
dbLoadRecords("db/ISTTOKpfeiffer.db","P=ISTTOK:,R=central:,bus=RS0")
# Pfeiffer sensor were connectoed to other RPI /(192.168.1.120)
# Uncomment to Debug STREAM serial activity
dbLoadRecords("db/ISTTOKpfeiffer.db","P=ISTTOK:,R=central:,bus=RS0")
dbLoadRecords("db/ISTTOKinficon.db","P=ISTTOK:,R=central:,bus=RS0")
# connect to the MAIL server mail.ipfn.tecnico.ulisboa.pt
# ,priority,noAutoConnect,noProcessEos
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/ISTTOKmarte2.db","P=ISTTOK:,R=central:")
# Uncomment to Debug STREAMDEVICE serial activity
# 2021/12/14 13:11:50.019969 RS0 ISTTOK:central:P002:M: No reply within 200 ms to "0020074002=?107<0d>
#var streamError 1
#with this no errors on pfeiffer bus
#var streamDebug 1
#streamSetLogfile("logfile.txt")
## Run this to trace the stages of iocInit
#traceIocInit
save_restoreSet_status_prefix("$(IOC):")
#save_restoreSet_status_prefix("$(IOC):")
save_restoreSet_status_prefix("ISTTOK:")
set_requestfile_path("$(SAVE_DIR)")
set_savefile_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}"
@@ -69,11 +80,11 @@ asSetFilename("${TOP}/iocBoot/${IOC}/access_security.acf")
iocInit
#asInit
asInit
# Create request file and start periodic 'save
# makeAutosaveFileFromDbInfo("$(SAVE_DIR)/$(IOC).req", "autosaveFields")
create_monitor_set("$(IOC).req", 30)
create_monitor_set("$(IOC).req", 30, "P=ISTTOK:,R=central:")
## Start any sequence programs
seq IsttokSeqExec, "unit=ISTTOK"
## Start any sequence programs , use safe mode
seq IsttokSeqExec "unit=ISTTOK,node=central,output=logFile2"

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

@@ -1,25 +1,30 @@
Terminator=CR;
MaxInput = 20;
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;
#in millisecond
#ReadTimeout = 2000;
ReplyTimeout = 200;
# Using redirection to read 2 records, mantissa and exponent
getPressure001 {
out "0010074002=?106";
# out "0010074002=?106";
in "0011074006%4u%(\$1)2u%+<sum8>";
}
# out "0020074002=?107";
getPressure002 {
out "0020074002=?107";
in "0021074006%4u%(\$1)2u%+<sum8>";
}
getPressure003 {
out "0030074002=?108";
# out "0030074002=?108";
in "0031074006%4u%(\$1)2u%+<sum8>";
}
getPressure004 {
out "0040074002=?109";
# out "0040074002=?109";
in "0041074006%4u%(\$1)2u%+<sum8>";
}
#

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"

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

@@ -0,0 +1,35 @@
#RELEASE Location of external products
HOME=/home/pi
SUPPORT=$(HOME)/Apps/epics7/support
#
#
ASYN=$(SUPPORT)/asyn
STREAM=$(SUPPORT)/stream
#STREAM=$(SUPPORT)/StreamDevice
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.9
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/Apps/epics7/epics-base

View File

@@ -0,0 +1,146 @@
###################################################################
# This records is the dspPIC uptime in seconds from last reset #
###################################################################
record(longin, "$(P)$(R)Uptime")
{
field(DESC, "Reads dsPIC Uptime")
field(DTYP, "stream")
field(INP, "@dspic.proto getUP $(PORT)")
field(SCAN, "I/O Intr")
field(FLNK,"$(P)$(R)Diff_Uptime") #Link to update Diff_Uptime
field(ADEL,100)
field(MDEL,0)
}
record(calc, "$(P)$(R)Diff_Uptime") {
field(DESC, "Uptime diff. between I/O Intr scans")
field(CALC,"B-A")
field(SCAN,"Passive")
field(INPA,"$(P)$(R)Last_Uptime.VAL NPP")
field(INPB,"$(P)$(R)Uptime")
field(FLNK,"$(P)$(R)Last_Uptime")
field(HIHI,"100.0")
field(HIGH,"2.0")
field(LOW, "0.0")
field(LOLO,"-10.0")
}
record(calc, "$(P)$(R)Last_Uptime") {
field(DESC, "Last Uptime for diff. calc")
field(CALC,"A")
field(SCAN,"Passive")
field(INPA,"$(P)$(R)Uptime")
}
###################################################################
# These records read Temperatures #
###################################################################
record(ai, "$(P)$(R)VVessel-Temperature")
{
field(DESC, "Reads TE01 Temperature")
field(DTYP, "stream")
field(INP, "@dspic.proto getTE01 $(PORT) $(A)")
field(SCAN, "I/O Intr")
field(EGU, "C")
field(PREC, "4")
field(LINR, "LINEAR")
# field(ESLO, "0.00001163358")
# See https://paulscherrerinstitute.github.io/StreamDevice/ai.html
# field(EGUL, "-1.02376")
# x 30
field(ESLO, "0.000349007")
#field(EGUL, "-30.71")
field(EOFF, "-30.71")
field(HOPR, "140.0")
field(LOPR, "0.0")
field(HIHI,"120.0")
field(HIGH,"100.0")
field(LOW, "0.0")
field(LOLO,"-10.0")
field(HHSV,"MAJOR")
field(HSV, "MINOR")
# field(LSV, "MINOR")
# field(LLSV,"MAJOR")
field(ADEL, "1.0") # Archive Deadband
}
# Precision
# Engineering Units
# field(EGU, "Raw")
# Convertion
# val = val * ESLO + EGUL
# field(ESLO, "0.000011633582866550557")
# field(DESC,"Thermocouple 0")
# field(HIHI,"90.0")
# field(HIGH,"50.0")
# field(LOW, "20.0")
# field(LOLO,"0.0")
# field(HHSV,"MAJOR")
# field(HSV, "MINOR")
# field(LSV, "MINOR")
# field(LLSV,"MAJOR")
# field(MDEL, "0.0") # Monitor Deadband
record(ai, "$(P)$(R)Temperature_1")
{
field(DESC, "Reads TE02 Temperature")
field(DTYP, "stream")
field(INP, "@dspic.proto getTE02 $(PORT) $(A)")
field(SCAN, "I/O Intr")
field(EGU, "C")
field(PREC, "4")
field(LINR, "LINEAR")
# field(CALC,"A*0.000011633582866550557-1.02376")
field(ESLO, "0.00001163358")
field(EGUL, "-1.02376")
}
record(ai, "$(P)$(R)Temperature_2")
{
field(DESC, "Reads TE03 Temperature")
field(DTYP, "stream")
field(INP, "@dspic.proto getTE03 $(PORT)")
field(SCAN, "I/O Intr")
field(EGU, "C")
field(PREC, "4")
field(LINR, "LINEAR")
field(ESLO, "0.00001163358")
field(EGUL, "-1.02376")
}
record(ai, "$(P)$(R)Temperature_3") {
field(DESC, "Reads TE04 Temperature")
field(DTYP, "stream")
field(INP, "@dspic.proto getTE04 $(PORT)")
field(SCAN, "I/O Intr")
field(EGU, "C")
field(PREC, "4")
field(LINR, "LINEAR")
field(ESLO, "0.00001163358")
field(EGUL, "-1.02376")
}
record(ai, "$(P)$(R)Capbank_Voltage") {
field(DESC, "Reads PRD01, Capitor bank Voltage PWM")
field(DTYP, "stream")
field(INP, "@dspic.proto getPRD01 $(PORT)")
field(SCAN, "I/O Intr")
field(LINR, "LINEAR")
# # val = val * ESLO + EGUL
field(ESLO, "1.0")
field(EGUL, "0.0")
# Precision
field(PREC, "1")
# Units
field(EGU, "V")
# # Alarms
}
record(stringin, $(P)$(R)idn) {
field(DESC, "Debug info blabla")
field(DTYP, "stream")
field(INP, "@dspic.proto getStr $(PORT) $(A)")
field(SCAN, "I/O Intr")
}
record(stringin, "$(P)$(R)CurrentTime") {
field(DESC, "Current Date and Time of the IOC")
field(SCAN, "1 second")
field(DTYP, "Soft Timestamp")
field(PINI, "YES")
field(INP, "@%d/%m/%Y %H:%M:%S")
}

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 += ISTTOKtemperature.db
DB += dspic.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,37 @@
# https://epics.anl.gov/tech-talk/2013/msg02051.php
Terminator = CR LF;
MaxInput = 110;
ReadTimeout = 200;
#ExtraInput = Ignore;
getTE01 {
in "TE01_%10u TE02_%*10u %*80c";
}
getTE02 {
# in "TE01_%*s TE02_%10u TE03_%*10u %*70c";
in "TE01_%*u TE02_%10u TE03_%*10u TE04_%*10u PRD01_%*10u UP_%*10u %*u %+<sum8>";
}
getTE03 {
# in "TE01_%*s TE02_%*10u TE03_%10u %*80c";
in "TE01_%*u TE02_%*10u TE03_%10u TE04_%*10u PRD01_%*10u UP_%*10u %*u %+<sum8>";
}
getTE04 {
# in "TE01_%*s TE02_%*10u TE03_%*10u TE04_%10u %*40c";
in "TE01_%*u TE02_%*10u TE03_%*10u TE04_%10u PRD01_%*10u UP_%*10u %*u %+<sum8>";
}
getPRD01 {
# in "TE01_%*s TE02_%*10u TE03_%*10u TE04_%*10u PRD01_%10u %*30c";
in "TE01_%*s TE02_%*10u TE03_%*10u TE04_%*10u PRD01_%10u UP_%*10u %*u %+<sum8>";
}
getUP {
in "TE01_%*s TE02_%*10u TE03_%*10u TE04_%*10u PRD01_%*10u UP_%10u %*u %+<sum8>";
}
getStr{
in "TE01_%10s%*93c";
}

View File

@@ -0,0 +1,49 @@
TOP=../..
include $(TOP)/configure/CONFIG
#----------------------------------------
# ADD MACRO DEFINITIONS AFTER THIS LINE
#=============================
#=============================
# Build the IOC application
PROD_IOC = ISTTOK
# ISTTOK.dbd will be created and installed
DBD += ISTTOK.dbd
# ISTTOK.dbd will be made up from these files:
ISTTOK_DBD += base.dbd
# Include dbd files from all support applications:
#ISTTOK_DBD += xxx.dbd
ISTTOK_DBD += asyn.dbd
ISTTOK_DBD += drvAsynSerialPort.dbd
ISTTOK_DBD += calc.dbd
ISTTOK_DBD += stream.dbd
# Add all the support libraries needed by this IOC
#ISTTOK_LIBS += xxx
ISTTOK_LIBS += asyn
ISTTOK_LIBS += calc
ISTTOK_LIBS += stream
# ISTTOK_registerRecordDeviceDriver.cpp derives from ISTTOK.dbd
ISTTOK_SRCS += ISTTOK_registerRecordDeviceDriver.cpp
# Build the main IOC entry point on workstation OSs.
ISTTOK_SRCS_DEFAULT += ISTTOKMain.cpp
ISTTOK_SRCS_vxWorks += -nil-
# Add support from base/src/vxWorks if needed
#ISTTOK_OBJS_vxWorks += $(EPICS_BASE_BIN)/vxComLibrary
# Finally link to the EPICS Base libraries
ISTTOK_LIBS += $(EPICS_BASE_IOC_LIBS)
#===========================
include $(TOP)/configure/RULES
#----------------------------------------
# ADD RULES AFTER THIS LINE

View File

@@ -0,0 +1,5 @@
# https://dev.to/enbis/how-udev-rules-can-help-us-to-recognize-a-usb-to-serial-device-over-dev-tty-interface-pbk
#
#SUBSYSTEM=="tty", ATTRS{idVendor}=="0403", ATTRS{idProduct}=="6001", SYMLINK+="tty%E{ID_MODEL}"
SUBSYSTEM=="tty", ATTRS{idVendor}=="1a86", ATTRS{idProduct}=="7523", SYMLINK+="dsPIC0"
#SUBSYSTEM=="usb", ATTRS{idVendor}=="1a86", ATTRS{idProduct}=="7523", SYMLINK+="dsPIC0"

View File

@@ -0,0 +1,24 @@
#https://epics-controls.org/resources-and-support/documents/howto-documents/posix-thread-priority/
# 1) install procserv and telnet
# put this file in
# /etc/systemd/system/
# 2) and enable service:
# sudo systemctl enable isttok-temp-ioc.service
[Unit]
Description=EPICS Soft IOC ISTTOK
Requires=network.target
After=network.target
[Service]
WorkingDirectory=/home/oper/ISTTOK/epics/iocs/dsPICTemp/iocBoot/iocISTTOK
ExecStart=/usr/bin/procServ --foreground --quiet --port=4051 /home/oper/ISTTOK/epics/iocs/dsPICTemp/iocBoot/iocISTTOK/st.cmd
Restart=always
#User=iocuser
User=oper
RuntimeDirectory=ISTTOK
#CPUAffinity=1-3
#LimitMEMLOCK=infinity
#LimitRTPRIO=99
[Install]
WantedBy=multi-user.target

View File

@@ -0,0 +1,34 @@
#!/home/oper/ISTTOK/epics/iocs/dsPICTemp/bin/linux-x86_64/ISTTOK
#- You may have to change ISTTOK to something else
#- everywhere it appears in this file
< envPaths
epicsEnvSet( "STREAM_PROTOCOL_PATH", "$(TOP)/db" )
epicsEnvSet( "EPICS_CA_ADDR_LIST", "localhost 192.168.1.120 192.168.1.110")
cd "${TOP}"
## Register all support components
dbLoadDatabase "dbd/ISTTOK.dbd"
ISTTOK_registerRecordDeviceDriver pdbbase
#drvAsynSerialPortConfigure("RS232","/dev/ttyUSB1")
drvAsynSerialPortConfigure("RS232","/dev/dsPIC0")
asynSetOption("RS232", 0, "baud", "115200")
asynSetOption("RS232", 0, "bits", "8")
asynSetOption("RS232", 0, "parity", "none")
asynSetOption("RS232", 0, "stop", "1")
#asynSetOption("RS232", 0, "clocal", "N")
#asynSetOption("RS232", 0, "crtscts", "Y")
## Load record instances
dbLoadRecords("db/ISTTOKtemperature.db","P=ISTTOK:,R=temperature:,PORT=RS232,A=0")
cd "${TOP}/iocBoot/${IOC}"
iocInit
## Start any sequence programs
#seq sncxxx,"user=oper"

133
epics/isttok_influx.py Normal file
View File

@@ -0,0 +1,133 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Thu Feb 8 16:34:35 2018
@author: bernardo carvalho
https://pypi.org/project/influxdb/
http://influxdb-python.readthedocs.io/en/latest/api-documentation.html#influxdb.DataFrameClient.write_points
"""
import epics
import time
import os
import sys
import json
from datetime import datetime
#from influxdb_client import InfluxDBClient
from influxdb import InfluxDBClient
import numpy as np
sys.path
os.environ['EPICS_CA_ADDR_LIST'] = '192.168.1.110'
os.environ['EPICS_CA_AUTO_ADDR_LIST'] = 'NO'
client = InfluxDBClient('localhost', 8086, 'oper', 'opertok', 'epics_isttok')
client.create_database('epics_isttok')
#client = InfluxDBClient('http://127.0.0.1:8086', username='oper', password='opertok')
#def onChanges(pvname=None, value=None, char_value=None, **kw):
# pass
SCAN_PERIOD = 15
opstate_pv = epics.PV('ISTTOK:central:OPSTATE')
vv_press_pv = epics.PV('ISTTOK:central:VVessel-Pressure')
vv_press_pv.get(timeout=10)
#client.get_list_database()
def on_opstate_change(pvname=None, value=None, char_value=None, timestamp=None, **kw):
print('PV opstate Changed! {} {} {}'.format(pvname, char_value, timestamp))
dt = datetime.fromtimestamp(timestamp)
json_body = [{
"measurement": "central",
"tags": {"OPSTATE": opstate_pv.char_value},
"time": dt.strftime('%Y-%m-%dT%H:%M:%SZ'),
"fields": {"VVessel-Pressure": vv_press_pv.value}
}]
print(json_body)
client.write_points(json_body)
def on_vv_press_change(pvname=None, value=None, char_value=None, timestamp=None, **kw):
print('PV Changed! {} {} {}'.format(pvname, value, timestamp))
#data = [{"measurement": "central", "tags": {"host": "server01"}, "time": "2009-11-10T23:00:00Z", "fields": {
# "value": value }}]
dt = datetime.fromtimestamp(timestamp)
#json_data = json.dumps(data)
json_body = [
{
"measurement": "central",
"tags": {},
"time": dt.strftime('%Y-%m-%dT%H:%M:%SZ'), # "2009-11-10T23:00:00Z",
"fields": {
"VVessel-Pressure": value}
}
]
print(json_body)
# convert to datetime
# https://stackoverflow.com/questions/51014779/how-send-proper-timestamp-to-influxdb-with-influxdb-python
# write_points(points, time_precision=None, database=None, retention_policy=None, tags=None, batch_size=None, protocol=u'json', consistency=None)
client.write_points(json_body)
#client.write('epics_isttok','central', fields={'value': value})
#print('PV Changed! {} {} {}'.format(pvname, value, time.ctime()))
#vv_press_pv.add_callback(on_vv_press_change)
tmp1_press_admission_pv = epics.PV('ISTTOK:central:TMPump1-PressureAdmission')
rpump1_press_pv = epics.PV('ISTTOK:central:RPump1-Pressure')
opstate_pv.add_callback(on_opstate_change)
# https://medium.com/greedygame-engineering/an-elegant-way-to-run-periodic-tasks-in-python-61b7c477b679
while True:
#print('Hello from the Python Demo Service')
pv1_m_data = rpump1_press_pv.get_with_metadata()
pv2_m_data = tmp1_press_admission_pv.get_with_metadata()
pv3_m_data = vv_press_pv.get_with_metadata()
# pv4_m_data = i
opstate_pv.get()
dt = datetime.fromtimestamp(pv1_m_data['timestamp'])
json_body = [{
"measurement": "central",
"tags": {'OPSTATE': opstate_pv.char_value},
"time": dt.strftime('%Y-%m-%dT%H:%M:%SZ'),
"fields": {
"RPump1-Pressure": pv1_m_data['value'],
"TMPump1-PressureAdmission": pv2_m_data['value'],
"VVessel-Pressure": pv3_m_data['value']
}
}]
print(json_body)
client.write_points(json_body)
time.sleep(SCAN_PERIOD)
# valuePrimary2 = epics.caget('ISTTOK:central:RPump2-Pressure')
#valueChamber1 = epics.caget('ISTTOK:central:VVessel-Pressure')
#valueTMPadmission = epics.caget('ISTTOK:central:TMPump1-PressureAdmission')
#now = time.ctime()
# Open database connection
# 19 | ISTTOK:central:VVessel-Pressure
#sql_chamber ="SELECT `smpl_time`, `float_val` FROM `sample` WHERE `channel_id` = 5 " \
"AND `smpl_time` > addtime(now(),'-01:00:00') ORDER BY `smpl_time` DESC LIMIT 100;"
# 21 | ISTTOK:central:RPump1-Pressure
#sql_primary ="SELECT `smpl_time`, `float_val` FROM `sample` WHERE `channel_id` = 6 " \
"AND `smpl_time` > addtime(now(),'-01:00:00') ORDER BY `smpl_time` DESC LIMIT 100;"
# ORDER BY `smpl_time` DESC LIMIT 250;"
# Execute the SQL command
print("result sql1")
# Fetch all the rows in a list of lists.
print("result sql2")

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,179 @@
<?xml version="1.0" encoding="UTF-8"?>
<display version="2.0.0">
<name>Display</name>
<width>650</width>
<height>640</height>
<widget type="label" version="2.0.0">
<name>Label</name>
<class>TITLE</class>
<text>ISTTOK STATUS Page</text>
<x use_class="true">0</x>
<y use_class="true">0</y>
<width>234</width>
<height>25</height>
<font use_class="true">
<font name="Header 1" family="Liberation Sans" style="BOLD" size="22.0">
</font>
</font>
<foreground_color use_class="true">
<color name="Text" red="0" green="0" blue="0">
</color>
</foreground_color>
<transparent use_class="true">true</transparent>
<auto_size>true</auto_size>
</widget>
<widget type="label" version="2.0.0">
<name>Label_3</name>
<text>TMPump1-PressureAdmission</text>
<x>240</x>
<y>56</y>
<width>190</width>
<height>16</height>
<auto_size>true</auto_size>
</widget>
<widget type="label" version="2.0.0">
<name>Label_4</name>
<text>RPump1-Pressure</text>
<x>480</x>
<y>60</y>
<width>116</width>
<height>16</height>
<auto_size>true</auto_size>
</widget>
<widget type="label" version="2.0.0">
<name>Label_5</name>
<text>VVessel-Pressure</text>
<x>50</x>
<y>56</y>
<width>113</width>
<height>16</height>
<auto_size>true</auto_size>
</widget>
<widget type="textupdate" version="2.0.0">
<name>Text Update_1</name>
<pv_name>ISTTOK:central:OPSTATE</pv_name>
<x>490</x>
<y>40</y>
<width>145</width>
<show_units>false</show_units>
</widget>
<widget type="label" version="2.0.0">
<name>Label_6</name>
<text>OPSTATE</text>
<x>399</x>
<y>40</y>
<width>66</width>
<height>16</height>
<transparent>false</transparent>
<auto_size>true</auto_size>
</widget>
<widget type="label" version="2.0.0">
<name>Label_7</name>
<text>Emergency</text>
<x>260</x>
<y>20</y>
<width>92</width>
<height>21</height>
<font>
<font family="Liberation Sans" style="REGULAR" size="18.0">
</font>
</font>
<background_color>
<color name="Button_Background" red="210" green="210" blue="210">
</color>
</background_color>
<transparent>false</transparent>
<auto_size>true</auto_size>
</widget>
<widget type="textupdate" version="2.0.0">
<name>Text Update_3</name>
<pv_name>ISTTOK:temperature:VVessel-Temperature</pv_name>
<x>425</x>
<y>460</y>
<width>144</width>
<height>30</height>
<font>
<font family="Liberation Sans" style="REGULAR" size="20.0">
</font>
</font>
</widget>
<widget type="label" version="2.0.0">
<name>Label_8</name>
<text>VVessel-Temperature</text>
<x>220</x>
<y>470</y>
<width>137</width>
<height>16</height>
<background_color>
<color name="Button_Background" red="210" green="210" blue="210">
</color>
</background_color>
<transparent>false</transparent>
<auto_size>true</auto_size>
</widget>
<widget type="led" version="2.0.0">
<name>LED</name>
<pv_name>ISTTOK:central:Emergency</pv_name>
<x>370</x>
<y>20</y>
<width>30</width>
<height>30</height>
<on_color>
<color name="MAJOR" red="255" green="0" blue="0">
</color>
</on_color>
</widget>
<widget type="textupdate" version="2.0.0">
<name>TU VVessel-Pressure</name>
<pv_name>ISTTOK:central:VVessel-Pressure</pv_name>
<x>25</x>
<y>90</y>
<width>195</width>
<height>50</height>
<font>
<font family="Liberation Sans" style="REGULAR" size="24.0">
</font>
</font>
<format>2</format>
<horizontal_alignment>1</horizontal_alignment>
<vertical_alignment>1</vertical_alignment>
</widget>
<widget type="textupdate" version="2.0.0">
<name>TU TMPump1-PressureAdmission</name>
<pv_name>ISTTOK:central:TMPump1-PressureAdmission</pv_name>
<x>230</x>
<y>90</y>
<width>195</width>
<height>50</height>
<font>
<font family="Liberation Sans" style="REGULAR" size="24.0">
</font>
</font>
<format>2</format>
<horizontal_alignment>1</horizontal_alignment>
<vertical_alignment>1</vertical_alignment>
</widget>
<widget type="textupdate" version="2.0.0">
<name>TU RPump1-Pressure</name>
<pv_name>ISTTOK:central:RPump1-Pressure</pv_name>
<x>440</x>
<y>86</y>
<width>195</width>
<height>50</height>
<font>
<font family="Liberation Sans" style="REGULAR" size="24.0">
</font>
</font>
<format>2</format>
<horizontal_alignment>1</horizontal_alignment>
<vertical_alignment>1</vertical_alignment>
</widget>
<widget type="databrowser" version="2.0.0">
<name>Data Browser</name>
<file>press_sensors.plt</file>
<y>150</y>
<width>635</width>
<show_toolbar>true</show_toolbar>
<selection_value_pv>ISTTOK:central:VVessel-Pressure</selection_value_pv>
</widget>
</display>

View File

@@ -0,0 +1,373 @@
<?xml version="1.0" encoding="UTF-8"?>
<display version="2.0.0">
<name>ISTTOK AMin</name>
<width>830</width>
<height>710</height>
<background_color>
<color red="242" green="242" blue="242">
</color>
</background_color>
<widget type="label" version="2.0.0">
<name>Label</name>
<class>TITLE</class>
<text>My Display</text>
<x use_class="true">0</x>
<y use_class="true">0</y>
<width>230</width>
<height>31</height>
<font use_class="true">
<font name="Header 1" family="Liberation Sans" style="BOLD" size="22.0">
</font>
</font>
<foreground_color use_class="true">
<color name="Text" red="0" green="0" blue="0">
</color>
</foreground_color>
<transparent use_class="true">true</transparent>
</widget>
<widget type="picture" version="2.0.0">
<name>Image Template</name>
<file>pics/tecnico_logo.png</file>
<x>540</x>
<width>170</width>
<height>74</height>
<actions>
</actions>
</widget>
<widget type="tabs" version="2.0.0">
<name>Tabs</name>
<tabs>
<tab>
<name>Vacuum-M</name>
<children>
<widget type="label" version="2.0.0">
<name>Label VVessel</name>
<text>CHAMBER PRESSURE</text>
<x>39</x>
<y>15</y>
<width>175</width>
<height>34</height>
<font>
<font family="DejaVu Sans Mono" style="BOLD" size="10.891089108910892">
</font>
</font>
<foreground_color>
<color name="IO Text Fg" red="0" green="0" blue="0">
</color>
</foreground_color>
<background_color>
<color name="Dark Gray Border" red="190" green="190" blue="190">
</color>
</background_color>
<transparent>false</transparent>
<horizontal_alignment>1</horizontal_alignment>
<vertical_alignment>1</vertical_alignment>
<actions>
</actions>
<border_width>2</border_width>
<border_color>
<color name="IO Border" red="0" green="0" blue="0">
</color>
</border_color>
</widget>
<widget type="label" version="2.0.0">
<name>Label Template_12</name>
<text>ADMISSION PRESSURE1</text>
<x>221</x>
<y>15</y>
<width>176</width>
<height>34</height>
<font>
<font family="DejaVu Sans Mono" style="BOLD" size="10.891089108910892">
</font>
</font>
<foreground_color>
<color name="IO Text Fg" red="0" green="0" blue="0">
</color>
</foreground_color>
<background_color>
<color name="Dark Gray Border" red="190" green="190" blue="190">
</color>
</background_color>
<transparent>false</transparent>
<horizontal_alignment>1</horizontal_alignment>
<vertical_alignment>1</vertical_alignment>
<actions>
</actions>
<border_width>2</border_width>
<border_color>
<color name="IO Border" red="0" green="0" blue="0">
</color>
</border_color>
</widget>
<widget type="label" version="2.0.0">
<name>Label Template_13</name>
<text>PRIMARY PRESSURE1</text>
<x>404</x>
<y>15</y>
<width>176</width>
<height>34</height>
<font>
<font family="DejaVu Sans Mono" style="BOLD" size="10.891089108910892">
</font>
</font>
<foreground_color>
<color name="IO Text Fg" red="0" green="0" blue="0">
</color>
</foreground_color>
<background_color>
<color name="Dark Gray Border" red="190" green="190" blue="190">
</color>
</background_color>
<transparent>false</transparent>
<horizontal_alignment>1</horizontal_alignment>
<vertical_alignment>1</vertical_alignment>
<actions>
</actions>
<border_width>2</border_width>
<border_color>
<color name="IO Border" red="0" green="0" blue="0">
</color>
</border_color>
</widget>
<widget type="meter" version="3.0.0">
<name>Meter VVessel</name>
<pv_name>ISTTOK:central:VVessel-Pressure</pv_name>
<x>39</x>
<y>55</y>
<width>179</width>
<height>81</height>
<foreground_color>
<color name="IO InputPV Fg" red="0" green="0" blue="0">
</color>
</foreground_color>
<background_color>
<color name="IO Background" red="235" green="235" blue="235">
</color>
</background_color>
<font>
<font name="IO Scale" family="DejaVu Sans Mono" style="REGULAR" size="9.900990099009901">
</font>
</font>
<format>2</format>
<actions>
</actions>
<minimum>1.0E-8</minimum>
<needle_color>
<color name="IO Stick" red="0" green="0" blue="0">
</color>
</needle_color>
</widget>
<widget type="meter" version="3.0.0">
<name>Meter Template_3</name>
<pv_name>eq://log(`ISTTOK:central:TMPump1-PressureAdmission`)/2.3</pv_name>
<x>221</x>
<y>55</y>
<width>180</width>
<height>82</height>
<foreground_color>
<color name="IO InputPV Fg" red="0" green="0" blue="0">
</color>
</foreground_color>
<background_color>
<color name="IO Background" red="235" green="235" blue="235">
</color>
</background_color>
<font>
<font name="IO Scale" family="DejaVu Sans Mono" style="REGULAR" size="9.900990099009901">
</font>
</font>
<format>5</format>
<show_value>false</show_value>
<show_units>false</show_units>
<show_limits>false</show_limits>
<actions>
</actions>
<border_alarm_sensitive>false</border_alarm_sensitive>
<limits_from_pv>false</limits_from_pv>
<minimum>-8.0</minimum>
<maximum>2.0</maximum>
<needle_color>
<color name="IO Stick" red="0" green="0" blue="0">
</color>
</needle_color>
</widget>
<widget type="meter" version="3.0.0">
<name>Meter Template_4</name>
<pv_name>eq://log(`ISTTOK:central:RPump1-Pressure`)/2.3</pv_name>
<x>404</x>
<y>55</y>
<width>180</width>
<height>82</height>
<foreground_color>
<color name="IO InputPV Fg" red="0" green="0" blue="0">
</color>
</foreground_color>
<background_color>
<color name="IO Background" red="235" green="235" blue="235">
</color>
</background_color>
<font>
<font name="IO Scale" family="DejaVu Sans Mono" style="REGULAR" size="9.900990099009901">
</font>
</font>
<show_value>false</show_value>
<show_units>false</show_units>
<show_limits>false</show_limits>
<actions>
</actions>
<border_alarm_sensitive>false</border_alarm_sensitive>
<limits_from_pv>false</limits_from_pv>
<minimum>-4.0</minimum>
<maximum>3.0</maximum>
<needle_color>
<color name="IO Stick" red="0" green="0" blue="0">
</color>
</needle_color>
</widget>
<widget type="textupdate" version="2.0.0">
<name>Text UpVVessel</name>
<pv_name>ISTTOK:central:VVessel-Pressure</pv_name>
<x>39</x>
<y>145</y>
<width>175</width>
<height>34</height>
<font>
<font name="IO Label" family="DejaVu Sans Mono" style="REGULAR" size="11.881188118811881">
</font>
</font>
<foreground_color>
<color name="IO Foreground" red="0" green="0" blue="0">
</color>
</foreground_color>
<background_color>
<color name="IO Background" red="235" green="235" blue="235">
</color>
</background_color>
<format>2</format>
<precision>2</precision>
<horizontal_alignment>1</horizontal_alignment>
<vertical_alignment>1</vertical_alignment>
<wrap_words>false</wrap_words>
<actions>
</actions>
<border_width>2</border_width>
<border_color>
<color name="IO Foreground" red="0" green="0" blue="0">
</color>
</border_color>
</widget>
<widget type="textupdate" version="2.0.0">
<name>Text Update Template_3</name>
<pv_name>ISTTOK:central:TMPump1-PressureAdmission</pv_name>
<x>221</x>
<y>145</y>
<width>175</width>
<height>34</height>
<font>
<font name="IO Label" family="DejaVu Sans Mono" style="REGULAR" size="11.881188118811881">
</font>
</font>
<background_color>
<color name="IO Background" red="235" green="235" blue="235">
</color>
</background_color>
<format>2</format>
<precision>2</precision>
<horizontal_alignment>1</horizontal_alignment>
<vertical_alignment>1</vertical_alignment>
<wrap_words>false</wrap_words>
<actions>
</actions>
<border_width>2</border_width>
<border_color>
<color name="IO Foreground" red="0" green="0" blue="0">
</color>
</border_color>
</widget>
<widget type="textupdate" version="2.0.0">
<name>Text Update Template_4</name>
<pv_name>ISTTOK:central:RPump1-Pressure</pv_name>
<x>404</x>
<y>145</y>
<width>175</width>
<height>34</height>
<font>
<font name="IO Label" family="DejaVu Sans Mono" style="REGULAR" size="11.881188118811881">
</font>
</font>
<background_color>
<color name="IO Background" red="235" green="235" blue="235">
</color>
</background_color>
<format>2</format>
<precision>2</precision>
<horizontal_alignment>1</horizontal_alignment>
<vertical_alignment>1</vertical_alignment>
<wrap_words>false</wrap_words>
<actions>
</actions>
<border_alarm_sensitive>false</border_alarm_sensitive>
<border_width>2</border_width>
<border_color>
<color name="IO Foreground" red="0" green="0" blue="0">
</color>
</border_color>
</widget>
<widget type="embedded" version="2.0.0">
<name>Embedded Display</name>
<file>ManualControl.bob</file>
<x>409</x>
<y>382</y>
<width>360</width>
<height>180</height>
<border_width>1</border_width>
</widget>
<widget type="thermometer" version="2.0.0">
<name>ThermometerVvessel</name>
<pv_name>ISTTOK:temperature:VVessel-Temperature</pv_name>
<x>719</x>
<y>12</y>
</widget>
<widget type="label" version="2.0.0">
<name>Label_TVV</name>
<text>VVessel Temp -ºC</text>
<x>689</x>
<y>171</y>
<width>115</width>
<height>16</height>
<auto_size>true</auto_size>
<wrap_words>false</wrap_words>
</widget>
<widget type="textupdate" version="2.0.0">
<name>TU_VV_Temp</name>
<pv_name>ISTTOK:temperature:VVessel-Temperature</pv_name>
<x>689</x>
<y>102</y>
<wrap_words>false</wrap_words>
</widget>
<widget type="picture" version="2.0.0">
<name>Image</name>
<file>pics/isttok6.png</file>
<x>39</x>
<y>242</y>
<width>185</width>
<height>182</height>
<stretch_image>true</stretch_image>
<actions>
</actions>
</widget>
</children>
</tab>
<tab>
<name>Vacuum-SM</name>
<children>
</children>
</tab>
</tabs>
<x>10</x>
<y>60</y>
<width>820</width>
<height>650</height>
</widget>
</display>

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.7 KiB

Some files were not shown because too many files have changed in this diff Show More