EPICS Controls Argonne National Laboratory

Experimental Physics and
Industrial Control System

1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  <20132014  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  <20132014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
<== Date ==> <== Thread ==>

Subject: RE: How to use calc with two PV to set an ao record on device?
From: Mark Rivers <[email protected]>
To: Benoit <[email protected]>, "[email protected]" <[email protected]>
Date: Fri, 8 Nov 2013 12:55:07 +0000
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  <20132014  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  <20132014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
ANJ, 20 Apr 2015 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·