Experimental Physics and Industrial Control System
Subject: |
Re: I'm looking for a pvacces example to read PVStructure |
From: |
Marty Kraimer via Tech-talk <[email protected]> |
To: |
[email protected] |
Date: |
Tue, 12 Mar 2019 10:26:00 -0400 |
On 3/12/19 4:57 AM, will.rogers--- via Tech-talk wrote
________________________________
From: [email protected] <[email protected]> on behalf of Heinz Junkes via Tech-talk <[email protected]>
Sent: 11 March 2019 16:41:54
To: tech-talk
Subject: I'm looking for a pvacces example to read PVStructure
I'm looking for a pva example c++ program which I can currently use (with Epics 7).
Unfortunately the examples I've found on the net don't work at all.
Above all, there seems to be a little confusion between PVAClient and pvac? (Or I don't get it)
I have a client that wants to read the PVStructure of a PV and then put new data into
NTTable vector fields (x, y, z and time_index):
humma-kavula:~ junkes$ pvlist 0xB9EC6A5C00000000C2AFA421
CRYVISIL:STM:FASTSCAN:IMAGE_CHUNK
humma-kavula:~ junkes$ pvinfo CRYVISIL:STM:FASTSCAN:IMAGE_CHUNK
CHANNEL : CRYVISIL:STM:FASTSCAN:IMAGE_CHUNK
STATE : CONNECTED
ADDRESS : 141.14.133.59:53379
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
To read the PVStructure you can issue
pvget -r "" -v CRYVISIL:STM:FASTSCAN:IMAGE_CHUNK
I do not know if any command line tool can change all the value fields
with one command.
You could make the changes with the following set of commands:
pvput -r "value.x" CRYVISIL:STM:FASTSCAN:IMAGE_CHUNK x0 x1 ...
pvput -r "value.y" CRYVISIL:STM:FASTSCAN:IMAGE_CHUNK y0 y1 ...
pvput -r "value.z" CRYVISIL:STM:FASTSCAN:IMAGE_CHUNK z0 z1 ...
pvput -r "value.time_index" CRYVISIL:STM:FASTSCAN:IMAGE_CHUNK i0 i1 ...
You could create your own client code that uses channelPutGet to put all
values and gets the entire structure.
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;
Marty
- Replies:
- Re: I'm looking for a pvacces example to read PVStructure Heinz Junkes via Tech-talk
- 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
- Navigate by Date:
- Prev:
ADPIcam driver question Jörn Dreyer via Tech-talk
- Next:
Re: I'm looking for a pvacces example to read PVStructure Heinz Junkes 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
<2019>
2020
2021
2022
2023
2024
- Navigate by Thread:
- Prev:
RE: I'm looking for a pvacces example to read PVStructure Mark Rivers via Tech-talk
- Next:
Re: I'm looking for a pvacces example to read PVStructure Heinz Junkes 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
<2019>
2020
2021
2022
2023
2024