#include <GPIBController.h>
Inheritance diagram for LibGPIB::GPIBController:
Public Types | |
Typedefs | |
typedef GPIBEquipment* | GPIBEquipmentPtr |
typedef list<GPIBEquipmentPtr> | GPIBEquipmentList |
typedef GPIBEquipmentList::iterator | GPIBEquipmentListIterator |
typedef GPIBEquipmentList::const_iterator | GPIBEquipmentListConstIterator |
Enumerations | |
enum | EOSModeVal { EOS_TERM_READ = (1<<2), EOS_WRITE_EOI = (1<<3), EOS_EIGHT_BIT = (1<<4) } |
All possible EOS modes for a GPIB controller. More... | |
Public Methods | |
Constructors and Destructor | |
GPIBController () | |
The default constructor. More... | |
virtual | ~GPIBController () = 0 |
The default destructor. More... | |
Other Public Methods | |
void | Open () = 0 |
Open the specified GPIBController as a stream. More... | |
void | Close () = 0 |
Close the specified GPIBController stream. More... | |
virtual void | BecomeActiveController (bool synchronously=true) = 0 |
Become the active controller of the bus. More... | |
virtual void | ClearDevice (GPIBEquipment &device) = 0 |
Send a clear signal to a specific device. More... | |
virtual void | SendCommand (GPIBEquipment &device, const string command) = 0 |
Send the specified string to a given device. More... | |
virtual const string | ReadData (GPIBEquipment &device, const int read_bytes) = 0 |
Read data from the specified device. More... | |
virtual void | SetLocal (GPIBEquipment &device) = 0 |
Set the device in local mode. More... | |
virtual void | SetEOSModeAndChar (const EOSModeVal mode, const char eos) = 0 |
Set the EOS mode and character for the specified controller. More... | |
const EOSModeVal | SetEOSMode (const EOSModeVal mode) |
Set the EOS mode for the controller. More... | |
const EOSModeVal | EOSMode () const |
Get the EOS mode for the controller. More... | |
const char | SetEOSChar (const char eos) |
Set the EOS character for the controller. More... | |
const char | EOSChar () const |
Get the current EOS character for the controller. More... | |
void | ConnectDevice (GPIBEquipment& device) |
Connect a specified GPIB equipment to this controller. More... | |
void | DisconnectDevice (GPIBEquipment& device) |
Disconnect the specified device from the controller. | |
void | DisconnectAllDevices () |
Disconnect all device which are currently connected to this controller. | |
Public Attributes | |
friend | GPIBEquipmentBuffer |
The GPIBEquipmentBuffer needs to access the Prefix and Postfix methods which are best put in the protected interface of this class. | |
Static Public Attributes | |
const char | CR = 13 |
The ASCII carriage return character. | |
const char | LF = 10 |
The ASCII linefeed character. | |
Protected Methods | |
virtual ostream& | SendCharPrefix ( const int primary_address, const int secondary_address=0 ) = 0 |
A manipulator called before sending a character to a GPIBEquipment. | |
virtual ostream& | SendCharPostfix ( const int primary_address, const int secondary_address=0 ) = 0 |
A manipulator called after sending a character to a GPIBEquipment. | |
virtual ostream& | ReadCharPrefix ( const int primary_address, const int secondary_address=0 ) = 0 |
A manipulator called before reading a character from a GPIBEquipment. | |
virtual ostream& | ReadCharPostfix ( const int primary_address, const int secondary_address=0) = 0 |
A manipulator called after reading a character from a GPIBEquipment. | |
Private Attributes | |
GPIBEquipmentList | mDeviceList |
List of all the GPIB instruments which are connected to this controller. | |
int | mIOTimeout |
The I/O timeout value. | |
int | mEOIMode |
The EOI mode of the controller. | |
EOSModeVal | mEOSMode |
The EOS mode of the controller. More... | |
char | mEOSChar |
The EOS characters for the controller. |
It provides most of the functionality that is included in the NI-488.2 library from National Instruments. However, the syntax is completely different. Furthermore, this is an abstract class which requires the user to provide routines customized for type of GPIB controller card that is being used (e.g. GPIB-232-CT-A, PCI-GPIB, AT-GPIB, PCMCIA-GPIB, PXI-GPIB, GPIB-ENET etc).
Definition at line 35 of file GPIBController.h.
|
Definition at line 41 of file GPIBController.h.
|
Definition at line 43 of file GPIBController.h.
|
Definition at line 42 of file GPIBController.h.
|
Definition at line 40 of file GPIBController.h.
|
All possible EOS modes for a GPIB controller.
EOS_TERM_READ | Terminate read when EOS is detected. |
EOS_WRITE_EOI | Send EOI with EOS on write. |
EOS_EIGHT_BIT | Compare all 8 bits of EOS rather than 7. |
Definition at line 66 of file GPIBController.h.
|
The default constructor.
Sets values for some default parameters such as the EOSMode, EOSChar, EOIMode, and IOTimeout. The default values are:
EOS Mode | EOS_TERM_READ |
EOS Character | '\n' |
EOI Mode | 0 (none) |
IO Timeout | 0 (none) |
Definition at line 375 of file GPIBController.h.
|
The default destructor.
Disconnects all devices connected to the controller. The destructor is made pure virtual so that this class will be an abstract class.
Definition at line 385 of file GPIBController.h.
|
Become the active controller of the bus.
synchronously | If true then the controller becomes the active controller synchronously. Otherwise, the controller takes over the bus immediately. |
Reimplemented in LibGPIB::GPIB_232_CT_A.
|
Send a clear signal to a specific device.
device | The GPIB instrument to which the clear signal is to be sent. |
Reimplemented in LibGPIB::GPIB_232_CT_A.
|
Close the specified GPIBController stream.
No communications can occur once the GPIBController stream is closed.
Reimplemented in LibGPIB::GPIB_232_CT_A.
|
Connect a specified GPIB equipment to this controller.
device | This device will be connected to this controller. |
|
Disconnect all device which are currently connected to this controller.
|
Disconnect the specified device from the controller.
|
Get the current EOS character for the controller.
Definition at line 410 of file GPIBController.h.
|
Get the EOS mode for the controller.
Definition at line 398 of file GPIBController.h.
|
Open the specified GPIBController as a stream.
This should be called after setting all the parameters of the GPIBController subclass which are essential to communicate with the controller. For example, in the case of the GPIB-232-CT-A box, the parameters of the serial port associated with the box should be set before calling this method.
Reimplemented in LibGPIB::GPIB_232_CT_A.
|
A manipulator called after reading a character from a GPIBEquipment.
Reimplemented in LibGPIB::GPIB_232_CT_A.
|
A manipulator called before reading a character from a GPIBEquipment.
Reimplemented in LibGPIB::GPIB_232_CT_A.
|
Read data from the specified device.
device |
The instrument from which data is to be read.
|
Reimplemented in LibGPIB::GPIB_232_CT_A.
|
A manipulator called after sending a character to a GPIBEquipment.
Reimplemented in LibGPIB::GPIB_232_CT_A.
|
A manipulator called before sending a character to a GPIBEquipment.
Reimplemented in LibGPIB::GPIB_232_CT_A.
|
Send the specified string to a given device.
device | The device to which the command will be sent. |
command | The command to be sent to the device. |
Reimplemented in LibGPIB::GPIB_232_CT_A.
|
Set the EOS character for the controller.
eos |
The EOS character will be set to this value.
|
Definition at line 403 of file GPIBController.h.
|
Set the EOS mode for the controller.
mode |
The EOS mode will be set to this value.
|
Definition at line 391 of file GPIBController.h.
|
Set the EOS mode and character for the specified controller.
mode | The EOS mode will be set to this value. |
eos | The EOS character. |
Reimplemented in LibGPIB::GPIB_232_CT_A.
|
Set the device in local mode.
device | The instrument to be set in local mode. |
read_bytes | The number of bytes to be read from the rd command |
Reimplemented in LibGPIB::GPIB_232_CT_A.
|
|
The GPIBEquipmentBuffer needs to access the Prefix and Postfix methods which are best put in the protected interface of this class.
Definition at line 292 of file GPIBController.h.
|
|
List of all the GPIB instruments which are connected to this controller.
Definition at line 339 of file GPIBController.h.
|
|
|
The EOS mode of the controller.
If this is zero then the EOS configuration is disabled. The possible values of EOS mode are part of enum EOSModeVal. These are:
EOS_TERM_READ Terminate read when EOS is detected. EOS_WRITE_EOI Send EOI with EOS on write. EOS_EIGHT_BIT Compare all 8 bits of EOS rather than 7.
These values can be ORed together to select the actual EOS mode.
Definition at line 362 of file GPIBController.h.
|