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  <20092010  2011  2012  2013  2014  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  <20092010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
<== Date ==> <== Thread ==>

Subject: Re: sub routine record doesn't get value via INPD
From: Matthieu Bec <[email protected]>
To: "Dr. Peter Zumbruch" <[email protected]>
Cc: Epics Questions <[email protected]>
Date: Mon, 13 Jul 2009 20:40:59 -0400

doubles need %lf to printf.
Could that be your problem ??

#include <stdio.h>
int main (int argc, char *argv[]) {
   double f=200.;
   float *pf = (float*)&f;
   printf ("%f\n",*pf);
   printf ("%lf\n",*(double*)pf);
   return 0;
}

./a.out
0.000000
200.000000




On 07/13/09 19:46, Allison, Stephanie wrote:
Hi Andy,

Peter didn't provide the full dbpr of the AO record (unfortunate) but assuming he has ESLO=1.0 (default), because he's using raw soft support and he has LINR set to LINEAR, RVAL is getting set to 200.

I tested his database on 3.14.8.2 (setting the sub to a calc) and saw D set to 200 as it should be.  I wonder if his subroutine function is doing something bad like overwriting some record fields.

Stephanie Allison

-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf
Of Andy Foster
Sent: Monday, July 13, 2009 4:35 PM
To: Dr. Peter Zumbruch
Cc: Epics Questions
Subject: Re: sub routine record doesn't get value via INPD


Hi Peter,

The "dbpf HAD:RPC:S1:M0:C9:ToTL 200" is putting 200 into
the VAL field of the AO record: "HAD:RPC:S1:M0:C9:ToTL"
rather than the RVAL field. Thus, the RVAL field remains at 0.0.

The OUT link from the AO record gets processed as a result of
writing to the AO record:

field(OUT, "HAD:RPC:S1:M0:C9:stToTL")

This link causes the "200" to be placed in the VAL field of
the sub record: "HAD:RPC:S1:M0:C9:stToTL".

The sub record INPD field is looking at the RVAL field of
the AO field which is still at 0.0.

Cheers,

Andy



On Mon, 13 Jul 2009, Dr. Peter Zumbruch wrote:

Hi all,
I have the following problem (EPICS 3.14.10 / Debian 4.0)
with this tiny database (minimized to my problem) .
Why don't I see the Value/Raw Value of "HAD:RPC:S1:M0:C9:ToTL" at the
input D of the sub record "HAD:RPC:S1:M0:C9:stToTL", which I try to
access at c-code.

1) The ingredients:
record(ao, HAD:RPC:S1:M0:C9:ToTL) {
   field(DESC, "0 0 0 2")
   field(DTYP, "Raw Soft Channel")
   field(FLNK, "HAD:RPC:S1:M0:C9:stToTL")
   field(OUT, "HAD:RPC:S1:M0:C9:stToTL")
   field(EOFF, "0")
   field(LOPR, "0")
   field(HOPR, "199")
   field(DRVH, "250")
   field(DRVL, "0")
   field(LINR, "LINEAR")
   field(OMSL, "supervisory")
}

record(sub, HAD:RPC:S1:M0:C9:stToTL) {
   field(DESC, "store 0 0 0 2")
   field(INAM, "mySubInit")
   field(SNAM, "myStoreFcn")
   field(INPA, "0")
   field(INPB, "0")
   field(INPC, "2")
   field(INPD, "HAD:RPC:S1:M0:C9:ToTL.RVAL")
   field(INPE, "0")
}
The referenced C-Code:
static long myStoreFcn(subRecord *precord)
{
   ...
   short thr;
   ...
   thr = precord->d;
   ...

   printf( "Record %s called myStoreFcn(%p), thr %d, precord->d %f\n",
            precord->name, (void*) precord, thr, precord->d);
   ...
   return(0);
}
...
epicsRegisterFunction(myStoreFcn);
...
2.) The test: (caput / dbpf)

epics>  dbgf HAD:RPC:S1:M0:C9:ToTL
DBR_DOUBLE:         0

epics>  dbpf HAD:RPC:S1:M0:C9:ToTL 200
Record HAD:RPC:S1:M0:C9:stToTL called myStoreFcn(0x80577b0), thr 0,
precord->d 0.000000
DBR_DOUBLE:         200

epics>dbpr HAD:RPC:S1:M0:C9:stToTL
A: 0                ASG:                B: 0                C: 2
D: 0                DESC: store 0 0 0 2 DISA: 0             DISP: 0
DISV: 1             E: 0                F: 0                G: 0
H: 0                I: 0                J: 0                K: 0
L: 0                NAME: HAD:RPC:S1:M0:C9:stToTL           SEVR: NO_ALARM
STAT: NO_ALARM      TPRO: 0             VAL: 200
3. ) The (stupid) question: Why don't I get the value of
HAD:RPC:S1:M0:C9:ToTL at D? At VAL I see it.

Thanks  for any explanation.

Peter

--
  Dr. rer. nat. Peter W. Zumbruch
  EE - department / Controls group / GSI
  E-Mail: P.Zumbruch_at_gsi.de
  Tel: +49-(6159)-71-1435 / Fax: +49-(6159)-71-2986

  GSI Helmholtzzentrum für Schwerionenforschung GmbH
  Planckstraße 1 / D-64291 Darmstadt / www.gsi.de

  Gesellschaft mit beschränkter Haftung
  Sitz der Gesellschaft: Darmstadt
  Handelsregister: Amtsgericht Darmstadt, HRB 1528

  Geschäftsführung: Professor Dr. Horst Stöcker, Christiane Neumann
  Vorsitzende des Aufsichtsrates: Dr. Beatrix Vierkorn-Rudolph,
  Stellvertreter: Ministerialdirigent Dr. Rolf Bernhardt








--
Matthieu Bec              Gemini Observatory
Tel: +56 51 205785        c/o AURA, Casilla 603
Fax: +56 51 205650        La Serena, Chile

Replies:
Re: sub routine record doesn't get value via INPD Matthieu Bec
References:
sub routine record doesn't get value via INPD Dr. Peter Zumbruch
Re: sub routine record doesn't get value via INPD Andy Foster
RE: sub routine record doesn't get value via INPD Allison, Stephanie

Navigate by Date:
Prev: RE: sub routine record doesn't get value via INPD Allison, Stephanie
Next: Re: sub routine record doesn't get value via INPD Matthieu Bec
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  <20092010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
Navigate by Thread:
Prev: RE: sub routine record doesn't get value via INPD Allison, Stephanie
Next: Re: sub routine record doesn't get value via INPD Matthieu Bec
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  <20092010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
ANJ, 31 Jan 2014 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·