1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 <2018> 2019 2020 2021 2022 2023 2024 2025 | 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 <2018> 2019 2020 2021 2022 2023 2024 2025 |
<== Date ==> | <== Thread ==> |
---|
Subject: | Re: Waveform Runtime Database Access Error |
From: | Ralph Lange <[email protected]> |
To: | EPICS Tech Talk <[email protected]> |
Cc: | Tobin R Weber <[email protected]> |
Date: | Fri, 9 Feb 2018 09:03:46 +0100 |
The pfl argument is for use by the Channel Access monitor routines. All other users must pass in NULL.
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 WeberUniversity of WashingtonDepartment of Aeronautics and AstronauticsResearch Scientist