Skip to content

NDPluginPvxs modifies NDAttributes of NDArrays when copying to pvaDriver #560

@MarkRivers

Description

@MarkRivers

NDPluginPva can be used to copy NDArrays to another IOC which runs pvaDriver. This is often used, for example to distribute plugin processing across multiple processes on one machine, or across multiple machines.

When using the PVA plugin the dataTypes NDAttributes of the NDArrays on the pvaDriver IOC are the same as they are on the original IOC running NDPluginPva.

When using NDPluginPvxs this is not true. The dataTypes of the NDAttributes are changed on the pvaDriver IOC. This is because PVXS transmits all signed and unsigned integer datatypes as 64-bit values, rather than the original integer bit size. It also transmits 32-bit floats as 64-bit floats.

The following are the output of asynReport 20 [driverName] on both the simDetector IOC and the pvaDriver IOC when the simDetector IOC is using NDPluginPva.

simDetector IOC

NDArray  Array address=0x7fabac009340:
  ndims=2 dims=[1024 1024 ]
  dataType=1, dataSize=1048576, pData=0x7fabac10af50
  uniqueId=4, timeStamp=1136321201.832483, epicsTS.secPastEpoch=1136321201, epicsTS.nsec=832482926
  referenceCount=5
  number of attributes=11

NDAttributeList: address=0x7fabac0094e0:
  number of attributes=11

NDAttribute, address=0x7fabac009560:
  name=ColorMode
  description=Color mode
  source type=0
  source type string=NDAttrSourceDriver
  source=Driver
  dataType=NDAttrInt32
  value=0

NDAttribute, address=0x7fabac009670:
  name=Int8
  description=Int8 attribute
  source type=3
  source type string=NDAttrSourceFunct
  source=myAttrFunct1
  dataType=NDAttrInt8
  value=-8
  functAttribute
    functParam=INT8
    pFunction=0x7253f0
    functionPvt=0x46ce2f0

NDAttribute, address=0x7fabac0097a0:
  name=UInt8
  description=UInt8 attribute
  source type=3
  source type string=NDAttrSourceFunct
  source=myAttrFunct1
  dataType=NDAttrUInt8
  value=8
  functAttribute
    functParam=UINT8
    pFunction=0x7253f0
    functionPvt=0x46ce310

NDAttribute, address=0x7fabac0098f0:
  name=Int16
  description=Int16 attribute
  source type=3
  source type string=NDAttrSourceFunct
  source=myAttrFunct1
  dataType=NDAttrInt16
  value=-16
  functAttribute
    functParam=INT16
    pFunction=0x7253f0
    functionPvt=0x46ce330

NDAttribute, address=0x7fabac009a40:
  name=UInt16
  description=UInt16 attribute
  source type=3
  source type string=NDAttrSourceFunct
  source=myAttrFunct1
  dataType=NDAttrUInt16
  value=16
  functAttribute
    functParam=UINT16
    pFunction=0x7253f0
    functionPvt=0x46ce350

NDAttribute, address=0x7fabac009bc0:
  name=Int32
  description=Int32 attribute
  source type=3
  source type string=NDAttrSourceFunct
  source=myAttrFunct1
  dataType=NDAttrInt32
  value=-32
  functAttribute
    functParam=INT32
    pFunction=0x7253f0
    functionPvt=0x46ce370

NDAttribute, address=0x7fabac001e30:
  name=UInt32
  description=UInt32 attribute
  source type=3
  source type string=NDAttrSourceFunct
  source=myAttrFunct1
  dataType=NDAttrUInt32
  value=32
  functAttribute
    functParam=UINT32
    pFunction=0x7253f0
    functionPvt=0x46ce390

NDAttribute, address=0x7fabac001fb0:
  name=Int64
  description=Int64 attribute
  source type=3
  source type string=NDAttrSourceFunct
  source=myAttrFunct1
  dataType=NDAttrInt64
  value=-64
  functAttribute
    functParam=INT64
    pFunction=0x7253f0
    functionPvt=0x46ce3b0

NDAttribute, address=0x7fabac002100:
  name=UInt64
  description=UInt64 attribute
  source type=3
  source type string=NDAttrSourceFunct
  source=myAttrFunct1
  dataType=NDAttrUInt64
  value=64
  functAttribute
    functParam=UINT64
    pFunction=0x7253f0
    functionPvt=0x46ce3d0

NDAttribute, address=0x7fabac002280:
  name=Float32
  description=Float32 attribute
  source type=3
  source type string=NDAttrSourceFunct
  source=myAttrFunct1
  dataType=NDAttrFloat32
  value=32.000000
  functAttribute
    functParam=FLOAT32
    pFunction=0x7253f0
    functionPvt=0x46ce3f0

NDAttribute, address=0x7fabac002400:
  name=Float64
  description=Float64 attribute
  source type=3
  source type string=NDAttrSourceFunct
  source=myAttrFunct1
  dataType=NDAttrFloat64
  value=64.000000
  functAttribute
    functParam=FLOAT64
    pFunction=0x7253f0
    functionPvt=0x46ce410

pvaDriver IOC

NDArray  Array address=0x7fdcfc10a5b0:
  ndims=2 dims=[1024 1024 ]
  dataType=1, dataSize=1048576, pData=0x7fdcfc10a7a0
  uniqueId=4, timeStamp=1136321201.832483, epicsTS.secPastEpoch=1136321201, epicsTS.nsec=832482926
  referenceCount=0
  number of attributes=11

NDAttributeList: address=0x7fdcfc006240:
  number of attributes=11

NDAttribute, address=0x7fdcfc20b280:
  name=ColorMode
  description=Color mode
  source type=0
  source type string=NDAttrSourceDriver
  source=Driver
  dataType=NDAttrInt32
  value=0

NDAttribute, address=0x7fdcfc20b3f0:
  name=Int8
  description=Int8 attribute
  source type=3
  source type string=NDAttrSourceFunct
  source=myAttrFunct1
  dataType=NDAttrInt8
  value=-8

NDAttribute, address=0x7fdcfc20a7b0:
  name=UInt8
  description=UInt8 attribute
  source type=3
  source type string=NDAttrSourceFunct
  source=myAttrFunct1
  dataType=NDAttrUInt8
  value=8

NDAttribute, address=0x7fdcfc20a890:
  name=Int16
  description=Int16 attribute
  source type=3
  source type string=NDAttrSourceFunct
  source=myAttrFunct1
  dataType=NDAttrInt16
  value=-16

NDAttribute, address=0x7fdcfc20a970:
  name=UInt16
  description=UInt16 attribute
  source type=3
  source type string=NDAttrSourceFunct
  source=myAttrFunct1
  dataType=NDAttrUInt16
  value=16

NDAttribute, address=0x7fdcfc20aa50:
  name=Int32
  description=Int32 attribute
  source type=3
  source type string=NDAttrSourceFunct
  source=myAttrFunct1
  dataType=NDAttrInt32
  value=-32

NDAttribute, address=0x7fdcfc20ab60:
  name=UInt32
  description=UInt32 attribute
  source type=3
  source type string=NDAttrSourceFunct
  source=myAttrFunct1
  dataType=NDAttrUInt32
  value=32

NDAttribute, address=0x7fdcfc20aca0:
  name=Int64
  description=Int64 attribute
  source type=3
  source type string=NDAttrSourceFunct
  source=myAttrFunct1
  dataType=NDAttrInt64
  value=-64

NDAttribute, address=0x7fdcfc20adb0:
  name=UInt64
  description=UInt64 attribute
  source type=3
  source type string=NDAttrSourceFunct
  source=myAttrFunct1
  dataType=NDAttrUInt64
  value=64

NDAttribute, address=0x7fdcfc20aef0:
  name=Float32
  description=Float32 attribute
  source type=3
  source type string=NDAttrSourceFunct
  source=myAttrFunct1
  dataType=NDAttrFloat32
  value=32.000000

NDAttribute, address=0x7fdcfc20b000:
  name=Float64
  description=Float64 attribute
  source type=3
  source type string=NDAttrSourceFunct
  source=myAttrFunct1
  dataType=NDAttrFloat64
  value=64.000000

Note that the datatypes of all of the attributes are identical. For example the dataType of the second attribute (named) Int8 has is NDAttrInt8 on both IOCs.

The following are the output of asynReport 20 [driverName] on both the simDetector IOC and the pvaDriver IOC when the simDetector IOC is using NDPluginPvxs.

simDetector IOC

NDArray  Array address=0x7fe708001510:
  ndims=2 dims=[1024 1024 ]
  dataType=1, dataSize=1048576, pData=0x7fe708001730
  uniqueId=1, timeStamp=1136322640.667751, epicsTS.secPastEpoch=1136322640, epicsTS.nsec=667750554
  referenceCount=5
  number of attributes=11

NDAttributeList: address=0x7fe7080016b0:
  number of attributes=11

NDAttribute, address=0x7fe708101740:
  name=ColorMode
  description=Color mode
  source type=0
  source type string=NDAttrSourceDriver
  source=Driver
  dataType=NDAttrInt32
  value=0

NDAttribute, address=0x7fe708101850:
  name=Int8
  description=Int8 attribute
  source type=3
  source type string=NDAttrSourceFunct
  source=myAttrFunct1
  dataType=NDAttrInt8
  value=-8
  functAttribute
    functParam=INT8
    pFunction=0x7253f0
    functionPvt=0x50cdfc0

NDAttribute, address=0x7fe708101980:
  name=UInt8
  description=UInt8 attribute
  source type=3
  source type string=NDAttrSourceFunct
  source=myAttrFunct1
  dataType=NDAttrUInt8
  value=8
  functAttribute
    functParam=UINT8
    pFunction=0x7253f0
    functionPvt=0x50cdfe0

NDAttribute, address=0x7fe708101ad0:
  name=Int16
  description=Int16 attribute
  source type=3
  source type string=NDAttrSourceFunct
  source=myAttrFunct1
  dataType=NDAttrInt16
  value=-16
  functAttribute
    functParam=INT16
    pFunction=0x7253f0
    functionPvt=0x50ce000

NDAttribute, address=0x7fe708101c20:
  name=UInt16
  description=UInt16 attribute
  source type=3
  source type string=NDAttrSourceFunct
  source=myAttrFunct1
  dataType=NDAttrUInt16
  value=16
  functAttribute
    functParam=UINT16
    pFunction=0x7253f0
    functionPvt=0x50ce020

NDAttribute, address=0x7fe708101da0:
  name=Int32
  description=Int32 attribute
  source type=3
  source type string=NDAttrSourceFunct
  source=myAttrFunct1
  dataType=NDAttrInt32
  value=-32
  functAttribute
    functParam=INT32
    pFunction=0x7253f0
    functionPvt=0x50ce040

NDAttribute, address=0x7fe708101ef0:
  name=UInt32
  description=UInt32 attribute
  source type=3
  source type string=NDAttrSourceFunct
  source=myAttrFunct1
  dataType=NDAttrUInt32
  value=32
  functAttribute
    functParam=UINT32
    pFunction=0x7253f0
    functionPvt=0x50ce060

NDAttribute, address=0x7fe708102070:
  name=Int64
  description=Int64 attribute
  source type=3
  source type string=NDAttrSourceFunct
  source=myAttrFunct1
  dataType=NDAttrInt64
  value=-64
  functAttribute
    functParam=INT64
    pFunction=0x7253f0
    functionPvt=0x50ce080

NDAttribute, address=0x7fe7081021c0:
  name=UInt64
  description=UInt64 attribute
  source type=3
  source type string=NDAttrSourceFunct
  source=myAttrFunct1
  dataType=NDAttrUInt64
  value=64
  functAttribute
    functParam=UINT64
    pFunction=0x7253f0
    functionPvt=0x50ce0a0

NDAttribute, address=0x7fe708102340:
  name=Float32
  description=Float32 attribute
  source type=3
  source type string=NDAttrSourceFunct
  source=myAttrFunct1
  dataType=NDAttrFloat32
  value=32.000000
  functAttribute
    functParam=FLOAT32
    pFunction=0x7253f0
    functionPvt=0x50ce0c0

NDAttribute, address=0x7fe7081024c0:
  name=Float64
  description=Float64 attribute
  source type=3
  source type string=NDAttrSourceFunct
  source=myAttrFunct1
  dataType=NDAttrFloat64
  value=64.000000
  functAttribute
    functParam=FLOAT64
    pFunction=0x7253f0
    functionPvt=0x50ce0e0

pvaDriver IOC

NDArray  Array address=0x7fdcfc10a5b0:
  ndims=2 dims=[1024 1024 ]
  dataType=1, dataSize=1048576, pData=0x7fdcfc10a7a0
  uniqueId=1, timeStamp=1136322640.667751, epicsTS.secPastEpoch=1136322640, epicsTS.nsec=667750554
  referenceCount=0
  number of attributes=11

NDAttributeList: address=0x7fdcfc006240:
  number of attributes=11

NDAttribute, address=0x7fdcfc0048f0:
  name=ColorMode
  description=Color mode
  source type=0
  source type string=NDAttrSourceDriver
  source=Driver
  dataType=NDAttrInt64
  value=0

NDAttribute, address=0x7fdcfc20b280:
  name=Int8
  description=Int8 attribute
  source type=3
  source type string=NDAttrSourceFunct
  source=myAttrFunct1
  dataType=NDAttrInt64
  value=-8

NDAttribute, address=0x7fdcfc20b3f0:
  name=UInt8
  description=UInt8 attribute
  source type=3
  source type string=NDAttrSourceFunct
  source=myAttrFunct1
  dataType=NDAttrUInt64
  value=8

NDAttribute, address=0x7fdcfc20a7b0:
  name=Int16
  description=Int16 attribute
  source type=3
  source type string=NDAttrSourceFunct
  source=myAttrFunct1
  dataType=NDAttrInt64
  value=-16

NDAttribute, address=0x7fdcfc20a890:
  name=UInt16
  description=UInt16 attribute
  source type=3
  source type string=NDAttrSourceFunct
  source=myAttrFunct1
  dataType=NDAttrUInt64
  value=16

NDAttribute, address=0x7fdcfc20a970:
  name=Int32
  description=Int32 attribute
  source type=3
  source type string=NDAttrSourceFunct
  source=myAttrFunct1
  dataType=NDAttrInt64
  value=-32

NDAttribute, address=0x7fdcfc20aa50:
  name=UInt32
  description=UInt32 attribute
  source type=3
  source type string=NDAttrSourceFunct
  source=myAttrFunct1
  dataType=NDAttrUInt64
  value=32

NDAttribute, address=0x7fdcfc20ab60:
  name=Int64
  description=Int64 attribute
  source type=3
  source type string=NDAttrSourceFunct
  source=myAttrFunct1
  dataType=NDAttrInt64
  value=-64

NDAttribute, address=0x7fdcfc20aca0:
  name=UInt64
  description=UInt64 attribute
  source type=3
  source type string=NDAttrSourceFunct
  source=myAttrFunct1
  dataType=NDAttrUInt64
  value=64

NDAttribute, address=0x7fdcfc20adb0:
  name=Float32
  description=Float32 attribute
  source type=3
  source type string=NDAttrSourceFunct
  source=myAttrFunct1
  dataType=NDAttrFloat64
  value=32.000000

NDAttribute, address=0x7fdcfc20aef0:
  name=Float64
  description=Float64 attribute
  source type=3
  source type string=NDAttrSourceFunct
  source=myAttrFunct1
  dataType=NDAttrFloat64
  value=64.000000

Note that the attributes dataTypes in the simDetector IOC are the same as when using NDPluginPva. However, the datatypes in the pvaDriver IOC are all different, because they have all been promoted to NDAttrInt64, NDAttrUInt64, or NDAttrFloat64.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions