Hey again,
I'm pretty close to having my magnet ramp code implemented but I need to know how to have a record access a user defined input during run time. For instance I want to turn a dial in MEDM to set the ramp point of the magnet. So far I've implemented a database as follows:
#Calc Coil Current
record(calc, "Current:Coil") {
field(DESC, "Coil Current")
field(SCAN, "Passive")
field(MDEL, ".1")
field(ADEL, ".1")
field(CALC, "LA + A*1/1200")
field(INPA, "$(MUX):VOLT:Chan204.VAL PP MS")
field(PINI, "NO")
field(EGU, "A")
field(SDIS, "0")
}
#Calc output and write to AG3631 Voltage programmer
record(calcout, "Voltage:Output") {
field(DESC, "Output Voltage")
field(SCAN, "1 second")
field(CALC, "Voltage:Output.VAL + (B - A)*.5/1")
field(INPA, "Current:Coil.VAL PP MS")
field(INPB, "Runtime Input") # How do I link to user input?
field(OOPT, "On Change")
field(DOPT, "CALC")
field(DTYP, "AG3631")
field(OUT, "#L$(L) $(A) @0")
field(PINI, "NO")
field(EGU, "V")
field(SDIS, "0")
}
How do I set the INPB to link to a runtime input? I've seen an example where a "dummy" AI record is linked, but I'm not sure if there is a better way. I would also like to put some protection logic in place. For instance, I would like to calculate a V_min and V_max (functions of Current:Coil) that Voltage:Output must be between in order for the OUT link to be processed. Are there any examples of how to implement this? The documentation doesn't really have any. Thanks again for your help.
Andrew
- Replies:
- Re: Runtime Input Question Tim Mooney
- Navigate by Date:
- Prev:
Re: Asyn and I/O intr scanning Eric Norum
- Next:
Re: Runtime Input Question Tim Mooney
- 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: Asyn and I/O intr scanning Eric Norum
- Next:
Re: Runtime Input Question Tim Mooney
- 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
|