Closed dcrisp2 closed 5 years ago
Does your dbd/$(IOC).dbd
contain the line registrar(pySetupReg)
?
grep 'registrar(pySetupReg)' ${TOP}/dbd/${IOC}.dbd
A quick way to check if your generated .dbd includes a particular piece, and that there isn't some Makefile typo, is to check that the contents of the piece is present. In this case, pyDevSup.dbd contains registrar(pySetupReg)
which is what should do the work of registering the py()
ioc shell function.
I'd actually already grepped for pySetupReg, after realizing you mentioned it in the first line of your documentation on environment. The line 'registrar(pySetupReg)' is indeed in my ${IOC}.dbd. Other suggestions?
Can I see your st.cmd script? Also the output of help
, which will list the registered commands. FYI. there is some ordering restriction. Most commands only become available after the *_registerRecordDeviceDriver pdbbase
line.
Sure thing. You'll see that I have a few attempts at using python in there. Please forgive my poor comment formatting.
In the meantime, your note about ordering makes a lot of sense, I'll try moving the commands to AFTER the '*_registerRecordDeviceDriverp(dbbase)' line.
`#!../../bin/linux-x86_64/secar-sync
< envPaths
epicsEnvSet("EPICS_CA_AUTO_ADDR_LIST","YES") epicsEnvSet("ENGINEER", "crispd") epicsEnvSet("LOCATION", "rea-hlapps")
epicsEnvSet("IOCNAME", "${IOC}") epicsEnvSet("AS_PATH", "${TOP}/as/${IOC}")
/usr/bin/python -c 'import logging; logging.basicConfig(level=logging.DEBUG)' py "import logging" py "logging.basicConfig(level=logging.DEBUG)" py("import logging") py("logging.basicConfig(level=logging.DEBUG)")
dbLoadDatabase("${TOP}/dbd/secar-sync.dbd",0,0) secar_sync_registerRecordDeviceDriver(pdbbase)
dbLoadTemplate "syncdevs.substitutions" dbLoadRecords("${TOP}/db/secar.db")
dbLoadRecords("${EPICS_BASE}/db/save_restoreStatus.db", "P=${IOC}:") dbLoadRecords("${EPICS_BASE}/db/iocAdminScanMon.db", "IOC=${IOC}") dbLoadRecords("${EPICS_BASE}/db/iocAdminSoft.db", "IOC=${IOC}") dbLoadRecords("${EPICS_BASE}/db/softIocExit.db", "IOC=${IOC}")
save_restoreSet_Debug(0) save_restoreSet_IncompleteSetsOk(1) save_restoreSet_DatedBackupFiles(1)
set_savefile_path("${AS_PATH}") set_requestfile_path("${AS_PATH}") set_requestfile_path("${EPICS_BASE}/as/req")
set_pass0_restoreFile("info_positions.sav") set_pass0_restoreFile("info_settings.sav") set_pass1_restoreFile("info_settings.sav")
iocInit() iocLogInit()
system('date')
system "test -d ${AS_PATH} || mkdir -p ${AS_PATH}" makeAutosaveFileFromDbInfo("${AS_PATH}/info_positions.req", "autosaveFields_pass0") makeAutosaveFileFromDbInfo("${AS_PATH}/info_settings.req", "autosaveFields") create_monitor_set("info_positions.req", 5 , "") create_monitor_set("info_settings.req", 15 , "") create_monitor_set("ioc_stats_settings.req", 15 , "IOC=${IOC}") `
You were absolutely right, I just had to move the python commands to AFTER I load my ioc.dbd, and registerRecordDeviceDriver(pdbbase).
Ok, no problem.
Hello there! So we have pydevsup packaged, and generally it's working fine. But it seems that the py() functions aren't getting registered in the st.cmd, as the IOCshell can't find them. What can I do to fix this? I'm trying to make some edits to my syncCalc.py file, and would enjoy some python logging from the iocshell.
As is, we have an IOC made with iocBoot and ${IOC}App directories. pyDevSup is pulled into the ioc with the ${IOC}App/src/Makefile line: ${IOC}_DBD += pyDevSup.dbd. So instead of pointing to softIocPy2.7, the st.cmd is pointing to the relevant ${TOP}/dbd/${IOC}.dbd.
Is this the wrong way to go about it?
I have tried not using an app folder at all, and having my st.cmd use /usr/bin/softIocPy2.7, but it spit out errors about not finding files from what looked like core support packages. If I can help it, for now at least, I'd like to avoid getting lost in fixes to our pydevsup packaging.