Argonne National Laboratory

Experimental Physics and
Industrial Control System

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  <20192020  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  <20192020 
<== Date ==> <== Thread ==>

Subject: Re: I'm looking for a pvacces example to read PVStructure
From: Heinz Junkes via Tech-talk <tech-talk@aps.anl.gov>
To: Marty Kraimer <mrkraimer@comcast.net>
Cc: tech-talk@aps.anl.gov
Date: Thu, 14 Mar 2019 11:29:38 +0100
With the debug-option it shows:

 PvaClientChannel::PvaClientChannel channelName CRYVISIL:STM:FASTSCAN:IMAGE_CHUNK
PvaClientChannel::connect channelName CRYVISIL:STM:FASTSCAN:IMAGE_CHUNK
PvaClientChannel::issueConnect channelName CRYVISIL:STM:FASTSCAN:IMAGE_CHUNK
PvaClientChannel::issueConnect calling provider->createChannel
PvaClientChannel::channelCreated channelName CRYVISIL:STM:FASTSCAN:IMAGE_CHUNK connectState 1 isConnected false status.isOK true
PvaClientChannel::waitConnect channelName CRYVISIL:STM:FASTSCAN:IMAGE_CHUNK
 PvaClientChannel::channelStateChange  channelName CRYVISIL:STM:FASTSCAN:IMAGE_CHUNK CONNECTED
PvaClientPutGet::PvaClientPutGet channelName CRYVISIL:STM:FASTSCAN:IMAGE_CHUNK
PvaClientPutGet::connect channelName CRYVISIL:STM:FASTSCAN:IMAGE_CHUNK
PvaClientPutGet::issueConnect channelName CRYVISIL:STM:FASTSCAN:IMAGE_CHUNK
PvaClientPutGet::waitConnect channelName CRYVISIL:STM:FASTSCAN:IMAGE_CHUNK
PvaClientPutGet::channelPutGetConnect channelName CRYVISIL:STM:FASTSCAN:IMAGE_CHUNK status.isOK false
PvaClientPutGet::~PvaClientPutGet channelName CRYVISIL:STM:FASTSCAN:IMAGE_CHUNK
~ChannelPutGetRequesterImpl
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()


[junkes@dune iocmyEx]$ pvget -v -r "" CRYVISIL:STM:FASTSCAN:IMAGE_CHUNK
CRYVISIL:STM:FASTSCAN:IMAGE_CHUNK epics:nt/NTTable:1.0
    string[] labels ["x", "y", "z", "time_index”]


With the change of the PVName to std::string

 std::string pv("CRYVISIL:STM:FASTSCAN:IMAGE_CHUNK");
    //char pv[] = "NOT:EXISTING:PV";
    simpleId = epicsThreadCreate("IChunkT", epicsThreadPriorityMedium,
                                epicsThreadGetStackSize(epicsThreadStackMedium),
                                (EPICSTHREADFUNC)iChunk, &pv);


It looks better with this. Now we at least wait for the timeout:

epics> PvaClientChannel::PvaClientChannel channelName 1
PvaClientChannel::connect channelName 1
PvaClientChannel::issueConnect channelName 1
PvaClientChannel::issueConnect calling provider->createChannel
PvaClientChannel::channelCreated channelName 1 connectState 1 isConnected false status.isOK true
PvaClientChannel::waitConnect channelName 1
PvaClientChannel::connect  waitConnect failed
PvaClientChannel::~PvaClientChannel()  channelName 1
    pvaClientGet cache is empty
    pvaClientPut cache is empty
PvaClientPutCache::~PvaClientPutCache
PvaClientGetCache::~PvaClientGetCache
exception channel 1 PvaClientChannel::connect  not connected
Error: epicsMutex::invalidMutex()


I started the thread because I originally wanted to try the whole thing with RTEMS and wanted to do more in the thread.

Danke, Heinz


> On 14. Mar 2019, at 10:31, Marty Kraimer <mrkraimer@comcast.net> wrote:
> 
> Change
>> int iChunk(char *pvName)
>> {
>>     PvaClientPtr pva= PvaClient::get("pva”);
>> try {
> to
> 
> int iChunk(char *pvName)
> {
>    PvaClientPtr pva= PvaClient::get("pva”);
>    PvaClient::setDebug(true);
>  try {
> 
> What is the result?
> 
> Also what does:
> pvget -v -r "" CRYVISIL:STM:FASTSCAN:IMAGE_CHUNK
> show?
> 
> Marty
> 
> On 3/13/19 3:00 PM, Heinz Junkes wrote:
>> 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:        junkes@fhi-berlin.mpg.de
>> ------------------------------------------------------------------------------
>> 
>>> On 12. Mar 2019, at 15:26, Marty Kraimer via Tech-talk <tech-talk@aps.anl.gov> 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;
> 
> 

Attachment: smime.p7s
Description: S/MIME cryptographic signature


References:
I'm looking for a pvacces example to read PVStructure Heinz Junkes via Tech-talk
Re: I'm looking for a pvacces example to read PVStructure will.rogers--- via Tech-talk
Re: I'm looking for a pvacces example to read PVStructure Marty Kraimer via Tech-talk
Re: I'm looking for a pvacces example to read PVStructure Heinz Junkes via Tech-talk
Re: I'm looking for a pvacces example to read PVStructure Marty Kraimer via Tech-talk

Navigate by Date:
Prev: Re: I'm looking for a pvacces example to read PVStructure Marty Kraimer via Tech-talk
Next: Re: Count record that resets by date Matt Newville via Tech-talk
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  <20192020 
Navigate by Thread:
Prev: Re: I'm looking for a pvacces example to read PVStructure Marty Kraimer via Tech-talk
Next: ADPIcam driver question Jörn Dreyer via Tech-talk
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  <20192020 
ANJ, 14 Mar 2019 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·