EPICS Controls 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  <20182019  2020  2021  2022  2023  2024  2025  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  <20182019  2020  2021  2022  2023  2024  2025 
<== Date ==> <== Thread ==>

Subject: Re: CPP example NTTable builder
From: Heinz Junkes <[email protected]>
To: Michael Davidsaver <[email protected]>, Heinz Junkes <[email protected]>
Cc: Talk EPICS Tech <[email protected]>
Date: Tue, 26 Jun 2018 15:04:40 +0200
Hi Michael,

your example The example works exactly as expected. Also with RTEMS5.

The crashes I observed are  in connection with the VMEbus implementation on the MVME6100.

I want to use the NTTable for image data collected on a path “through" the image:

[junkes@dune epics]$ pvinfo struckPVArray
CHANNEL  : struckPVArray
STATE    : CONNECTED
ADDRESS  : 141.14.128.12:5075
epics:nt/NTTable:1.0
   string[] labels
   structure value
       double[] ts
       double[] X
       double[] Y
       double[] Z


[junkes@dune epics]$ pvget -r 'field(value)' struckPVArray
struckPVArray
structure
   structure value
       double[] ts [3.55087e+12,3.55092e+12,3.55098e+12,3.55103e+12,3.55109e+12,3.55114e+12,3.5512e+12,3.55125e+12,3.55131e+12,3.55136e+12,3.55142e+12,3.55147e+12,3.55153e+12,3.55158e+12,3.55164e+12,3.55169e+12,3.55175e+12,3.5518e+12,3.55186e+12,3.55191e+12,3.55197e+12,3.55202e+12,3.55208e+12,3.55213e+12,3.55219e+12,3.55224e+12,3.5523e+12,3.55235e+12,3.55241e+12,3.55246e+12,3.55252e+12,3.55257e+12,3.55263e+12,3.55268e+12,3.55274e+12,3.55279e+12,3.55285e+12,3.5529e+12,3.55296e+12,3.55301e+12,3.55307e+12,3.55312e+12,3.55318e+12,3.55323e+12,3.55329e+12,3.55334e+12,3.5534e+12,3.55345e+12,3.55351e+12,3.55356e+12,3.55362e+12,3.55367e+12,3.55373e+12,3.55378e+12,3.55384e+12,3.55389e+12,3.55395e+12,3.554e+12,3.55406e+12,3.55411e+12,3.55417e+12,3.55422e+12,3.55428e+12,3.55433e+12,3.55439e+12,3.55444e+12,3.5545e+12,3.55455e+12,3.55461e+12,3.55466e+12,3.55472e+12,3.55477e+12,3.55483e+12,3.55488e+12,3.55494e+12,3.55499e+12,3.55505e+12,3.5551e+12,3.55516e+12,3.55521e+12,3.55527e+12,3.55532e+12,3.55538e+12,3.55543e+12,3.55549e+12,3.55554e+12,3.5556e+12,3.55565e+12,3.55571e+12,3.55576e+12,3.55582e+12,3.55587e+12,3.55593e+12,3.55598e+12,3.55604e+12,3.55609e+12,3.55615e+12,3.5562e+12,3.55626e+12,3.55631e+12]
       double[] X [0.0356783,0.0356783,0.0359882,0.0359882,0.0356783,0.0359882,0.0359882,0.0359882,0.0359882,0.0359882,0.0359882,0.0359882,0.0359882,0.0356783,0.0356783,0.0359882,0.0359882,0.0359882,0.0362981,0.0359882,0.0356783,0.0359882,0.0359882,0.0359882,0.0359882,0.0356783,0.0359882,0.0359882,0.0359882,0.0359882,0.0362981,0.0359882,0.0359882,0.0359882,0.0362981,0.0359882,0.0359882,0.0359882,0.0356783,0.0359882,0.0359882,0.0359882,0.0359882,0.0359882,0.0359882,0.0359882,0.0359882,0.0359882,0.0359882,0.0359882,0.0359882,0.0359882,0.0359882,0.0359882,0.0359882,0.0359882,0.0359882,0.0359882,0.0359882,0.0356783,0.0359882,0.0359882,0.0359882,0.0359882,0.0356783,0.0359882,0.0359882,0.0359882,0.0359882,0.0356783,0.0359882,0.0356783,0.0356783,0.0359882,0.0359882,0.0359882,0.0359882,0.0359882,0.0359882,0.0356783,0.0356783,0.0359882,0.0359882,0.0359882,0.0359882,0.0359882,0.0359882,0.0359882,0.0359882,0.0359882,0.0359882,0.0359882,0.0359882,0.0359882,0.0356783,0.0359882,0.0356783,0.0359882,0.0359882,0.0359882]
       double[] Y [0.0521035,0.0521035,0.0521035,0.0521035,0.0521035,0.0524134,0.0521035,0.0521035,0.0521035,0.0521035,0.0521035,0.0521035,0.0524134,0.0521035,0.0521035,0.0524134,0.0521035,0.0521035,0.0524134,0.0521035,0.0521035,0.0524134,0.0521035,0.0524134,0.0524134,0.0521035,0.0524134,0.0521035,0.0521035,0.0524134,0.0521035,0.0524134,0.0524134,0.0521035,0.0524134,0.0524134,0.0521035,0.0521035,0.0524134,0.0524134,0.0521035,0.0521035,0.0521035,0.0521035,0.0521035,0.0521035,0.0524134,0.0521035,0.0521035,0.0521035,0.0521035,0.0524134,0.0521035,0.0524134,0.0521035,0.0521035,0.0521035,0.0521035,0.0521035,0.0524134,0.0524134,0.0521035,0.0524134,0.0521035,0.0521035,0.0521035,0.0521035,0.0524134,0.0521035,0.0521035,0.0524134,0.0524134,0.0521035,0.0524134,0.0524134,0.0521035,0.0521035,0.0521035,0.0521035,0.0524134,0.0524134,0.0524134,0.0524134,0.0524134,0.0521035,0.0521035,0.0521035,0.0524134,0.0521035,0.0524134,0.0521035,0.0521035,0.0521035,0.0521035,0.0521035,0.0521035,0.0521035,0.0521035,0.0524134,0.0316495]
       double[] Z [0.0356783,0.0356783,0.0356783,0.0356783,0.0356783,0.0356783,0.0356783,0.0356783,0.0359882,0.0356783,0.0359882,0.0356783,0.0356783,0.0356783,0.0356783,0.0356783,0.0356783,0.0356783,0.0356783,0.0356783,0.0356783,0.0356783,0.0356783,0.0356783,0.0356783,0.0356783,0.0356783,0.0356783,0.0356783,0.0356783,0.0356783,0.0356783,0.0356783,0.0356783,0.0356783,0.0356783,0.0356783,0.0356783,0.0356783,0.0356783,0.0356783,0.0356783,0.0356783,0.0356783,0.0356783,0.0356783,0.0356783,0.0356783,0.0356783,0.0359882,0.0356783,0.0356783,0.0356783,0.0356783,0.0356783,0.0356783,0.0356783,0.0356783,0.0356783,0.0356783,0.0356783,0.0356783,0.0356783,0.0356783,0.0356783,0.0356783,0.0356783,0.0356783,0.0356783,0.0356783,0.0356783,0.0356783,0.0356783,0.0356783,0.0356783,0.0356783,0.0356783,0.0356783,0.0356783,0.0356783,0.0356783,0.0356783,0.0353684,0.0356783,0.0356783,0.0356783,0.0356783,0.0356783,0.0356783,0.0359882,0.0356783,0.0356783,0.0356783,0.0356783,0.0356783,0.0356783,0.0356783,0.0356783,0.0356783,0.0356783]

Heinz

> On 20. Jun 2018, at 08:02, Michael Davidsaver <[email protected]> wrote:
> 
> On 06/19/2018 10:49 AM, Heinz Junkes wrote:
>> HI,
>> 
>> try to create NTTable :
>> 
>> NTTableBuilderPtr builder = NTTable::createBuilder();
>> 
>>    PVStructurePtr pvStructure = builder->
>>            addColumn("ts", pvInt)->
>>            addColumn("X", pvDouble)->
>>            addColumn("Y", pvDouble)->
>>            addColumn("Z", pvDouble)->
>>            addDescriptor()->
>>            addAlarm()->
>>            addTimeStamp()->
>>            createPVStructure();
>> 
>> Unfortunately, I always end up with "core-dump” on the RTEMS-system.
> 
> Are you able to test on another OS as well?
> 
>> I have not understood yet how to specify the length for the four arrays (pvInt, pvDouble [X,Y,Z] ) connected to the 4 columns.
>> I thought I had to add an array structure to the 4 columns. But I found nothing in the nttable.h file how to do that.
>> Every note is welcome as always.
> 
> As the reluctant maintainer of normativeTypesCPP I'm recommending not to use class NTTable.
> I've not found it so helpful since, as you've found, it doesn't help with handling column data.
> 
> A more complete example, which should compile and not crash (it's late).
> 
>> #include <pv/pvData.h>
>> #include <pv/standardField.h>
>> namespace pvd = epics::pvData;
>> 
>> static
>> pvd::StructureConstPtr typedesc(pvd::getFieldCreate()->createFieldBuilder()
>>                                ->setId("epics:nt/NTTable:1.0")
>>                                ->addArray("labels", pvd::pvString)
>>                                ->addNestedStructure("value")
>>                                    ->addArray("ts", pvd::pvInt)
>>                                    ->addArray("X", pvd::pvDouble)
>>                                    ->addArray("Y", pvd::pvDouble)
>>                                    ->addArray("Z", pvd::pvDouble)
>>                                ->endNested()
>>                                //->add("timeStamp", pvd::getStandardField()->timeStamp()) // unused in this example
>>                                //->add("alarm", pvd::getStandardField()->alarm())
>>                                ->createStructure());
>> 
>> pvd::PVStructure::shared_pointer buildTable(){
>>    pvd::shared_vector<std::string> labels;
>>    labels.push_back("The TS");
>>    labels.push_back("The X");
>>    labels.push_back("The Y");
>>    labels.push_back("The Z");
>> 
>>    pvd::shared_vector<pvd::int32> ts;
>>    pvd::shared_vector<double> X, Y, Z;
>> 
>>    for(size_t i=0; i<10; i++) { // some fake data
>>        ts.push_back(i*10);
>>        X.push_back(i);
>>        Y.push_back(i+1);
>>        Z.push_back(i+2);
>>    }
>> 
>>    pvd::PVStructure::shared_pointer value(pvd::getPVDataCreate()->createPVStructure(typedesc));
>> 
>>    value->getSubFieldT<pvd::PVScalarArray>("labels")->putFrom(freeze(labels));
>>    value->getSubFieldT<pvd::PVScalarArray>("value.ts")->putFrom(freeze(ts));
>>    value->getSubFieldT<pvd::PVScalarArray>("value.X")->putFrom(freeze(X));
>>    value->getSubFieldT<pvd::PVScalarArray>("value.Y")->putFrom(freeze(Y));
>>    value->getSubFieldT<pvd::PVScalarArray>("value.Z")->putFrom(freeze(Z));
>> 
>>    return value;
>> }
> 

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


References:
CPP example NTTable builder Heinz Junkes
Re: CPP example NTTable builder Michael Davidsaver

Navigate by Date:
Prev: Re: time series circular buffer Hinko Kocevar
Next: Question about displaying process memory allocation on Linux Mark Rivers
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  <20182019  2020  2021  2022  2023  2024  2025 
Navigate by Thread:
Prev: Re: CPP example NTTable builder Michael Davidsaver
Next: Trouble building with Visual Studio 2017 Hammonds, John P.
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  <20182019  2020  2021  2022  2023  2024  2025 
ANJ, 26 Jun 2018 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions ·
· Download · Search · IRMIS · Talk · Documents · Links · Licensing ·