Main Page | Class Hierarchy | Alphabetical List | Class List | File List | Class Members

CommsDevice Class Reference

#include <comms_device.h>

Inheritance diagram for CommsDevice:

Dataset SerialCommsDevice List of all members.

Detailed Description

Provides an abstract base class for Dataset and Gpib.

Author:
Simon Hoyle
Date:
August 2005
Version:
1.0

Definition at line 20 of file comms_device.h.

Public Types

enum  State { IDLE, OFFLINE, ONLINE }
 Device state.

Public Member Functions

virtual void clear ()
 Clears the CommsDevice and/or its communications bus.
virtual int cmd (int addr, int val)
 Send a command request.
 CommsDevice (const char *id)
 Constructor.
virtual const char * getErrMsg (int code)=0
 Convert an error code to an error message.
const char * getID ()
 Retrieve the identifier.
State getState ()
 Retrieve the current state.
virtual int init (int addr)
 Initialiser.
virtual int mon (int addr, float *volts)
 Send a monitor request.
virtual int mon (int addr, int *val, int timeOut)
 Send a monitor request.
virtual int mon (int addr, int *val)
 Send a monitor request.

Static Public Member Functions

static const char * getUT ()
 Read the current Universal Coordinated Time.

Protected Member Functions

void clearTimeoutErr ()
void flagTimeoutErr ()
 Flag a timeout.

Protected Attributes

const char * id
 Short identifier.
State state
 Current instrument state.


Constructor & Destructor Documentation

CommsDevice::CommsDevice const char *  id  )  [inline]
 

Constructor.

Parameters:
id A short identifier.

Definition at line 31 of file comms_device.h.


Member Function Documentation

virtual void CommsDevice::clear  )  [inline, virtual]
 

Clears the CommsDevice and/or its communications bus.

Note:
Method is a no-op in this class.

Reimplemented in Dataset.

Definition at line 88 of file comms_device.h.

virtual const char* CommsDevice::getErrMsg int  code  )  [pure virtual]
 

Convert an error code to an error message.

Parameters:
code An error code returned by another method of this class.
Returns:
An error message.
Note:
Method is pure virtual.

Implemented in Dataset, and SerialCommsDevice.

Referenced by MultiplexedMonitorRegister::read(), MonitorRegister::read(), MonitorPoint::read(), and ControlPoint::write().

const char * CommsDevice::getUT  )  [inline, static]
 

Read the current Universal Coordinated Time.

Returns:
UTC in "HH:MM:SS" format.

Definition at line 136 of file comms_device.h.

Referenced by PseudoMonitorPoint::read(), and PseudoControlPoint::write().

virtual int CommsDevice::init int  addr  )  [inline, virtual]
 

Initialiser.

Must be called before other methods.

Parameters:
addr An address that can be read to determine instrument state.
Returns:
Zero for success, negative for error, positive for a warning.
Note:
Method is a no-op in this class.

Reimplemented in Dataset.

Definition at line 41 of file comms_device.h.

Referenced by MonitorPoint::initComms().

virtual int CommsDevice::mon int  addr,
float *  volts
[inline, virtual]
 

Send a monitor request.

Reads analog data.

Parameters:
addr The address to read.
volts Location to store the value read.
Returns:
Zero for success, negative for error, positive for a warning.
Note:
Method is a no-op in this class.

Reimplemented in Dataset.

Definition at line 82 of file comms_device.h.

virtual int CommsDevice::mon int  addr,
int *  val,
int  timeOut
[inline, virtual]
 

Send a monitor request.

Reads digital data or an instrument parameter.

Parameters:
addr The address to read.
val Location to store the value read.
timeOut Timeout value in microseconds.
Returns:
Zero for success, negative for error, positive for a warning.
Note:
Method is a no-op in this class.

Reimplemented in Dataset.

Definition at line 72 of file comms_device.h.

virtual int CommsDevice::mon int  addr,
int *  val
[inline, virtual]
 

Send a monitor request.

Reads digital data or an instrument parameter.

Parameters:
addr The address to read.
val Location to store the value read.
Returns:
Zero for success, negative for error, positive for a warning.
Note:
Method is a no-op in this class.

Reimplemented in Dataset.

Definition at line 61 of file comms_device.h.

Referenced by MonitorRegister::read(), and MonitorPoint::read().


The documentation for this class was generated from the following file:
Generated on Mon Apr 30 13:32:42 2007 for Parkes M & C - PKMC C++ library API by  doxygen 1.4.4