I have a question related to the in/out PVs used in an IOC .
Can I create a process variable which will have a callback to read data,
and a callback to write data?
Let's make, for example, we have an "ao" PV, which the IOC uses to write
the data into the hardware.
The database entry loaded in the IOC will be something like
record( stringout, "pVariable")
{
field( DESC, "this is an example process variable")
field( DTYP, "blabla Item")
field( OUT, "@pVariable");
}
This PV will be handled from the EPICS framework by calling the callback
"write_ao", every time a client writes the "1" value in it. So in the
"write_ao" function we'll provide the code necessary to write the data
into the hardware too. Well, if a client write the value "1" in
pVariable, the EPICS internal structure variable is up to date (the one
which is the formal parameter with "aoRecord*" type in the callback),
and the hardware has received the write command (both show the "1" value).
Then we connect a different standalone software (independent to EPICS)
to the hardware , and we change the pVariable to "2".
This variable is an "ao", so it has only one callback for write, the
"write_ao" callback, and there is no way to notify it the pVariable
value has been changed from the outside. So the pVariable value in the
hardware (and in the standalone software) is "2", but EPICS will show
"1", because no read have happened.
On the other side, if we had created an "ai" process variable, which has
the "read_ai" callback to read data, we have no "write_ao" callbacks to
write data, in fact is forbidden to write an input process variable.
So my question still remains the same: how to use a single process
variable, to both read and write, if I have only one callback, and I
need to read and write item values to the hardware, not only when I
write a new value.
Maybe I missed something in the EPICS documentation, but I really can't
find anything about this question anywhere.
So the only solution that came to my mind was to use two different PVs,
one for read and one for write, but it seems not to be the right one.
Thank you in advance,
Matteo
--
Ing. Matteo Pardi
CAEN SpA - R&D Software Division
Via Vetraia, 11 - 55049 Viareggio (LU)- ITALY
Tel. +39 0584 388 398 - Fax +39 0584 388 959
[email protected] - www.caen.it
----------------------------------------------
*****************************************************************************************************************************************************
The information contained in this transmission may contain privileged and confidential information and is intended only for the use of the person(s) named above. If you are not the intended recipient, or an employee or agent responsible for delivering this message to the intended recipient, any review, dissemination, distribution or duplication of this communication is strictly prohibited. If you are not the intended recipient, please contact the sender immediately and destroy all copies of the original message.
- Replies:
- RE: PV for both input AND output Mark Rivers
- Re: PV for both input AND output Andrew Johnson
- Re: PV for both input AND output Ralph Lange
- Navigate by Date:
- Prev:
Re: Sequencer Installation error Benjamin Franksen
- Next:
RE: PV for both input AND output Mark Rivers
- 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: garbage in zero length arrays Ralph Lange
- Next:
RE: PV for both input AND output Mark Rivers
- 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
|