GPIBUSBniInterface Class Reference

Inheritance diagram for GPIBUSBniInterface:

GPIBBaseInterface

List of all members.


Detailed Description

GPIB class interface to drive the National Instruments GPIB-USB-HS Controller.

Author:
Andrea Giachero (Andrea.Giachero@lngs.infn.it)

Public Member Functions

 GPIBUSBniInterface (int board_idx, int primary_add, int secondary_add)
 ctor
virtual ~GPIBUSBniInterface ()
 dtor
virtual bool DoCommand (const std::string &cmd)
 Built GPIB command to send to the device. No answer from the device is expected.
virtual bool DoCommand (const std::string &cmd, std::string &answer)
 Built GPIB command to send to the device. An answer from the device is expected.
virtual bool IsError ()
 return true if an error is occured
bool IsListener ()
 Check the presence of the device.
virtual size_t GetErrorCode ()
 Getter for the error code.
virtual std::string GetErrorMsg ()
 Getter for the error message.
virtual size_t GetStatusCode ()
 Getter for the current status code.
virtual std::string GetStatusMsg ()
 Getter for the status message.
const int GetUnitDescriptor () const
 Getter for the device unit descriptor.

Protected Member Functions

virtual bool Open ()
 Open GPIB device.
virtual bool Close ()
 Close GPIB device.
virtual bool Clear ()
 clean GPIB device

Private Attributes

int f_ud

Constructor & Destructor Documentation

GPIBUSBniInterface::GPIBUSBniInterface ( int  board_idx,
int  primary_add,
int  secondary_add 
)

ctor

Parameters:
board_idx GPIB interface Board Index (GPIB0 = 0, GPIB1 = 1, ...)
primary_add Device primary address
secondary_add Device secondary address
name Device name
vendor Device vendor

References Open().


Member Function Documentation

bool GPIBUSBniInterface::DoCommand ( const std::string &  cmd  )  [virtual]

Built GPIB command to send to the device. No answer from the device is expected.

Parameters:
cmd commad to send
Returns:
true on success, false on failure. In case of failure the error code is set. The error code can be retrieved by mean of GetErrorCode() while the error message can be retrieved by mean of GetErrorMsg()

Implements GPIBBaseInterface.

References GetUnitDescriptor().

bool GPIBUSBniInterface::DoCommand ( const std::string &  cmd,
std::string &  answer 
) [virtual]

Built GPIB command to send to the device. An answer from the device is expected.

Parameters:
cmd commad to send
answer response from the device.
Returns:
true on success, false on failure. In case of failure the error code is set. The error code can be retrieved by mean of GetErrorCode() while the error message can be retrieved by mean of GetErrorMsg()

Implements GPIBBaseInterface.

References GetUnitDescriptor().

bool GPIBUSBniInterface::IsListener (  ) 

Check the presence of the device.

Returns:
if the device is present returns true, false otherwise.

References GPIBBaseInterface::GetPrimaryAddress(), GPIBBaseInterface::GetSecondaryAddress(), and GetUnitDescriptor().

Referenced by Open().

size_t GPIBUSBniInterface::GetErrorCode (  )  [virtual]

Getter for the error code.

Returns:
if an error occured returns the related errorcod

Implements GPIBBaseInterface.

std::string GPIBUSBniInterface::GetErrorMsg (  )  [virtual]

Getter for the error message.

Returns:
if an error occured returns the related error message Otherwise return "No Error"

Implements GPIBBaseInterface.

std::string GPIBUSBniInterface::GetStatusMsg (  )  [virtual]

Getter for the status message.

Returns:
string filled with the current device status

Implements GPIBBaseInterface.

bool GPIBUSBniInterface::Open (  )  [protected, virtual]

Open GPIB device.

Returns:
true on success, false on failure. In case of failure the error code is set. The error code can be retrieved by mean of GetErrorCode() while the error message can be retrieved by mean of GetErrorMsg()

Implements GPIBBaseInterface.

References f_ud, GPIBBaseInterface::GetBoardIndex(), GPIBBaseInterface::GetPrimaryAddress(), GPIBBaseInterface::GetSecondaryAddress(), GetUnitDescriptor(), and IsListener().

Referenced by GPIBUSBniInterface().

bool GPIBUSBniInterface::Close (  )  [protected, virtual]

Close GPIB device.

Returns:
true on success, false on failure. In case of failure the error code is set. The error code can be retrieved by mean of GetErrorCode() while the error message can be retrieved by mean of GetErrorMsg()

Implements GPIBBaseInterface.

References f_ud.

Referenced by ~GPIBUSBniInterface().

bool GPIBUSBniInterface::Clear (  )  [protected, virtual]

clean GPIB device

Returns:
true on success, false on failure. In case of failure the error code is set. The error code can be retrieved by mean of GetErrorCode() while the error message can be retrieved by mean of GetErrorMsg()

Implements GPIBBaseInterface.

References f_ud.


Member Data Documentation

int GPIBUSBniInterface::f_ud [private]

Device unit descriptor.

Referenced by Clear(), Close(), GetUnitDescriptor(), and Open().


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

Generated on Tue Nov 16 10:50:01 2010 for CUORE Software by  doxygen 1.5.6