Hi Benoit,
I think I see 2 problems with your database. The main problem is that the calcout record will never process. Should add "CP" to the INPA and INPB links as follows.
record(calcout, "$(S):$(D)_$(C):RefminAmpCalc")
{
field(FLNK, "$(S):$(D)_$(C):RefminISet")
field(CALC, "A * COS(B)")
field(INPA, "$(S):$(D)_$(C):RefminAmpSet.VAL CP MS")
field(INPB, "$(S):$(D)_$(C):RefminPhasSet.VAL CP MS")
}
CP will cause this record to process if the AmpSet or PhasSet record values change.
The second problem is that I don't see how QSet will get processed. ISet gets processed by an FLNK from the calcout record. I suggest adding the following to ISet:
field(FLNK, "$(S):$(D)_$(C):RefminQSet")
That way after ISet processes then QSet will process.
Mark
________________________________
From: [email protected] [[email protected]] on behalf of Benoit [[email protected]]
Sent: Friday, November 08, 2013 4:05 AM
To: [email protected]
Subject: How to use calc with two PV to set an ao record on device?
Hi everybody,
I want to perform a simple operation but as I am still new on EPICS and I don't manage to do it.
On my device I use I,Q register to set up my DAC and I want for the user to modify Amplitude and Phase Process variable to setup these I,Q.
I would like to perform this transformation at database level so that my driver remains as simple as possible.
Actually I have this:
record(ao, "$(S):$(D)_$(C):RefminAmpSet")
{
field(DESC, "RefminAmp Temporary Set Record")
field(PINI, "YES")
field(VAL, "500")
}
record(ao, "$(S):$(D)_$(C):RefminPhasSet")
{
field(DESC, "RefminPhas Temporary Set Record")
field(PINI, "YES")
field(VAL, "0")
}
record(calcout, "$(S):$(D)_$(C):RefminAmpCalc")
{
field(FLNK, "$(S):$(D)_$(C):RefminISet")
field(CALC, "A * COS(B)")
field(INPA, "$(S):$(D)_$(C):RefminAmpSet.VAL")
field(INPB, "$(S):$(D)_$(C):RefminPhasSet.VAL")
}
record(ao, "$(S):$(D)_$(C):RefminISet")
{
field(DTYP, "asynFloat64")
field(OUT, "@asyn($(PORT),$(ADDR),$(TIMEOUT))refminI")
field(PINI, "YES")
field(VAL, "0")
field(PREC, "2")
}
record(ao, "$(S):$(D)_$(C):RefminQSet")
{
field(DTYP, "asynFloat64")
field(OUT, "@asyn($(PORT),$(ADDR),$(TIMEOUT))refminQ")
field(PINI, "YES")
field(VAL, "0")
field(PREC, "2")
}
What am I doing wrong?
I have seen many example on how to use calc to read ai records but not for setting ao records.
Regards,
--
Benoit RAT
- References:
- How to use calc with two PV to set an ao record on device? Benoit
- Navigate by Date:
- Prev:
RE: How to use calc with two PV to set an ao record on device? ronaldo.mercado
- Next:
BEAUTY Archiver and data from Area detector Vítek Michal
- 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: How to use calc with two PV to set an ao record on device? ronaldo.mercado
- Next:
BEAUTY Archiver and data from Area detector Vítek Michal
- 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
|