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

Subject: Re: question about aSubRecord
From: wantianmin <[email protected]>
To: Tim Mooney <[email protected]>, [email protected]
Date: Fri, 03 Dec 2010 19:54:23 +0800
Hi,Tim Mooney,
Thanks a lot for your help,
But when I try to use dbPutLink(aSubRecord* prec) to do my write operation, some compile error occurs.After I include all the include file need in aSubRecord.c ,the compiler complain about:


/usr/local/epics/base/include/dbFldTypes.h:26: error: expected identifier before numeric constant

I have tried for some time today but failed.It seems difficult to use dbPutLink() to solution my problem ,and by reading your mail and the aSubRecord.c file I know the output link may be writtten 2 times or more ,which is not expected. So I should use something others to do this , or this question may caused by some unclear design. Some complicated operation may should not be done in aSubRecord.

Thanks for your help ,
Best Regards
                                                                                                         wantianmin
                                                                                                          SSRF

ä 2010å12æ02æ 23:11, Tim Mooney åé:
wantianmin,

It's possible to overcome this, though it might not be a good idea,
depending on what link processing you have in mind.

If you look at the record's process() routine, in
base/src/rec/aSubRecord.c, you'll see what it's doing to execute
output links.  If you do this in your routine, you can cause both
input and output links to execute in any order you want.  If your routine
returns 0, however, the output links will all be executed again.  If your
routine returns other than 0 (no doubt this value was intended to signal
an error), the record will not execute the output links, but (currently)
this doesn't put the record into an alarm state, so the only side effect
will be that the record ends up with a nonzero VAL field.

     Maybe there should be a return value that calls for no output link
     processing but that doesn't also indicate an error.

If you plan an extended series of (write, read, decide, write, read, ...),
or if any of the records you write to are asynchronous, and you wait for
the result of their processing, your record is not going to play well with
other records that are executed by the same task. (For example, if your
record is periodically scanned, all the other records scanned with the same
period will be forced to wait for your record to finish before they will be
processed.)

It might be that your purpose would be better served by an SNL program.

Tim Mooney

----- Original Message -----
From: "wantianmin"<[email protected]>
To: [email protected]
Sent: Wednesday, December 1, 2010 8:55:28 PM
Subject: question about aSubRecord

Hi ,all:
When I use aSubRecord record to do some process, It was found that write
operation is not being done until myAsubProcess() finish.Is there some
way to overcome it?
here is a description of my situation:
db:
record(aSub,"asub")
{
field(INAM,"myAsubInit")
field(SNAM,"myAsubProcess")
field(FTA,"DOUBLE")
field(NOA,"1")
field(INPA,"test4 CA")
field(FTVA,"DOUBLE")
field(NOVA,"1")
field(OUTA,"test1 CA")
field(FTVB,"DOUBLE")
field(NOVB,"1")
field(OUTB,"test2 CA ")
}
dbSubExample.cpp:
static long myAsubProcess(aSubRecord *precord)
{
if (mySubDebug)
printf("Record %s called myAsubProcess(%p)\n",
precord->name, (void*) precord);
printf(" begin process\n");
double* p1=(double*)precord->vala;
p1[0]=20;
printf(" write vala 1 to 20 complete....\n");

double* p2=(double*)precord->a;
printf(" read from a :%lf\n complete",p2);


printf(" end process\n"); return 0; }

I found that When I doing dbpf asub.PROC 1 in iocshell,
the first output value (test1) is not changed until the process finished.
but in some application ,I need to write some pv and read it again to
decide what is need to do next.
Is there some suggestions?
Thanks a lot
Best Regards
wantianmin
SSRF




References:
Re: question about aSubRecord Tim Mooney

Navigate by Date:
Prev: Re: New StreamDevice version Dirk Zimoch
Next: Re: Build EPICS Base3.14.9 on Windows Shen, Guobao
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  <20102011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
Navigate by Thread:
Prev: Re: question about aSubRecord Tim Mooney
Next: Asyn VXI-11 Driver and VXI-11 Locking William Lu
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  <20102011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
ANJ, 03 Dec 2010 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·