Description | This is a PythonSoftIOC that can read DCS magnet values allocated in Memcached memory, decode them, and use them as process variables (PVs) for EPICS. Then it send commands to the DCS DEVIL process. |
---|---|
Target release | 2.4.1 |
Task List | |
Document status | DRAFT |
Designer | |
Developers | |
Project | https://baltig.infn.it/lnf-da-control/softioc-devil-wrapper |
Project schema:
EPIK8S-BTF/deploy/values.yaml
#[...] iocs: - name: "mag-wrapper" asset: "https://confluence.infn.it/display/TESTBEAM/SoftIOC+DEVIL+Wrapper" charturl: 'https://baltig.infn.it/epics-containers/ioc-chart.git' image: baltig.infn.it:4567/epics-containers/epics-py-base iocprefix: "DAFNE" start: "/epics/ioc/config/start.sh" ## if your mynewioc has a start.sh this line must be kept gitinit: true #[...]
EPIK8S-BTF/config/iocs/mag-wrapper/start.sh
#!/bin/bash script_dir=$(dirname "$0") cd $script_dir echo "Starting Mag-Wrapper : $EPICS_CA_ADDR_LIST" pip install -r ./scripts/requirements.txt python ./scripts/main.py -x DAFNE -c btf-config.json
OPI Magnets Test on CS-Studio Phoebus:
OPI 2.4 - Read only from Memcached (not send commands to DEVIL)
OPI 2.5 - Complete PySoftIOC (2.5.1) for Test on BTF
Run Python SoftIOC
$ python main.py -x DAFNE -c btf_qua_magnets.json INFO: PVXS QSRV2 is loaded, permitted, and ENABLED. [2024-05-28 10:10:29,741] INFO: Start SoftIOC to DEVIL - Version: 2.5.1 [2024-05-28 10:10:29,742] INFO: Memcached Server: 192.168.198.20 [2024-05-28 10:10:29,742] INFO: Memcached Port: 11211 [2024-05-28 10:10:29,783] INFO: Read configuration file! [2024-05-28 10:10:29,783] INFO: Configuration file : btf_qua_magnets.json [2024-05-28 10:10:29,784] INFO: Build prefix >>>>> DAFNE:BTF:QUATM001:current >>>>> DAFNE:BTF:QUATM001:mode >>>>> DAFNE:BTF:QUATM001:polarity >>>>> DAFNE:BTF:QUATM002:current >>>>> DAFNE:BTF:QUATM002:mode >>>>> DAFNE:BTF:QUATM002:polarity >>>>> DAFNE:BTF:QUATM003:current >>>>> DAFNE:BTF:QUATM003:mode >>>>> DAFNE:BTF:QUATM003:polarity [...] Starting iocInit ############################################################################ ## EPICS 7.0.7.0 ## Rev. 7.0.7.99.0.2 ## Rev. Date 7.0.7.99.0.2 ############################################################################ iocRun: All initialization complete [2024-05-28 10:10:30,314] INFO: Define CONTROL & COMMAND main functions. [2024-05-28 10:10:30,314] INFO: Launch CONTROL & COMMAND threads. ###################################################################### ## Command help : ## softioc.dbl() - Prints the names of PV records in the database! ## softioc.scanpiol() - Prints all records in the I/O event scan lists. ###################################################################### ### softioc.dbl() ### DAFNE:BTF:QUATB001:current_rb DAFNE:BTF:QUATB001:mode_rb DAFNE:BTF:QUATB001:polarity_rb DAFNE:BTF:QUATB002:current_rb DAFNE:BTF:QUATB002:mode_rb DAFNE:BTF:QUATB002:polarity_rb DAFNE:BTF:QUATB003:current_rb DAFNE:BTF:QUATB003:mode_rb DAFNE:BTF:QUATB003:polarity_rb [...] DAFNE:COUNTER DAFNE:BTF:QUATB001:current DAFNE:BTF:QUATB002:current DAFNE:BTF:QUATB003:current [...] DAFNE:MC_ERROR DAFNE:DEBUG:SERVICE:COMMAND DAFNE:INFO_VERSION DAFNE:START_TIME DAFNE:BTF:QUATB001:mode DAFNE:BTF:QUATB001:polarity DAFNE:BTF:QUATB002:mode DAFNE:BTF:QUATB002:polarity DAFNE:BTF:QUATB003:mode DAFNE:BTF:QUATB003:polarity [...] Python 3.12.1 | packaged by Anaconda, Inc. | (main, Jan 19 2024, 09:52:31) [Clang 14.0.6 ] on darwin Type "help", "copyright", "credits" or "license" for more information. (InteractiveConsole) >>>
Send Command - Shell Output
############################################################ # Counter Processed command : [1] [2024-05-21 16:55:12] # DCS Element : QUATB003 # Parameter : OPER # DEVIL IP : 192.168.198.122 # Port : 6342 # DCS Command : MODE ############################################################ # String to send Command : MODE QUATB003 OPER ############################################################ # # >>> Command Exectuted : MODE QUATB003 OPER # ############################################################ # Response for ECHO : ############################################################