hi, Peter:
Although other gives other solution. I want to try your ways too. but when I paste your code in db file. the result does not change as we expect (still change from 0-9, then 0-9).
I think if we don't use .LA field, the only way is using two calc record. but why it can't work?
======= At 2008-11-20, 22:39:12 you wrote: =======
>Full Example- changes to your original in bold:
>
>record(ai, "$(user):aiExample")
>{
>field(DESC, "Analog input")
>field(INP, "$(user):calcExample.VAL NPP NMS")
>field(EGUF, "10")
>field(EGU, "Counts")
>field(HOPR, "10")
>field(LOPR, "0")
>field(HIHI, "8")
>field(HIGH, "6")
>field(LOW, "4")
>field(LOLO, "2")
>field(HHSV, "MAJOR")
>field(HSV, "MINOR")
>field(LSV, "MINOR")
>field(LLSV, "MAJOR")
>}
>record(calc, "$(user):calcExample")
>{
>field(DESC, "Counter")
>field(SCAN,"1 second")
>field(FLNK, "$(user):aiExample")
>field(CALC, "(A<B)?(A+C):D")
>field(INPA, "$(user):calcExample.VAL NPP NMS")
>field(INPB, "9")
>field(INPC, "$(user):incrExample PP")
>field(INPD, "0")
>field(EGU, "Counts")
>field(HOPR, "10")
>field(HIHI, "8")
>field(HIGH, "6")
>field(LOW, "4")
>field(LOLO, "2")
>field(HHSV, "MAJOR")
>field(HSV, "MINOR")
>field(LSV, "MINOR")
>field(LLSV, "MAJOR")
>}
>record (calc, "$(user):incrExample")
>{
>field(VAL, "1")
>field(FLNK, "$(user):aiExample")
>field(CALC, "(A<=0)?1:((A>=9)?-1:B)")
>field(INPA, "$(user):aiExample.VAL")
>field(INPB, "$(user):incrExample.VAL")
>}
>
>I can't think of a way to do it with one calc record as you need some place to store
>whether you are going up or down.
>
>Pete
>
>
>
>-----Original Message-----
>From: marco_hair [mailto:[email protected]]
>Sent: 20 November 2008 14:08
>To: Owens, PH (Peter)
>Subject: Re:RE: A db question about aiExample
>
>
>hi, Peter:
>
> Would you give me detailed db? I am still confuse about that. Ps, is it possible to use just one calc record. for example: use INPA to get calc itself's value, INPB to get ai's value, then judge if it's in increase procedure or decrease procedure?
> Thanks a lot in advance.
>
>
>在2008-11-20,"Owens, PH (Peter)" <[email protected]> 写道:
>
>Use a third record to calculate the increment:
>
>Set
>$(user):calcExample.INPC = $(user):incrExample PP
>...
>record calc, "$(user):calcExample")
>{
>field(VAL, "1")
>field(FLNK, "$(user):aiExample")
>field(CALC, "(A<=0)?1:((A>=9)?-1:B)")
>field(INPA, "$(user):aiExample.VAL")
>field(INPB, "$(user):incrExample.VAL")
>}
>
>-----Original Message-----
>From: [email protected] [mailto:[email protected]]On Behalf Of marco_hair
>Sent: 20 November 2008 10:57
>To: tech-talk
>Subject: A db question about aiExample
>
>
>Dear all:
>
> in the aiExample.db coming with soft ioc template,
>record(ai, "$(user):aiExample")
>{
>field(DESC, "Analog input")
>field(INP, "$(user):calcExample.VAL NPP NMS")
>field(EGUF, "10")
>field(EGU, "Counts")
>field(HOPR, "10")
>field(LOPR, "0")
>field(HIHI, "8")
>field(HIGH, "6")
>field(LOW, "4")
>field(LOLO, "2")
>field(HHSV, "MAJOR")
>field(HSV, "MINOR")
>field(LSV, "MINOR")
>field(LLSV, "MAJOR")
>}
>record(calc, "$(user):calcExample")
>{
>field(DESC, "Counter")
>field(SCAN,"1 second")
>field(FLNK, "$(user):aiExample")
>field(CALC, "(A<B)?(A+C):D")
>field(INPA, "$(user):calcExample.VAL NPP NMS")
>field(INPB, "9")
>field(INPC, "1")
>field(INPD, "0")
>field(EGU, "Counts")
>field(HOPR, "10")
>field(HIHI, "8")
>field(HIGH, "6")
>field(LOW, "4")
>field(LOLO, "2")
>field(HHSV, "MAJOR")
>field(HSV, "MINOR")
>field(LSV, "MINOR")
>field(LLSV, "MAJOR")
>}
>the ai value will change from 0-9 and then loop from 0 again.
>if I want to generate the value from 0-9, then decrease it, such as 9-0. That is, the value increase from 0-9, then decrease from 9-0 one by one, how can I written it?
>Thanks a lot for your help.
>
>Best wishes
>Geyang 2008/11/20
>
>
>
>[广告] 金秋最关注楼盘-房不胜房
>
>
> _____
>
>[广告] 金秋最 关注楼盘-房不胜房 <http://popme.163.com/link/003985_1010_7027.html>
= = = = = = = = = = = = = = = = = = = =
Best regards
Geyang 2008-11-23
- Navigate by Date:
- Prev:
Re: Re: A db question about aiExample Silver
- Next:
Re: CAEN V965 driver Kate Feng
- 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: Re: A db question about aiExample Silver
- Next:
archiveviewer - Error in data header Devin Bougie
- 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
|