Argonne National Laboratory

Experimental Physics and
Industrial Control System

2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  <2017 Index 2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  <2017
<== Date ==> <== Thread ==>

Subject: Re: Improved simulation mode prototype
From: Andrew Johnson <anj@aps.anl.gov>
To: <core-talk@aps.anl.gov>
Date: Fri, 15 Sep 2017 13:56:13 -0500
Hi Ralph,

On 09/15/2017 10:22 AM, Ralph Lange wrote:
> The improved simulation prototype has been extended to support all 21
> simulation capable record types in Base; extensive tests for simulation
> mode have been added.
> 
>  https://github.com/ralphlange/epics-base/tree/improve-sim-mode
> <https://github.com/ralphlange/epics-base/tree/improve-sim-mode> 
> 
> This is a good moment to test, report issues etc.
> Next steps: add a few more tests, squash/reorder commits and push to
> LaunchPad as a merge proposal.

I still have a fundamental dislike of using info items to configure
simulations, because these settings can't be modified at runtime, and
because of all the extra code needed for parsing the info string values.
I discussed this with you in a private email reply on August 18th ("Re:
Q: Access to into fields") but you didn't respond.

Did you look at making the two info items into fields instead? I don't
like all the extra complexity involved in using a combination of info
items and members of simpvt for storing state that you are doing. I
would like to see a comparison of the two approaches, as I'm not
convinced that the extra code complexity is worth the memory saved by
not using regular fields.


At least one change in recGbl.c seems to be undoing a link support
change (explicitly testing a plink->type value should be avoided in new
code to be compatible with new link types):

> -    if (!dbLinkIsConstant(plink)) {
> +    if (plink->type != CONSTANT) {
>          struct pv_link *ppv_link = &plink->value.pv_link;

However it looks like the line immediately following the changed one
hasn't been properly converted for link support anyway (it could crash
if someone makes TSEL a JSON link type). There are other similar tests
of plink->type fields which should be using the dbLink*() equivalent
routine in recGblGetTimeStampSimm() and recGblInitSimm().

Does the SIMPVT field always point to a struct xsimm? If so the extra()
line in the .dbd files should define it as such instead of as a void *
(I've been trying to remove void * pointer casts by introducing those
kinds of changes for several years now).

I'm getting a build failure on cross-building for MinGW (and this will
probably fail likewise on other Windows DLL builds) which doesn't occur
on the master branch:

> iocInit.obj:iocInit.c:(.text+0x198): undefined reference to `__imp_callbackInit'
> iocInit.obj:iocInit.c:(.text+0xefa): undefined reference to `__imp_callbackStop'
> iocInit.obj:iocInit.c:(.text+0xf0a): undefined reference to `__imp_callbackCleanup'
> collect2: error: ld returned 1 exit status
> ../../../configure/RULES_BUILD:288: recipe for target 'dbCore.dll' failed
> make[1]: *** [dbCore.dll] Error 1

This is triggered by the new inclusion of callback.h in recSup.h but the
fundamental problem is in src/ioc/misc/iocInit.c where dbBase.h is being
included before epicsExport.h (as well as after it, so just delete the
first copy to fix this problem).

My RTEMS build fails in src/std/rec/test:

> epicsRunRecordTests.o: In function `epicsRunRecordTests':
> /local/anj/base-3.16/src/std/rec/test/O.RTEMS-uC5282/../epicsRunRecordTests.c:45: undefined reference to `simmTest'

The rec/test/Makefile is missing these two lines:

testHarness_SRCS += simmTest.c
testHarness_SRCS += simmTest_registerRecordDeviceDriver.cpp

I'm guessing you copied the regressTest example immediately above, which
is also missing those two equivalent lines and a call from the
epicsRunRecordTests.c file.

I think that's all for now, I haven't actually looked at or tested the
simulations at all.

- Andrew


> On Thu, Aug 24, 2017 at 5:32 PM, Ralph Lange <ralph.lange@gmx.de
> <mailto:ralph.lange@gmx.de>> wrote:
> 
>     Dear Core-Talkers,
> 
>     I have been working on improving the simulation mode to avoid the
>     issues tat were mentioned in a recent thread
>     <http://www.aps.anl.gov/epics/core-talk/2017/msg00458.php> here on
>     core-talk.
> 
>     The prototype is
>     at https://github.com/ralphlange/epics-base/tree/improve-sim-mode
>     <https://github.com/ralphlange/epics-base/tree/improve-sim-mode> -
>     please have a look and take it for a test drive.
> 
>     There are six record types supported in this prototype: ai, ao, bi,
>     bo, mbbi and mbbo.
>     Configuration is through two types of info items that can be added
>     to record instances:
> 
>       info(simm:SCAN,".2 second")
> 
>     will set a record's SCAN to the specified value during simulation mode.
> 
>       info(simm:DELAY,"0.6")
> 
>     will process the record asynchronously using the specified delay
>     [sec] during simulation mode.
> 
>     During simulation mode, records with TSE=-2 (time stamp from device)
>     will use the time stamp of the source record when fetching a value
>     through SIOL, the current IOC time otherwise.
> 
>     Please report any issues, comments etc.
>     My next steps will be adding tests and extending the changes to all
>     record types that support simulation mode.
> 
>     Thanks for your help,
>     ~Ralph

-- 
Arguing for surveillance because you have nothing to hide is no
different than making the claim, "I don't care about freedom of
speech because I have nothing to say." -- Edward Snowdon

Replies:
Re: Improved simulation mode prototype Ralph Lange
References:
Improved simulation mode prototype Ralph Lange
Re: Improved simulation mode prototype Ralph Lange

Navigate by Date:
Prev: Re: Improved simulation mode prototype Ralph Lange
Next: Re: Improved simulation mode prototype Ralph Lange
Index: 2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  <2017
Navigate by Thread:
Prev: Re: Improved simulation mode prototype Ralph Lange
Next: Re: Improved simulation mode prototype Ralph Lange
Index: 2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  <2017
ANJ, 15 Sep 2017 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·