Experimental Physics and
| |||||||||||||||
|
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
| ||||||||||||||
ANJ, 14 Feb 2018 |
·
Home
·
News
·
About
·
Base
·
Modules
·
Extensions
·
Distributions
·
Download
·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing · |