Argonne National Laboratory

Experimental Physics and
Industrial Control System

2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  <20192020  Index 2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  <20192020 
<== Date ==> <== Thread ==>

Subject: Re: Get sub field of Union
From: "Shen, Guobao via Core-talk" <core-talk@aps.anl.gov>
To: Marty Kraimer <mrkraimer@comcast.net>, "core-talk@aps.anl.gov" <core-talk@aps.anl.gov>
Date: Tue, 26 Mar 2019 17:11:47 +0000

Hi Marty,

I was using our pvaPy for the IOC, and did not use a C++ based IOC, therefore, my IOC did not crash.

 

Since you have seen the IOC crash, maybe you can give more detailed info there.

Therefore, how about that you create an issue, and add some stack trace details?

 

Thanks,

Guobao

 

From: <core-talk-bounces@aps.anl.gov> on behalf of Marty Kraimer via Core-talk <core-talk@aps.anl.gov>
Reply-To: Marty Kraimer <mrkraimer@comcast.net>
Date: Sunday, March 24, 2019 at 3:36 AM
To: "core-talk@aps.anl.gov" <core-talk@aps.anl.gov>
Subject: Re: Get sub field of Union

 

I just tried using pvget with the PVRrestrictedUnion record from exampleCPP/database.

 

Just like your example it does work with

mrk> pvget -r value PVRrestrictedUnion
PVRrestrictedUnion structure
    union value
        (none)

But with

 

mrk> pvinfo PVRrestrictedUnion
PVRrestrictedUnion
Server: 10.0.0.19:5075
Type:
    epics:nt/NTUnion:1.0
        union value
            string string
            string[] stringArray
        time_t timeStamp
            long secondsPastEpoch
            int nanoseconds
            int userTag

 

mrk> pvget -r value.string PVRrestrictedUnion

It does not work and actually causes the IOC to crash.

 

Is it valid to ask for -r value.string?

Perhaps yes with the expectation that you will  find out if this is the current type of the value field.

If not you  could get valid error message.

 

Guobao,

 

Please create a issue in pvDatabaseCPP giving your original message.

 

Marty

 

On 3/21/19 11:43 AM, Shen, Guobao via Core-talk wrote:

Hi Core member,

Does anyone have experienced to read sub field of a Union structure?

For example, I have a record:

$ pvinfo Test:Data

structure

    uint ArrayId

    double[] Time

    union value

        float[] data1

        double[] data2

 

If I use

$ pvget -r value Test:Data

Test:Data

structure

    union value

        float[]  [-0.034794,-0.0417011, …]

 

But if I do it with:

$ pvget -r value.data1 Test:Data

 

I got an error on my client like

[Test: Data] failed to create channel get: Status [type=FATAL, message=std::bad_alloc]

 

Is that a right way to use it for union?

 

Thanks,

Guobao

 

 


References:
Get sub field of Union Shen, Guobao via Core-talk
Re: Get sub field of Union Marty Kraimer via Core-talk

Navigate by Date:
Prev: Re: Get sub field of Union Marty Kraimer via Core-talk
Next: Re: Get sub field of Union Benjamin Franksen via Core-talk
Index: 2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  <20192020 
Navigate by Thread:
Prev: Re: Get sub field of Union Marty Kraimer via Core-talk
Next: Re: Get sub field of Union Marty Kraimer via Core-talk
Index: 2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  <20192020 
ANJ, 28 Mar 2019 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·