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  <20182019  2020  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  <20182019  2020 
<== Date ==> <== Thread ==>

Subject: Waveform Runtime Database Access Error
From: Tobin R Weber <webert2@uw.edu>
To: tech-talk@aps.anl.gov
Date: Thu, 8 Feb 2018 15:44:21 -0800
Hello EPICS colleagues,

I have been using a state machine to call C functions that pass PV data to an MDSplus and PSQL database. I use "dbNameToAddr", "dbGetField" and "dbPutField" calls to move data. dbNameToAddr gets called every time I do a Get/Put. I'm also using waveform records to pass comment information that I want to be more then 40 characters, the stringout limit. I'm concerned I'm dong something with unexpected side effects, and I've seen one issue that has me seriously concerned.

Basically, with this record:

record(waveform, "PreShot") {
  field(NELM, "500")
  field(FTVL, "CHAR")
}

And this function,

static void thisDoesNOTWork() {

  long numRequestsWF = 500;
  long getOptions = 0;
  int getMon;
  struct dbAddr dbEntry = 0;
  char postShotComment[500];

  dbNameToAddr("PreShot", &dbEntry);
  dbGetField(&dbEntry, DBF_CHAR, postShotComment, &getOptions, &numRequestsWF, &getMon);

  return;
}

I get the following error after the "dbGetField()" call:

"Illegal Database Request Type PV: PreShot.VAL error detected in routine: dbGet: Request type is 1"

But, when I include a longout record,

record(waveform, "PreShot") {
  field(NELM, "500")
  field(FTVL, "CHAR")
}

record(longout, "ShotNumber") {
  field(VAL, "2")
  field(PINI, "YES")
  field(SCAN, "Passive")
  field(OMSL, "supervisory")
}

And add this database access to my function,

static void thisWorks() {

  long numRequestsWF = 500;
  long getOptions = 0;
  int getMon;
  struct dbAddr dbEntry;
  char postShotComment[500];
  long shotNumber = 0;
  long numRequests = 1;

  dbNameToAddr("ShotNumber.VAL", &dbEntry);
  dbGetField(&dbEntry, DBF_LONG, &shotNumber, &getOptions, &numRequests, &getMon);

  dbNameToAddr("PreShot", &dbEntry);
  dbGetField(&dbEntry, DBF_CHAR, postShotComment, &getOptions, &numRequestsWF, &getMon);

  return;
}


Everything works, and I get no error.

Does anyone see an issue with the run time database access in the first function call? Is there some part of the dbAddr struct that isn't getting set properly for the dbNameToAddr call to a Waveform record? In general, I'm also concerned about this type of run time database access. I'm doing it in many places. Is it okay to call dbNameToAddr multiple times? Can I use the same struct dbAddr for multiple dbNameToAddr calls?

Thank you very much for everyone's help and support. This is running a z-pinch machine at the University of Washington, and we are right in the middle of a run campaign. I don't know how we would have done all this without EPICS!

Toby




--
Tobin Weber
University of Washington
Department of Aeronautics and Astronautics
Research Scientist
206-221-7703

Replies:
Re: Waveform Runtime Database Access Error Ralph Lange

Navigate by Date:
Prev: RE: mca compilation fails on windows 7, keyword re-definition Gofron, Kazimierz
Next: Re: Waveform Runtime Database Access Error Ralph Lange
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  <20182019  2020 
Navigate by Thread:
Prev: Re: Data format using NDFileHDF5 steve.kinder
Next: Re: Waveform Runtime Database Access Error Ralph Lange
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  <20182019  2020 
ANJ, 14 Feb 2018 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·