Below you say:
I would appreciate any help to overcome these basics steps.
Thanks in advance!
I have been working on some python code that uses PVRecords.
As part of this I needed a simple IOC that has PVRecords.
The code is available at
https://github.com/mrkraimer/testPython.git
The IOC code is in
testPython/database.
When the database is booted You will see
mrk> pwd
/home/epics7/modules/testPython/database/iocBoot/mandelbrotDatabase
mrk> ../../bin/linux-x86_64/mandelbrotDatabase st.cmd
< envPaths
...
epics> pvdbl
TPYaddRecord
TPYmandelbrotRecord
TPYremoveRecord
TPYtraceRecord
epics>
TPYaddRecord,TPYremoveRecord, and TPYtraceRecord are all supplied by pvDatabaseCPP
The code for TPYmandelbrotRecord is created in testPython/database/src.
testPython/database/iocSrc builds everything for starting an IOC..
This is a much simpler example than exampleCPP/database or NDPluginPVA from ADCore
There is a testPython/database/README.md but it just says:
This is part of a work in progress.
This needs documentation.
But I hope it helps.
Marty
On 4/27/20 10:36 AM, Joao Paulo Martins via Tech-talk wrote:
Hello Tech-Talk,
I’m trying to compile an IOC that has a single PV created using pvDatabase, pvData and pvAccess facilities. I’m using the “database” example in exampleCPP and also “NDPluginPVA.cpp” from ADCore as the models on how to do this task.
Basically I have an an EPICS shell function that will
has the following code:
PVDatabasePtr master = PVDatabase::getMaster();
string recordName = “my_record_name”;
NTScalarBuilderPtr ntScalarBuilder = NTScalar::createBuilder();
PVStructurePtr pvStructure = ntScalarBuilder->
value(pvInt)->
addAlarm()->
addTimeStamp()->
createPVStructure();
PVRecordPtr pvRecord = PVRecord::create(recordName,pvStructure);
bool result = master->addRecord(pvRecord);
The above code is include in the source of the support library built together with the IOC. The Makefile looks like this:
mySupport_LIBS += qsrv nt pvDatabase
mySupport_LIBS += $(EPICS_BASE_PVA_CORE_LIBS)
mySupport_LIBS += $(EPICS_BASE_IOC_LIBS)
I’ve also included the same libs for the IOC rules:
myIOC_LIBS += mySupport
myIOC_LIBS += qsrv nt pvDatabase
myIOC_LIBS += $(EPICS_BASE_PVA_CORE_LIBS)
myIOC_DBD += PVAServerRegister.dbd
myIOC_DBD += qsrv.dbd
However, when I compile the module, the linking process shows that there are two undefined references:
mySupport.so: undefined reference to `epics::pvDatabase::PVDatabase::addRecord(std::shared_ptr<epics::pvDatabase::PVRecord> const&)'
mySupport.so: undefined reference to `epics::pvDatabase::PVRecord::create(std::string const&, std::shared_ptr<epics::pvData::PVStructure> const&)'
I would appreciate any help to overcome these basics steps.
Thanks in advance!
______________________
Joao Paulo Martins
Control Systems Engineer
European Spallation Source ERIC