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  2015  2016  <2017 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
<== Date ==> <== Thread ==>

Subject: RE: Question about PV operation that defined in ai.template.
From: Mark Rivers <rivers@cars.uchicago.edu>
To: lzf neu <lzfneu@live.com>, "tech-talk@aps.anl.gov" <tech-talk@aps.anl.gov>
Date: Fri, 24 Feb 2017 04:45:34 +0000
The problem is these lines:

  field (FLNK, "REMS-ARSM:Neutron:ChangeUnit001")
  field (FLNK, "REMS-ARSM:Neutron:ChangeUnit002")
  field (FLNK, "REMS-ARSM:Gamma:ChangeUnit003")

Each record only has a single FNLK field, you cannot repeat this line.  I think it will use the last FLNK line, so I suspect that REMS-ARSM:Gamma:ChangeUnit003 has processed, but REMS-ARSM:Gamma:ChangeUnit001 and REMS-ARSM:Gamma:ChangeUnit002 have not.

If you want to process all 3 records then you need to do this:

#====================ai.tempalte========================

# ai record template
record (ai, "$(P)-$(S):$(NAME)$(NUM)")
{
  field (DTYP, "lrpApp")
  field (INP,  "@Monitor:$(INDEX)/$(OFFSET) L=$(LENGTH)")
###
  field (FLNK, "REMS-ARSM:Neutron:ChangeUnit001")
###
  field (ASLO,"$(ASLO)")
  field (LINR, "LINEAR")
  field (SCAN, "I/O Intr")
  field (HIHI, "$(HIHI)")
  field (LOLO, "$(LOLO)")
  field (HIGH,"$(HIGH)")
  field (LOW,"$(LOW)")
}

record (calc, "REMS-ARSM:Neutron:ChangeUnit001")
{
        field(INPA, "REMS-ARSM:AlphaCountRate001.VAL")
        field(CALC, "A*0.1")
        field(EGU,  "uSv/h")
        field (FLNK, "REMS-ARSM:Neutron:ChangeUnit002")
}

record (calc, "REMS-ARSM:Neutron:ChangeUnit002")
{
        field(INPA, "REMS-ARSM:AlphaCountRate002.VAL")
        field(CALC, "A*0.1")
        field(EGU,  "uSv/h")
        field (FLNK, "REMS-ARSM:Gamma:ChangeUnit003")
}

record (calc, "REMS-ARSM:Gamma:ChangeUnit003")
{
        field(INPA, "REMS-ARSM:AlphaCountRate003.VAL")
        field(CALC, "A*0.1")
        field(EGU,  "uSv/h")
}

So each record has a forward link to the next record.

Mark

________________________________
From: tech-talk-bounces@aps.anl.gov [tech-talk-bounces@aps.anl.gov] on behalf of lzf neu [lzfneu@live.com]
Sent: Thursday, February 23, 2017 10:09 PM
To: tech-talk@aps.anl.gov
Subject: Question about PV operation that defined in ai.template.


Hi,


    I want to make an operation on part of PV that defined in ai.template. (namely:EMS-ARSM:Neutron:ChangeUnit001, EMS-ARSM:Neutron:ChangeUnit002,EMS-ARSM:Gamma:ChangeUnit001 )


    So, I add operation field in ai.template and also copy the file to Db folder and recompiled again.


    I have posted ai.template in the following lines:


#====================ai.tempalte========================

# ai record template
record (ai, "$(P)-$(S):$(NAME)$(NUM)")
{
  field (DTYP, "lrpApp")
  field (INP,  "@Monitor:$(INDEX)/$(OFFSET) L=$(LENGTH)")
###
  field (FLNK, "REMS-ARSM:Neutron:ChangeUnit001")
  field (FLNK, "REMS-ARSM:Neutron:ChangeUnit002")
  field (FLNK, "REMS-ARSM:Gamma:ChangeUnit003")
###
  field (ASLO,"$(ASLO)")
  field (LINR, "LINEAR")
  field (SCAN, "I/O Intr")
  field (HIHI, "$(HIHI)")
  field (LOLO, "$(LOLO)")
  field (HIGH,"$(HIGH)")
  field (LOW,"$(LOW)")
}

record (calc, "REMS-ARSM:Neutron:ChangeUnit001")
{
        field(INPA, "REMS-ARSM:AlphaCountRate001.VAL")
        field(CALC, "A*0.1")
        field(EGU,  "uSv/h")
}

record (calc, "REMS-ARSM:Neutron:ChangeUnit002")
{
        field(INPA, "REMS-ARSM:AlphaCountRate002.VAL")
        field(CALC, "A*0.1")
        field(EGU,  "uSv/h")
}

record (calc, "REMS-ARSM:Gamma:ChangeUnit003")
{
        field(INPA, "REMS-ARSM:AlphaCountRate003.VAL")
        field(CALC, "A*0.1")
        field(EGU,  "uSv/h")
}
#====================end of ai.tempalte=====================



here is the content of REMS_ARSM.substitutions (load "ai.template") file that used in st.cmd file to launch the IOC:

#=========================REMS_ARSM.substitutions================
file "db/ai.template" { pattern
{P,      S,       NAME,             NUM,    INDEX,      OFFSET,     LENGTH,      ASLO,     HIHI,             HIGH,               LOLO,         LOW}
{REMS, ARSM,     AlphaCountRate,    001,      21,        100,          5,        0.1,        50,              20,                 3,             0}
}
#====================end of REMS_ARSM.substitutions================




However, when started IOC I failed to do the operation and the result dislpayed in terminal:


epics> dbpr REMS-ARSM:Neutron:ChangeUnit001
A: 0                ASG:                B: 0                C: 0
CALC: A*0.1         D: 0                DESC:               DISA: 0
DISP: 0             DISV: 1             E: 0                F: 0
G: 0                H: 0                I: 0                J: 0
K: 0                L: 0                NAME: REMS-ARSM:Neutron:ChangeUnit001
SEVR: INVALID       STAT: UDF           TPRO: 0             VAL: 0


Could you give me some suggestions and thanks in advance !


Zhefu







References:
Question about PV operation that defined in ai.template. lzf neu

Navigate by Date:
Prev: Question about PV operation that defined in ai.template. lzf neu
Next: Re: memory leak after unloading of ca.lib Carsten Winkler
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
Navigate by Thread:
Prev: Question about PV operation that defined in ai.template. lzf neu
Next: streamDevice protocol - accept two different valid responses James.OHea
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
ANJ, 24 Feb 2017 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·