Hello, Marty,
Thanks for the example. But even with that I don't manage to run it.
#include <iostream>
#include <getopt.h>
#include <epicsThread.h>
#include <epicsTime.h>
#include <epicsExit.h>
#include <iocsh.h>
#include <iostream>
#include <pv/pvaClient.h>
#include <pv/pvData.h>
using namespace std;
using namespace epics::pvaClient;
using namespace epics::pvData;
int iChunk(char *pvName)
{
PvaClientPtr pva= PvaClient::get("pva”);
try {
PvaClientChannelPtr channel = pva->channel(pvName);
PvaClientPutGetPtr putGet =
channel->createPutGet("putField(value)getField()");
putGet->connect();
PvaClientPutDataPtr putData = putGet->getPutData();
PVStructurePtr pvValue = putData->getPVStructure();
// CODE TO PUT ALL FIELDS IN value
putGet->putGet();
PvaClientGetDataPtr getData = putGet->getGetData();
cout << getData->getPVStructure() << endl
} catch (std::runtime_error e) {
cout << "exception " << e.what() << endl;
exit(1);
}
return 0;
}
int main(int argc,char *argv[])
{
epicsThreadId simpleId;
if(argc>=2) {
iocsh(argv[1]);
epicsThreadSleep(.2);
}
char pv[] = "CRYVISIL:STM:FASTSCAN:IMAGE_CHUNK";
simpleId = epicsThreadCreate("IChunkT", epicsThreadPriorityMedium,
epicsThreadGetStackSize(epicsThreadStackMedium),
(EPICSTHREADFUNC)iChunk, pv);
iocsh(NULL);
epicsExit(0);
return(0);
}
The “ putGet->connect();” raises an exception
exception channel CRYVISIL:STM:FASTSCAN:IMAGE_CHUNK
PvaClientPutGet::connect
PvaClientPutGet::channelPutGetConnect)
pvRequest
structure
structure getField
structure putField
structure value
error
Not Implemented
Error: epicsMutex::invalidMutex()
the PV is available
[junkes@dune iocmyEx]$ pvinfo CRYVISIL:STM:FASTSCAN:IMAGE_CHUNK
CRYVISIL:STM:FASTSCAN:IMAGE_CHUNK epics:nt/NTTable:1.0
string[] labels
structure value
double[] x
double[] y
double[] z
int[] time_index
string descriptor
alarm_t alarm
int severity
int status
string message
time_t timeStamp
long secondsPastEpoch
int nanoseconds
int userTag
int counter
Am I doing something wrong?
Danke, Heinz
------------------------------------------------------------------------------
Fritz-Haber-Institut | Phone: (+49 30) 8413-4270
Heinz Junkes | Fax (G3+G4): (+49 30) 8413-5900
Faradayweg 4-6 |
D - 14195 Berlin | E-Mail: [email protected]
------------------------------------------------------------------------------
On 12. Mar 2019, at 15:26, Marty Kraimer via Tech-talk
<[email protected]> wrote:
Using pvaClientCPP your code would be something like:
PvaClientChannelPtr channel =
pva->channel("CRYVISIL:STM:FASTSCAN:IMAGE_CHUNK");
PvaClientPutGetPtr putGet =
channel->createPutGet("putField(value)getField()");
putGet->connect();
PvaClientPutDataPtr putData = putGet->getPutData();
PVStructurePtr pvValue = putData->getPVStructure();
// CODE TO PUT ALL FIELDS IN value
putGet->putGet();
PvaClientGetDataPtr getData = putGet->getGetData();
cout << getData->getPVStructure() << endl;