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  2013  2014  <20152016  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  <20152016  2017  2018  2019  2020  2021  2022  2023  2024 
<== Date ==> <== Thread ==>

Subject: Re: AW: Records for slow control
From: Ralph Lange <[email protected]>
To: EPICS Tech-Talk <[email protected]>
Date: Fri, 28 Aug 2015 17:30:41 +0200
Hi info22,

I would still say that you are trying to reimplement the OROC behavior in your calcout record, which is overly complicated.
Here's the real life solution that I have been using in many places for this "auto-ramp" feature.

record (ao, "set") {
  field(OROC, "0.1")
}

record (calcout, "calc") {
  field(INPA, "set CP")
  field(INPB, "set.OVAL CP")
  field(CALC, "A!=B?6:0")
  field(OOPT, "On Change")
  field(OUT,  "set.SCAN")
}

The "set" record *is* the one that is connected to the hardware, i.e. has a real DTYP pointing to the driver, and an OUT link with the configuration.
Its OROC is set to the step value for the ramp.
The two numbers in the CALC are the SCAN periods (index in the scan menu) for passive (0) and "1 second" (6), OOPT makes sure the "set" SCAN is not changed more often than necessary.

In the stable situation no record is processing.
When "set" is changed, the "calc" detects it and changes the SCAN rate of "set" to "1 second" to start ramping with OROC steps.
When the ramp is finished, the "calc" switches the SCAN rate of "set" back to "Passive".

Cheers,
~Ralph


On 28/08/2015 15:38, [email protected] wrote:
Hello, 

it works but if I use the OUT field in the Calc record  I have a problem.

record(ao, "SetVolt") {

field(DESC, "VoltOut")
field(EGU, "V")‎
}



record(calcout, "Calc") {
field(DESC, "Counter")
field(SCAN, "1 second")
field(CALC, "A:=(C<(A-B)&&C!=D)?(A-B):((A+B)>C?C:A+B);A")
field(INPA, "0")
field(INPB, "1")
field(INPC, "SetVolt")
field(OUT, "writeOut PP")
}


The record writeOut has a field OUT = proto writeout... device and works if I set a value. But if I use this record with the calc record I have a problem.


After starting the ioc the LED-value is wrong and jumps between a and c. ‎But in the Shell the value is stop from increasing.




Von: Mooney, Tim M.
Gesendet: Donnerstag, 27. August 2015 19:32‎
An: [email protected]; EPICS Tech-Talk
Betreff: RE: Records for slow control

You don't actually have to stop the calc record.  You could just stop the value from increasing.
The following _expression_ holds the increasing value in the 'a' field, and increases it by 'b' until
it reaches 'c'.  Then it returns the value of 'a' as the _expression_ result.
a:=((a+b)>c?c:a+b); a

Tim Mooney ([email protected]) (630)252-5417
Beamline Controls Group (www.aps.anl.gov)
Advanced Photon Source, Argonne National Lab


From: [email protected] [[email protected]] on behalf of [email protected] [[email protected]]
Sent: Thursday, August 27, 2015 12:16 PM
To: EPICS Tech-Talk
Subject: AW: Records for slow control


Hello,
and how can I stop a calc record?

I want to set a new value like 100, 200, 300 V.... then I want to compare this value with the current value and increase or decrease this value every 10 seconds in 5V-steps. ‎Maybe someone have an idea. One problem is to stop the calc record if current value = new value.


Thanks.
Von: Mooney, Tim M.
Gesendet: Mittwoch, 26. August 2015 17:20
An: [email protected]; EPICS Tech-Talk
Betreff: RE: Records for slow control

There are two databases in the synApps std module that demonstrate different ways of doing this with EPICS records:

std/stdApp/Db/timer.*
std/stdApp/op/adl/timer.*

std/stdApp/Db/countDownTmer.*
std/stdApp/op/adl/countDownTimer.*


Tim Mooney ([email protected]) (630)252-5417
Beamline Controls Group (www.aps.anl.gov)
Advanced Photon Source, Argonne National Lab


From: [email protected] [[email protected]] on behalf of [email protected] [[email protected]]
Sent: Wednesday, August 26, 2015 5:09 AM
To: EPICS Tech-Talk
Subject: AW: Records for slow control


Hello,
but I want to increase the value for example every hour. The time have to be variable so I need a calcout timer to count for example every 10 second from 0 to ‎50 and then to increase the value step by step. My problem is how to realise  this with two records. One have to increase +1, then go to the timer record and wait for example one hour set value and again: increase +1, then process timer or counter for slowly periodic scan, set value. 


Thanks.
Von: Ralph Lange
Gesendet: Mittwoch, 26. August 2015 11:58
An: EPICS Tech-Talk
Betreff: Re: Records for slow control

On 26/08/2015 11:39, [email protected] wrote:

Hello,
I want to set a value like 200 ampere and increase the current value slowly but how? 

I have a timer-record with a PROC field with the option "transition to zero". A second record increase the value every time. Is it possible to create records like this: 

• Calcout1 timer: scan every second from 1 to 10
• -» then process Calcout2 (via PROC field, without SCAN field) from 1 to 3
• Calcout2 have to wait, process Calcout1 again...


In the ao record that is setting your value, set the field SCAN to "1 second" (or how often you want to "slowly" update) and the field OROC to the step size that you want to the value to change every time (e.g. 0.1).
No other records needed.

Now, when you write a value like 200 to that record, the output will step up by 0.1 every second. (Or whatever step size and update rate you configured.)

Hope this helps,
~Ralph








References:
Re: Records for slow control info22
Re: Records for slow control Ralph Lange
AW: Records for slow control info22
RE: Records for slow control Mooney, Tim M.
AW: Records for slow control info22
RE: Records for slow control Mooney, Tim M.
AW: Records for slow control info22

Navigate by Date:
Prev: Re: Virtual Circuit Disconnect Warning Andrew Johnson
Next: Re: seq-2.1.12 and C++ Benjamin Franksen
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  <20152016  2017  2018  2019  2020  2021  2022  2023  2024 
Navigate by Thread:
Prev: AW: Records for slow control info22
Next: eclipse error when compile the css source l123173
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  <20152016  2017  2018  2019  2020  2021  2022  2023  2024 
ANJ, 16 Dec 2015 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·