ICP  1
Public Member Functions | Static Public Member Functions | Protected Types | Protected Member Functions | Static Protected Member Functions | Protected Attributes | Static Protected Attributes | List of all members
NIVisa Class Reference

#include <nivisa.h>

Inheritance diagram for NIVisa:
Inheritance graph

Public Member Functions

 NIVisa (DAEstatus &dstatus)
 
virtual ~NIVisa ()
 
int open (const char *device, DAEstatus &dstatus)
 
int openBackplane (const char *device_bp, DAEstatus &dstatus)
 
int lockDevice (int timeout, DAEstatus &dstatus)
 
int unlockDevice (DAEstatus &dstatus)
 
void lockInterface (int timeout, DAEstatus &dstatus)
 
void unlockInterface (DAEstatus &dstatus)
 
int readU16noRetry (unsigned long address, isisU16_t *data16, TransferProps props, DAEstatus &dstatus)
 
int readU32noRetry (unsigned long address, isisU32_t *data32, TransferProps props, DAEstatus &dstatus)
 
int readU16 (unsigned long address, isisU16_t *data16, TransferProps props, DAEstatus &dstatus)
 
int readU32 (unsigned long address, isisU32_t *data32, TransferProps props, DAEstatus &dstatus)
 
int readBlockU16 (unsigned long address, isisU16_t *data16, long nitems, TransferProps props, DAEstatus &dstatus)
 
int readBlockU32 (unsigned long address, isisU32_t *data32, long nitems, TransferProps props, DAEstatus &dstatus)
 
int readBlockU64 (unsigned long address, uint64_t *data64, long nitems, TransferProps props, DAEstatus &dstatus)
 
int writeU16 (unsigned long address, isisU16_t data16, TransferProps props, DAEstatus &dstatus)
 
int writeU32 (unsigned long address, isisU32_t data32, TransferProps props, DAEstatus &dstatus)
 
int writeBlockU16 (unsigned long address, isisU16_t *data16, long nitems, TransferProps props, DAEstatus &dstatus)
 
int writeBlockU32 (unsigned long address, isisU32_t *data32, long nitems, TransferProps props, DAEstatus &dstatus)
 
int writeBlockU64 (unsigned long address, uint64_t *data64, long nitems, TransferProps props, DAEstatus &dstatus)
 
int writeBlock (unsigned long address, isisU32_t *data, long nitems, TransferProps props, DAEstatus &status)
 
int writeBlock (unsigned long address, uint64_t *data, long nitems, TransferProps props, DAEstatus &status)
 
int readBlock (unsigned long address, isisU32_t *data, long nitems, TransferProps props, DAEstatus &status)
 
int readBlock (unsigned long address, uint64_t *data, long nitems, TransferProps props, DAEstatus &status)
 
int close (DAEstatus &status)
 
int scanBus (DAEstatus &status)
 
bool resetBus (DAEstatus &status)
 
bool initOK ()
 
const char * device ()
 
const char * deviceBackplane ()
 
int addJobid (ViJobId jobId, ViStatus vi_status)
 
void setTriggerFunc (trigger_func_t *func, void *arg)
 
- Public Member Functions inherited from ISISVME
virtual ~ISISVME ()
 

Static Public Member Functions

static void setEndianWorkaround (bool endian_workaround)
 

Protected Types

typedef std::map< ViJobId,
ViStatus > 
jobid_map_t
 

Protected Member Functions

int printError (ViSession session, const char *func, ViStatus status, std::ostream &os)
 
int printError (ViSession session, const char *func, ViStatus status, unsigned long address, long nitems, std::ostream &os)
 
int addError (ViSession session, const char *func, ViStatus status, const std::string &message, DAEstatus &dstatus)
 
int addError (ViSession session, const char *func, ViStatus status, unsigned long address, long nitems, const std::string &message, DAEstatus &dstatus)
 
bool resetBusDevice (const char *name, DAEstatus &dstatus)
 
int setEndian (ViSession session, bool little_endian, DAEstatus &dstatus)
 
int enableBlockTransfers (ViSession session, DAEstatus &dstatus)
 
int disableBlockTransfers (ViSession session, DAEstatus &dstatus)
 
int restoreTransferMode (ViSession session, int mode, DAEstatus &dstatus)
 
int reinit (DAEstatus &dstatus)
 
template<typename F , typename T >
int retrySingle (F pFunc, unsigned long address, T data, TransferProps props, DAEstatus &dstatus)
 
template<typename F , typename T >
int retryBlock (F pFunc, unsigned long address, T data, long nitems, TransferProps props, DAEstatus &dstatus)
 
int readU16impl (unsigned long address, isisU16_t *data16, TransferProps props, DAEstatus &dstatus)
 
int readU32impl (unsigned long address, isisU32_t *data32, TransferProps props, DAEstatus &dstatus)
 
int readBlockU16impl (unsigned long address, isisU16_t *data16, long nitems, TransferProps props, DAEstatus &dstatus)
 
int readBlockU32impl (unsigned long address, isisU32_t *data32, long nitems, TransferProps props, DAEstatus &dstatus)
 
int readBlockU64impl (unsigned long address, uint64_t *data64, long nitems, TransferProps props, DAEstatus &dstatus)
 
int writeU16impl (unsigned long address, isisU16_t data16, TransferProps props, DAEstatus &dstatus)
 
int writeU32impl (unsigned long address, isisU32_t data32, TransferProps props, DAEstatus &dstatus)
 
int writeBlockU16impl (unsigned long address, isisU16_t *data16, long nitems, TransferProps props, DAEstatus &dstatus)
 
int writeBlockU32impl (unsigned long address, isisU32_t *data32, long nitems, TransferProps props, DAEstatus &dstatus)
 
int writeBlockU64impl (unsigned long address, uint64_t *data64, long nitems, TransferProps props, DAEstatus &dstatus)
 
ViSession getSession (TransferProps props)
 
int onTrigger (time_t the_secs, unsigned short the_ms, ViInt16 trig_id)
 
- Protected Member Functions inherited from ISIS::Base
 Base (const std::string &logger_name="UNKNOWN")
 
void setLoggerName (const std::string &logger_name)
 
virtual ~Base ()
 
virtual std::string loggingPrefix () const
 
void setThisLoggerLevel (int level)
 

Static Protected Member Functions

static ViStatus _VI_FUNCH IOEventHandler (ViSession vi, ViEventType eventType, ViEvent context, ViAddr userHandle)
 
static ViStatus _VI_FUNCH TriggerHandler (ViSession vi, ViEventType eventType, ViEvent context, ViAddr userHandle)
 
- Static Protected Member Functions inherited from ISIS::Base
static void setAllLoggerLevel (int level)
 

Protected Attributes

bool m_init_done
 
bool m_block_transfers
 
ViSession m_default_rm
 
ViSession m_instr_le
 
ViSession m_instr_be
 
ViSession m_instr_le_bt
 
ViSession m_instr_be_bt
 
ViSession m_instr_backplane
 
std::string m_device
 
std::string m_device_bp
 
jobid_map_t m_jobid_map
 
CRITICAL_SECTION m_job_critical
 
CRITICAL_SECTION m_visa_critical
 
trigger_func_tm_trigger_func
 
void * m_trigger_func_arg
 
- Protected Attributes inherited from ISIS::Base
Poco::Logger * m_logger
 
Poco::LogStream * m_logstr
 
Poco::Mutex m_logger_lock
 

Static Protected Attributes

static bool m_endian_workaround = true
 
static const int m_tries = 5
 number of times to try a read/write More...
 
static const int m_retry_time = 1000
 milliseconds between retries More...
 
static char * m_visa_lock_name = NULL
 

Additional Inherited Members

- Public Types inherited from ISISVME
enum  { Error = 0, Success = 1 }
 
enum  TransferProp {
  TransferNoOptions = 0x0, TransferBlock = 0x1, TransferLittleEndian = 0x2, TransferMemorySpace = 0x4,
  TransferIORegisterSpace = 0x8, TransferLUTSpace = 0x10, TransferRunMemorySpace = 0x20
}
 
typedef uint32_t TransferProps
 combination of TransferProp values More...
 

Detailed Description

Definition at line 7 of file nivisa.h.

Member Typedef Documentation

typedef std::map<ViJobId, ViStatus> NIVisa::jobid_map_t
protected

Definition at line 23 of file nivisa.h.

Constructor & Destructor Documentation

NIVisa::NIVisa ( DAEstatus dstatus)

Definition at line 79 of file nivisa.cpp.

References m_job_critical, m_visa_critical, reinit(), and ISIS::Base::setLoggerName().

NIVisa::~NIVisa ( )
virtual

Definition at line 1241 of file nivisa.cpp.

References close(), m_default_rm, m_job_critical, and m_visa_critical.

Member Function Documentation

int NIVisa::addError ( ViSession  session,
const char *  func,
ViStatus  status,
const std::string &  message,
DAEstatus dstatus 
)
protected
int NIVisa::addError ( ViSession  session,
const char *  func,
ViStatus  status,
unsigned long  address,
long  nitems,
const std::string &  message,
DAEstatus dstatus 
)
protected

Definition at line 1264 of file nivisa.cpp.

References DAEstatus::add(), ERRTYPE_NIVISA, FAC_NIVISA, printError(), and SEV_ERROR.

int NIVisa::addJobid ( ViJobId  jobId,
ViStatus  vi_status 
)

Definition at line 140 of file nivisa.cpp.

References m_job_critical, and m_jobid_map.

Referenced by IOEventHandler().

int NIVisa::close ( DAEstatus status)
virtual
const char* NIVisa::device ( )
inlinevirtual

Implements ISISVME.

Definition at line 95 of file nivisa.h.

References m_device.

Referenced by open().

const char* NIVisa::deviceBackplane ( )
inline

Definition at line 96 of file nivisa.h.

References m_device_bp.

int NIVisa::disableBlockTransfers ( ViSession  session,
DAEstatus dstatus 
)
protected

Definition at line 1043 of file nivisa.cpp.

References addError(), ISISVME::Error, and ISISVME::Success.

int NIVisa::enableBlockTransfers ( ViSession  session,
DAEstatus dstatus 
)
protected

Definition at line 1018 of file nivisa.cpp.

References addError(), ISISVME::Error, m_block_transfers, and ISISVME::Success.

Referenced by open().

ViSession NIVisa::getSession ( TransferProps  props)
protected
bool NIVisa::initOK ( )
virtual

Implements ISISVME.

Definition at line 88 of file nivisa.cpp.

References m_init_done.

ViStatus _VI_FUNCH NIVisa::IOEventHandler ( ViSession  vi,
ViEventType  eventType,
ViEvent  context,
ViAddr  userHandle 
)
staticprotected

Definition at line 147 of file nivisa.cpp.

References addJobid().

Referenced by open().

int NIVisa::lockDevice ( int  timeout,
DAEstatus dstatus 
)
virtual

Implements ISISVME.

Definition at line 425 of file nivisa.cpp.

References addError(), ISISVME::Error, m_instr_le, m_visa_lock_name, and ISISVME::Success.

Referenced by open().

void NIVisa::lockInterface ( int  timeout,
DAEstatus dstatus 
)
virtual

Implements ISISVME.

Definition at line 69 of file nivisa.cpp.

References VisaAccessLock::lockExclusive().

int NIVisa::onTrigger ( time_t  the_secs,
unsigned short  the_ms,
ViInt16  trig_id 
)
protected

Definition at line 182 of file nivisa.cpp.

References m_trigger_func, m_trigger_func_arg, and ISISVME::Success.

Referenced by TriggerHandler().

int NIVisa::open ( const char *  device,
DAEstatus dstatus 
)
virtual
int NIVisa::openBackplane ( const char *  device_bp,
DAEstatus dstatus 
)
virtual
int NIVisa::printError ( ViSession  session,
const char *  func,
ViStatus  status,
std::ostream &  os 
)
protected

Definition at line 1274 of file nivisa.cpp.

Referenced by addError().

int NIVisa::printError ( ViSession  session,
const char *  func,
ViStatus  status,
unsigned long  address,
long  nitems,
std::ostream &  os 
)
protected

Definition at line 1288 of file nivisa.cpp.

int NIVisa::readBlock ( unsigned long  address,
isisU32_t data,
long  nitems,
TransferProps  props,
DAEstatus status 
)
virtual

Implements ISISVME.

Definition at line 1316 of file nivisa.cpp.

References readBlockU32().

int NIVisa::readBlock ( unsigned long  address,
uint64_t *  data,
long  nitems,
TransferProps  props,
DAEstatus status 
)
virtual

Implements ISISVME.

Definition at line 1321 of file nivisa.cpp.

References readBlockU64().

int NIVisa::readBlockU16 ( unsigned long  address,
isisU16_t data16,
long  nitems,
TransferProps  props,
DAEstatus dstatus 
)
virtual

Implements ISISVME.

Definition at line 593 of file nivisa.cpp.

References readBlockU16impl(), and retryBlock().

int NIVisa::readBlockU16impl ( unsigned long  address,
isisU16_t data16,
long  nitems,
TransferProps  props,
DAEstatus dstatus 
)
protected

Definition at line 601 of file nivisa.cpp.

References addError(), ISISVME::Error, getSession(), nitems_max_default, and ISISVME::Success.

Referenced by readBlockU16().

int NIVisa::readBlockU32 ( unsigned long  address,
isisU32_t data32,
long  nitems,
TransferProps  props,
DAEstatus dstatus 
)
virtual

Implements ISISVME.

Definition at line 643 of file nivisa.cpp.

References readBlockU32impl(), and retryBlock().

Referenced by readBlock().

int NIVisa::readBlockU32impl ( unsigned long  address,
isisU32_t data32,
long  nitems,
TransferProps  props,
DAEstatus dstatus 
)
protected
int NIVisa::readBlockU64 ( unsigned long  address,
uint64_t *  data64,
long  nitems,
TransferProps  props,
DAEstatus dstatus 
)

Definition at line 649 of file nivisa.cpp.

References readBlockU64impl(), and retryBlock().

Referenced by readBlock().

int NIVisa::readBlockU64impl ( unsigned long  address,
uint64_t *  data64,
long  nitems,
TransferProps  props,
DAEstatus dstatus 
)
protected

Definition at line 684 of file nivisa.cpp.

References readBlockU32impl().

Referenced by readBlockU64().

int NIVisa::readU16 ( unsigned long  address,
isisU16_t data16,
TransferProps  props,
DAEstatus dstatus 
)
virtual

Implements ISISVME.

Definition at line 535 of file nivisa.cpp.

References readU16impl(), and retrySingle().

int NIVisa::readU16impl ( unsigned long  address,
isisU16_t data16,
TransferProps  props,
DAEstatus dstatus 
)
protected

Definition at line 546 of file nivisa.cpp.

References addError(), ISISVME::Error, getSession(), and ISISVME::Success.

Referenced by readU16(), and readU16noRetry().

int NIVisa::readU16noRetry ( unsigned long  address,
isisU16_t data16,
TransferProps  props,
DAEstatus dstatus 
)
virtual

Implements ISISVME.

Definition at line 540 of file nivisa.cpp.

References readU16impl().

int NIVisa::readU32 ( unsigned long  address,
isisU32_t data32,
TransferProps  props,
DAEstatus dstatus 
)
virtual

Implements ISISVME.

Definition at line 564 of file nivisa.cpp.

References readU32impl(), and retrySingle().

int NIVisa::readU32impl ( unsigned long  address,
isisU32_t data32,
TransferProps  props,
DAEstatus dstatus 
)
protected

Definition at line 574 of file nivisa.cpp.

References addError(), ISISVME::Error, getSession(), m_visa_critical, and ISISVME::Success.

Referenced by readU32(), and readU32noRetry().

int NIVisa::readU32noRetry ( unsigned long  address,
isisU32_t data32,
TransferProps  props,
DAEstatus dstatus 
)
virtual

Implements ISISVME.

Definition at line 569 of file nivisa.cpp.

References readU32impl().

int NIVisa::reinit ( DAEstatus dstatus)
protected
bool NIVisa::resetBus ( DAEstatus status)
virtual

Implements ISISVME.

Definition at line 1156 of file nivisa.cpp.

References addError(), DAEstatus::addInfo(), FAC_NIVISA, m_instr_backplane, and m_visa_critical.

bool NIVisa::resetBusDevice ( const char *  name,
DAEstatus dstatus 
)
protected
int NIVisa::restoreTransferMode ( ViSession  session,
int  mode,
DAEstatus dstatus 
)
protected

Definition at line 1068 of file nivisa.cpp.

References addError(), ISISVME::Error, and ISISVME::Success.

template<typename F , typename T >
int NIVisa::retryBlock ( pFunc,
unsigned long  address,
data,
long  nitems,
TransferProps  props,
DAEstatus dstatus 
)
protected
template<typename F , typename T >
int NIVisa::retrySingle ( pFunc,
unsigned long  address,
data,
TransferProps  props,
DAEstatus dstatus 
)
protected
int NIVisa::scanBus ( DAEstatus status)
virtual
int NIVisa::setEndian ( ViSession  session,
bool  little_endian,
DAEstatus dstatus 
)
protected

Definition at line 984 of file nivisa.cpp.

References addError(), ISISVME::Error, and ISISVME::Success.

Referenced by open().

static void NIVisa::setEndianWorkaround ( bool  endian_workaround)
inlinestatic

Definition at line 99 of file nivisa.h.

References m_endian_workaround.

Referenced by ISISDAE::ISISDAE().

void NIVisa::setTriggerFunc ( trigger_func_t func,
void *  arg 
)
inlinevirtual

Implements ISISVME.

Definition at line 98 of file nivisa.h.

References m_trigger_func, and m_trigger_func_arg.

ViStatus _VI_FUNCH NIVisa::TriggerHandler ( ViSession  vi,
ViEventType  eventType,
ViEvent  context,
ViAddr  userHandle 
)
staticprotected

Definition at line 159 of file nivisa.cpp.

References onTrigger().

Referenced by close(), and openBackplane().

int NIVisa::unlockDevice ( DAEstatus dstatus)
virtual

Implements ISISVME.

Definition at line 455 of file nivisa.cpp.

References addError(), ISISVME::Error, m_instr_le, and ISISVME::Success.

Referenced by close().

void NIVisa::unlockInterface ( DAEstatus dstatus)
virtual

Implements ISISVME.

Definition at line 74 of file nivisa.cpp.

References VisaAccessLock::unlockExclusive().

int NIVisa::writeBlock ( unsigned long  address,
isisU32_t data,
long  nitems,
TransferProps  props,
DAEstatus status 
)
virtual

Implements ISISVME.

Definition at line 1306 of file nivisa.cpp.

References writeBlockU32().

int NIVisa::writeBlock ( unsigned long  address,
uint64_t *  data,
long  nitems,
TransferProps  props,
DAEstatus status 
)
virtual

Implements ISISVME.

Definition at line 1311 of file nivisa.cpp.

References writeBlockU64().

int NIVisa::writeBlockU16 ( unsigned long  address,
isisU16_t data16,
long  nitems,
TransferProps  props,
DAEstatus dstatus 
)
virtual

Implements ISISVME.

Definition at line 850 of file nivisa.cpp.

References retryBlock(), and writeBlockU16impl().

int NIVisa::writeBlockU16impl ( unsigned long  address,
isisU16_t data16,
long  nitems,
TransferProps  props,
DAEstatus dstatus 
)
protected

Definition at line 858 of file nivisa.cpp.

References addError(), ISISVME::Error, getSession(), nitems_max_default, and ISISVME::Success.

Referenced by writeBlockU16().

int NIVisa::writeBlockU32 ( unsigned long  address,
isisU32_t data32,
long  nitems,
TransferProps  props,
DAEstatus dstatus 
)
virtual

Implements ISISVME.

Definition at line 900 of file nivisa.cpp.

References retryBlock(), and writeBlockU32impl().

Referenced by writeBlock().

int NIVisa::writeBlockU32impl ( unsigned long  address,
isisU32_t data32,
long  nitems,
TransferProps  props,
DAEstatus dstatus 
)
protected
int NIVisa::writeBlockU64 ( unsigned long  address,
uint64_t *  data64,
long  nitems,
TransferProps  props,
DAEstatus dstatus 
)

Definition at line 905 of file nivisa.cpp.

References retryBlock(), and writeBlockU64impl().

Referenced by writeBlock().

int NIVisa::writeBlockU64impl ( unsigned long  address,
uint64_t *  data64,
long  nitems,
TransferProps  props,
DAEstatus dstatus 
)
protected

Definition at line 910 of file nivisa.cpp.

References writeBlockU32impl().

Referenced by writeBlockU64().

int NIVisa::writeU16 ( unsigned long  address,
isisU16_t  data16,
TransferProps  props,
DAEstatus dstatus 
)
virtual

Implements ISISVME.

Definition at line 803 of file nivisa.cpp.

References retrySingle(), and writeU16impl().

int NIVisa::writeU16impl ( unsigned long  address,
isisU16_t  data16,
TransferProps  props,
DAEstatus dstatus 
)
protected

Definition at line 808 of file nivisa.cpp.

References addError(), ISISVME::Error, getSession(), and ISISVME::Success.

Referenced by writeU16().

int NIVisa::writeU32 ( unsigned long  address,
isisU32_t  data32,
TransferProps  props,
DAEstatus dstatus 
)
virtual

Implements ISISVME.

Definition at line 826 of file nivisa.cpp.

References retrySingle(), and writeU32impl().

int NIVisa::writeU32impl ( unsigned long  address,
isisU32_t  data32,
TransferProps  props,
DAEstatus dstatus 
)
protected

Definition at line 831 of file nivisa.cpp.

References addError(), ISISVME::Error, getSession(), and ISISVME::Success.

Referenced by writeU32().

Member Data Documentation

bool NIVisa::m_block_transfers
protected

Definition at line 11 of file nivisa.h.

Referenced by enableBlockTransfers(), and open().

ViSession NIVisa::m_default_rm
protected

Definition at line 13 of file nivisa.h.

Referenced by open(), openBackplane(), reinit(), resetBusDevice(), scanBus(), and ~NIVisa().

std::string NIVisa::m_device
protected

Definition at line 19 of file nivisa.h.

Referenced by device(), open(), and reinit().

std::string NIVisa::m_device_bp
protected

Definition at line 20 of file nivisa.h.

Referenced by deviceBackplane(), openBackplane(), and reinit().

bool NIVisa::m_endian_workaround = true
staticprotected

Definition at line 12 of file nivisa.h.

Referenced by open(), readBlockU32impl(), setEndianWorkaround(), and writeBlockU32impl().

bool NIVisa::m_init_done
protected

Definition at line 10 of file nivisa.h.

Referenced by close(), initOK(), and reinit().

ViSession NIVisa::m_instr_backplane
protected

Definition at line 18 of file nivisa.h.

Referenced by close(), openBackplane(), and resetBus().

ViSession NIVisa::m_instr_be
protected

Definition at line 15 of file nivisa.h.

Referenced by close(), getSession(), and open().

ViSession NIVisa::m_instr_be_bt
protected

Definition at line 17 of file nivisa.h.

Referenced by close(), getSession(), and open().

ViSession NIVisa::m_instr_le
protected

Definition at line 14 of file nivisa.h.

Referenced by close(), getSession(), lockDevice(), open(), and unlockDevice().

ViSession NIVisa::m_instr_le_bt
protected

Definition at line 16 of file nivisa.h.

Referenced by close(), getSession(), and open().

CRITICAL_SECTION NIVisa::m_job_critical
protected

Definition at line 25 of file nivisa.h.

Referenced by addJobid(), NIVisa(), readBlockU32impl(), and ~NIVisa().

jobid_map_t NIVisa::m_jobid_map
protected

Definition at line 24 of file nivisa.h.

Referenced by addJobid(), and readBlockU32impl().

const int NIVisa::m_retry_time = 1000
staticprotected

milliseconds between retries

Definition at line 22 of file nivisa.h.

Referenced by retryBlock(), and retrySingle().

const int NIVisa::m_tries = 5
staticprotected

number of times to try a read/write

Definition at line 21 of file nivisa.h.

Referenced by retryBlock(), and retrySingle().

trigger_func_t* NIVisa::m_trigger_func
protected

Definition at line 27 of file nivisa.h.

Referenced by onTrigger(), and setTriggerFunc().

void* NIVisa::m_trigger_func_arg
protected

Definition at line 28 of file nivisa.h.

Referenced by onTrigger(), and setTriggerFunc().

CRITICAL_SECTION NIVisa::m_visa_critical
protected
char * NIVisa::m_visa_lock_name = NULL
staticprotected

Definition at line 62 of file nivisa.h.

Referenced by lockDevice().


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