We have IOC read data from text files at STAR experiment at Brookhaven
National Lab. We do something very similar to what Andreas suggested.
In our case, the script it attached to cron to automate the task
instead of making it run every so many seconds. The down side of
having cron deal with that is that we can only run once every minutes,
but for what we are interested, that's fast enough.
We also pass the input file via sed to make sure the right field goes
to the right PV (our input files contains multiple values that needs
to go multiple PVs).
On Wed, Oct 22, 2008 at 2:43 AM, Luedeke Andreas <[email protected]> wrote:
> Pierrick Hanlet wrote on 21.10.2008 22:00:
>> [...] Until the hardware is all in place, I can use my simple setup to develop my
>> edm panels, etc. Does anyone have advice, or preferably working examples,
>> of code that reads files from into ioc and the ioc writes the data to the database?
>>
> Hi Pierrick,
> You just want to have your records change in a given sequence to test
> your graphical user interfaces?
>
> Then don't do it on the IOC, use a shell script instead that reads the
> data from the file and write it with "caput".
> E.g. if you have the file format: <channel> <value> <delay> in your
> file, you could use the shell script:
>
> #!/bin/sh
> while true
> do
> read channel val delay
> if [ $? -ne 0 ]; then break ;fi
> caput $channel $val
> if [ $delay -gt 0 ] ;then sleep $delay;fi
> done
>
> If you name the script "fileput" and your data file "data" you call it
> "fileput <data".
> Of course you need to have the location of the binary of 'caput' in your
> PATH, it's part of EPICS base.
>
> Regards
> Andreas
>
> --
> Dr. Andreas Luedeke, SLS Operations Manager, Tel:+41-56-3104002
> [email protected], http://people.web.psi.ch/luedeke
>
>
- References:
- ioc reading data from files Pierrick Hanlet
- Re: ioc reading data from files Luedeke Andreas
- Navigate by Date:
- Prev:
Re: ioc reading data from files Dirk Zimoch
- Next:
Finding all the PVs on an IOC Carl Schumann
- 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
- Navigate by Thread:
- Prev:
Re: ioc reading data from files Luedeke Andreas
- Next:
Re: ioc reading data from files Dirk Zimoch
- 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
|