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

Subject: Problems using static database routines to modify IOCs
From: [email protected]
To: [email protected]
Date: Mon, 13 Apr 2015 18:15:18 -0500
Hello,

I am trying to use the dbDumpRecords example given in section 14.16.2 to
display a list of records and their fields at IOC initialization. I
included the example code as a function in the main.c code. Actually, the
main.c has also been modified and is now called iocMain.cpp. I am calling
the dbDumpRecords function using *iocshPpdbbase.

The example code I'm using,
****************************************************
void dbDumpRecords(DBBASE *pdbbase)
{
    DBENTRY  *pdbentry;
    long  status;

    pdbentry = dbAllocEntry(pdbbase);
    status = dbFirstRecordType(pdbentry);
    if(status) {printf("No record descriptions\n");return;}
    while(!status) {
        printf("record type: %s",dbGetRecordTypeName(pdbentry));
        status = dbFirstRecord(pdbentry);
        if(status) printf("  No Records\n");
        while(!status) {
            if (dbIsAlias(pdbentry)
                printf("\n  Alias:%s\n",dbGetRecordName(pdbentry));
            else {
                printf("\n  Record:%s\n",dbGetRecordName(pdbentry));
                status = dbFirstField(pdbentry,TRUE);
                    if(status) printf("    No Fields\n");
                while(!status) {
                    printf("    %s: %s",dbGetFieldName(pdbentry),
                        dbGetString(pdbentry));
                    status=dbNextField(pdbentry,TRUE);
                }
            }
            status = dbNextRecord(pdbentry);
        }
        status = dbNextRecordType(pdbentry);
    }
    printf("End of all Records\n");
    dbFreeEntry(pdbentry);
}
**************************************************
This modification is running on a 32 bit Windows 7 machine using EPICS
base 3.14.12.3. The compiler is MS Visual Studio 11.

The code solution compiles without any issues but when I try to run the
IOC it causes the following

Unhandled exception at 0x5C6F1C6E (dbStaticHost.dll) in tcIoc.exe:
0xC0000005: Access violation reading location 0x00000031.

I have also tried several of the other static database functions,
dbDumpRecord, dbDumpRecordType, dbDumpMenu, and I have discovered the
following.

I can use the static database functions to display the record type names,
the record names, and the record fields. But if I try to access the record
fields the IOC will crash. If I use the dbVerify function to test the
record field values I get a bunch of null and not valid output, for
example,

Record type: ai
   Record: test1
    DESC:  (null)
    ASG:  (null)
    SCAN:  Not a valid menu choice
    PINI:  Not a valid menu choice
    PHAS:  not an integer number

etc.

Also, the

void dbDumpRecord(DBBASE *pdbbase,char *precordTypeName,int level);

function fails with the same type of access violation when I have tried
using it. All functions that try to read the record fields fail. However,
if I comment out the offending function calls and start the IOC shell, I
can use dbDumpRecord(pdbbase) at the prompt and it succeeds.

I am a newbie at modifying IOCs so I'm not sure what could be going wrong
when trying to access the records fields. Any help is greatly appreciated.
If I can post any follow up info please let me know.

Thank you in advance,
Doug Lormand


Replies:
Re: Problems using static database routines to modify IOCs Dirk Zimoch

Navigate by Date:
Prev: Re: Stream device problem with redirection in @mismatch Dirk Zimoch
Next: Gentec S-link power meter problem with ending I/O interrupt measurement bohmm
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  <20152016  2017  2018  2019  2020  2021  2022  2023  2024 
Navigate by Thread:
Prev: Re: Micro-Epsilon capacitive sensor Steve Shoaf
Next: Re: Problems using static database routines to modify IOCs Dirk Zimoch
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  <20152016  2017  2018  2019  2020  2021  2022  2023  2024 
ANJ, 16 Dec 2015 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·