NDPluginStdArrays Class Reference

Converts NDArray callback data into standard asyn arrays (asynInt8Array, asynInt16Array, asynInt32Array, asynFloat32Array or asynFloat64Array); normally used for putting NDArray data in EPICS waveform records. More...

#include <NDPluginStdArrays.h>

Inheritance diagram for NDPluginStdArrays:

NDPluginDriver asynNDArrayDriver

List of all members.

Public Member Functions

 NDPluginStdArrays (const char *portName, int queueSize, int blockingCallbacks, const char *NDArrayPort, int NDArrayAddr, size_t maxMemory, int priority, int stackSize)
 Constructor for NDPluginStdArrays; all parameters are simply passed to NDPluginDriver::NDPluginDriver.
void processCallbacks (NDArray *pArray)
 Callback function that is called by the NDArray driver with new NDArray data.
virtual asynStatus readInt8Array (asynUser *pasynUser, epicsInt8 *value, size_t nElements, size_t *nIn)
 Called when asyn clients call pasynInt8Array->read().
virtual asynStatus readInt16Array (asynUser *pasynUser, epicsInt16 *value, size_t nElements, size_t *nIn)
 Called when asyn clients call pasynInt16Array->read().
virtual asynStatus readInt32Array (asynUser *pasynUser, epicsInt32 *value, size_t nElements, size_t *nIn)
 Called when asyn clients call pasynInt32Array->read().
virtual asynStatus readFloat32Array (asynUser *pasynUser, epicsFloat32 *value, size_t nElements, size_t *nIn)
 Called when asyn clients call pasynFloat32Array->read().
virtual asynStatus readFloat64Array (asynUser *pasynUser, epicsFloat64 *value, size_t nElements, size_t *nIn)
 Called when asyn clients call pasynFloat64Array->read().
asynStatus drvUserCreate (asynUser *pasynUser, const char *drvInfo, const char **pptypeName, size_t *psize)
 Sets pasynUser->reason to one of the enum values for the parameters defined for this class if the drvInfo field matches one the strings defined for it.


Detailed Description

Converts NDArray callback data into standard asyn arrays (asynInt8Array, asynInt16Array, asynInt32Array, asynFloat32Array or asynFloat64Array); normally used for putting NDArray data in EPICS waveform records.

It handles the data type conversion if the NDArray data type differs from the data type of the asyn interface. It flattens the NDArrays to a single dimension because asyn and EPICS do not support multi-dimensional arrays.


Constructor & Destructor Documentation

NDPluginStdArrays::NDPluginStdArrays ( const char *  portName,
int  queueSize,
int  blockingCallbacks,
const char *  NDArrayPort,
int  NDArrayAddr,
size_t  maxMemory,
int  priority,
int  stackSize 
)

Constructor for NDPluginStdArrays; all parameters are simply passed to NDPluginDriver::NDPluginDriver.

This plugin cannot block (ASYN_CANBLOCK=0) and is not multi-device (ASYN_MULTIDEVICE=0). It allocates a maximum of 2 NDArray buffers for internal use.

Parameters:
[in] portName The name of the asyn port driver to be created.
[in] queueSize The number of NDArrays that the input queue for this plugin can hold when NDPluginDriverBlockingCallbacks=0. Larger queues can decrease the number of dropped arrays, at the expense of more NDArray buffers being allocated from the underlying driver's NDArrayPool.
[in] blockingCallbacks Initial setting for the NDPluginDriverBlockingCallbacks flag. 0=callbacks are queued and executed by the callback thread; 1 callbacks execute in the thread of the driver doing the callbacks.
[in] NDArrayPort Name of asyn port driver for initial source of NDArray callbacks.
[in] NDArrayAddr asyn port driver address for initial source of NDArray callbacks.
[in] maxMemory The maximum amount of memory that the NDArrayPool for this driver is allowed to allocate. Set this to -1 to allow an unlimited amount of memory.
[in] priority The thread priority for the asyn port driver thread if ASYN_CANBLOCK is set in asynFlags.
[in] stackSize The stack size for the asyn port driver thread if ASYN_CANBLOCK is set in asynFlags.


Member Function Documentation

asynStatus NDPluginStdArrays::drvUserCreate ( asynUser *  pasynUser,
const char *  drvInfo,
const char **  pptypeName,
size_t *  psize 
) [virtual]

Sets pasynUser->reason to one of the enum values for the parameters defined for this class if the drvInfo field matches one the strings defined for it.

If the parameter is not recognized by this class then calls NDPluginDriver::drvUserCreate. Uses asynPortDriver::drvUserCreateParam.

Parameters:
[in] pasynUser pasynUser structure that driver modifies
[in] drvInfo String containing information about what driver function is being referenced
[out] pptypeName Location in which driver puts a copy of drvInfo.
[out] psize Location where driver puts size of param
Returns:
Returns asynSuccess if a matching string was found, asynError if not found.

Reimplemented from NDPluginDriver.

void NDPluginStdArrays::processCallbacks ( NDArray pArray  )  [virtual]

Callback function that is called by the NDArray driver with new NDArray data.

It does callbacks with the array data to any registered asyn clients on any of the asynXXXArray interfaces. It converts the array data to the type required for that interface.

Parameters:
[in] pArray The NDArray from the callback.

Reimplemented from NDPluginDriver.

asynStatus NDPluginStdArrays::readFloat32Array ( asynUser *  pasynUser,
epicsFloat32 *  value,
size_t  nElements,
size_t *  nIn 
) [virtual]

Called when asyn clients call pasynFloat32Array->read().

Converts the last NDArray callback data to epicsFloat32 (if necessary) and returns it.

Parameters:
[in] pasynUser pasynUser structure that encodes the reason and address.
[in] value Pointer to the array to read.
[in] nElements Number of elements to read.
[out] nIn Number of elements actually read.

asynStatus NDPluginStdArrays::readFloat64Array ( asynUser *  pasynUser,
epicsFloat64 *  value,
size_t  nElements,
size_t *  nIn 
) [virtual]

Called when asyn clients call pasynFloat64Array->read().

Converts the last NDArray callback data to epicsFloat64 (if necessary) and returns it.

Parameters:
[in] pasynUser pasynUser structure that encodes the reason and address.
[in] value Pointer to the array to read.
[in] nElements Number of elements to read.
[out] nIn Number of elements actually read.

asynStatus NDPluginStdArrays::readInt16Array ( asynUser *  pasynUser,
epicsInt16 *  value,
size_t  nElements,
size_t *  nIn 
) [virtual]

Called when asyn clients call pasynInt16Array->read().

Converts the last NDArray callback data to epicsInt16 (if necessary) and returns it.

Parameters:
[in] pasynUser pasynUser structure that encodes the reason and address.
[in] value Pointer to the array to read.
[in] nElements Number of elements to read.
[out] nIn Number of elements actually read.

asynStatus NDPluginStdArrays::readInt32Array ( asynUser *  pasynUser,
epicsInt32 *  value,
size_t  nElements,
size_t *  nIn 
) [virtual]

Called when asyn clients call pasynInt32Array->read().

Converts the last NDArray callback data to epicsInt32 (if necessary) and returns it.

Parameters:
[in] pasynUser pasynUser structure that encodes the reason and address.
[in] value Pointer to the array to read.
[in] nElements Number of elements to read.
[out] nIn Number of elements actually read.

Reimplemented from NDPluginDriver.

asynStatus NDPluginStdArrays::readInt8Array ( asynUser *  pasynUser,
epicsInt8 *  value,
size_t  nElements,
size_t *  nIn 
) [virtual]

Called when asyn clients call pasynInt8Array->read().

Converts the last NDArray callback data to epicsInt8 (if necessary) and returns it.

Parameters:
[in] pasynUser pasynUser structure that encodes the reason and address.
[in] value Pointer to the array to read.
[in] nElements Number of elements to read.
[out] nIn Number of elements actually read.


The documentation for this class was generated from the following files:

Generated on Tue Aug 25 16:53:04 2009 for areaDetector by  doxygen 1.5.7.1