1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 <2022> 2023 2024 | Index | 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 <2022> 2023 2024 |
<== Date ==> | <== Thread ==> |
---|
Subject: | Re: How to: IOC reading information from file? |
From: | "Marco A. Barra Montevechi Filho via Tech-talk" <tech-talk at aps.anl.gov> |
To: | "Nariyoshi, Pedro" <nariyosh at frib.msu.edu>, "tech-talk at aps.anl.gov" <tech-talk at aps.anl.gov> |
Date: | Mon, 28 Nov 2022 20:05:51 +0000 |
Thanks for the suggestion, Pedro!
At the end of the day, i figured that maybe autosave fdbrestore function would do what i wanted. Unfortunately, the function was resulting in segmentation fault. Looking in tech-talk i found this thread: https://epics.anl.gov/tech-talk/2014/msg01851.php which suggested that for autosave versions before 5.4.1 it is a known bug which is fixed after that. Since im using autosave 5-10-2 and the PVs are not very long, i gave up using autosave for this. I am indeed doing something similar to what you suggested: i created a file full of dbpf's and im trying to use the "execute" function of streamDevice to do a protocol file with: call_file { execute "< file_with_dbpfs.cmd";
}And a PV in the form: record(stringout, "$(P)$(R)UpdateConfig"){ field(DESC, "Filename from which to get values.")
field(OUT, "@iocsh_functions.proto call_file")
}Untill now i had no success but it seems to be some silly mistake that i still didnt have time to debug. Thanks, Marco From: Nariyoshi, Pedro <nariyosh at frib.msu.edu>
Sent: 28 November 2022 13:50 To: Marco A. Barra Montevechi Filho <marco.filho at lnls.br>; tech-talk at aps.anl.gov <tech-talk at aps.anl.gov> Subject: Re: How to: IOC reading information from file? Hi Marco,
I don't know if there's a native functionality for this, but for some of our IOCs we use python to do some of these things. You can add something like "system 'python3 iocApp/py/script.py arguments &'" to the startup script. The script would do a camonitor ' MYRECORD:Output' and have a callback to read the file and do the respective actions. It's not as clean as your original proposition, but it should be faster to get running until you figure something a better solution.
From: Marco A. Barra Montevechi Filho <marco.filho at lnls.br>
Sent: Thursday, November 24, 2022 10:02 AM To: tech-talk at aps.anl.gov Subject: How to: IOC reading information from file? [EXTERNAL] This email originated from outside of FRIB
Hello all.
I want to create a set of configuration files (probably json, yaml or even txt) that i can make my IOC read and put the values into PVs. I could swear i read something about reading configuration files in EPICS documentation before but i cant for the life of me find it again. Desired functionality would be something like: file config0.yaml has: {"my_var" : 0} file config1.yaml has: {"my_var" : 1} And then i would have a record, say MYRECORD:Output that when i do: caput MYRECORD:Output "config0.yaml" the record would output 0 to its output link. And caput MYRECORD:Output "config1.yaml" the record would output 1 to its output link. Is there any module or record that offers similar functionality? Thanks in advance, Marco Aviso Legal: Esta mensagem e seus anexos podem conter informações confidenciais e/ou de uso restrito. Observe atentamente seu conteúdo e considere eventual consulta ao remetente antes de copiá-la, divulgá-la ou distribuí-la. Se você recebeu esta mensagem por engano, por favor avise o remetente e apague-a imediatamente. Disclaimer: This email and its attachments may contain confidential and/or privileged information. Observe its content carefully and consider possible querying to the sender before copying, disclosing or distributing it. If you have received this email by mistake, please notify the sender and delete it immediately. |