diff --git a/include/AbstractElectrometerClass.h b/include/AbstractElectrometerClass.h index b625e1c24ef8bad61bf97922ac2c42862596298a..a8fac2ce28313815715be72e49dcef5de4d26c12 100644 --- a/include/AbstractElectrometerClass.h +++ b/include/AbstractElectrometerClass.h @@ -9,9 +9,13 @@ // // $Author: xavela $ // -// $Revision: 1.9 $ +// $Revision: 1.10 $ // // $Log: not supported by cvs2svn $ +// Revision 1.9 2008/02/15 10:17:55 xavela +// xavier : +// - command abort added for SCPI Keithleys +// // Revision 1.8 2008/02/15 10:15:16 xavela // xavier : // - command abort added for SCPI Keithleys @@ -140,7 +144,8 @@ public: virtual void start_storing (void); void enable_SRQBufferFull (void); void disable_SRQBufferFull (void); - virtual bool readStatusByteRegister (void); //- used to know if the integration cycle is done! + virtual bool SRQLineState (void); //- used to know if the integration cycle is done! + virtual short readStatusByteRegister (void); //- device status byte register value on SRQ! bool get_overloadRangeState (void); //- used to know if the device range is overloaded (DDC Keithley ONLY)! virtual void set_buffer_size (short); virtual void set_triggerMode (short); diff --git a/include/CommunicationLink.h b/include/CommunicationLink.h index a5172dff52fb960cfe3d5fbe6b09b5795461becc..0cf7976a62201d9f2e023da46ff06ff39bbcd719 100644 --- a/include/CommunicationLink.h +++ b/include/CommunicationLink.h @@ -12,9 +12,13 @@ // // $Author: xavela $ // -// $Revision: 1.4 $ +// $Revision: 1.5 $ // // $Log: not supported by cvs2svn $ +// Revision 1.4 2008/02/15 10:17:55 xavela +// xavier : +// - command abort added for SCPI Keithleys +// // Revision 1.3 2008/02/13 15:51:44 xavela // xavier : // - Integration Mode available for DDC/SCPI devices @@ -98,7 +102,8 @@ public : * * \throws Tango::DevFailed */ - virtual bool isSRQLineUp(void); + virtual bool SRQLineState (void); //- used to know if the integration cycle is done! + virtual short readStatusByteRegister (void); //- device status byte register value on SRQ! /** * \brief Clear a specific device (same as reset *RST). diff --git a/include/ElectrometerProtocol.h b/include/ElectrometerProtocol.h index c81453dcb80ceb1096dbad5b0a6de0406beb8d48..ca10570586b4ed599c94b0d117151170f4cb773f 100644 --- a/include/ElectrometerProtocol.h +++ b/include/ElectrometerProtocol.h @@ -12,9 +12,13 @@ // // $Author: xavela $ // -// $Revision: 1.8 $ +// $Revision: 1.9 $ // // $Log: not supported by cvs2svn $ +// Revision 1.8 2008/02/15 10:17:55 xavela +// xavier : +// - command abort added for SCPI Keithleys +// // Revision 1.7 2008/02/15 10:15:16 xavela // xavier : // - command abort added for SCPI Keithleys @@ -103,8 +107,9 @@ public: virtual std::string get_range(void) = 0; virtual std::vector<double> get_integratedValue (void); virtual std::vector<double> get_fetchValue (void); - virtual bool readStatusByteRegister (void); //- used to know if the integration cycle is done! - virtual bool get_overloadRangeState (void); //- used to know if the device range is overloaded! + virtual bool SRQLineState (void); //- used to know if the integration cycle is done! + virtual short readStatusByteRegister (void); //- device status byte register value on SRQ! + virtual bool get_overloadRangeState (void); //- used to know if the device range is overloaded! /** * \brief Common Get Raw Electrometer Status. diff --git a/include/KeithleyDDCProtocol.h b/include/KeithleyDDCProtocol.h index 2c7777c540ec5c813bac46b4ab45fd1732b17d49..fb36ef7f5e7833c12e1ec2225a7f0cea1cfc50e6 100644 --- a/include/KeithleyDDCProtocol.h +++ b/include/KeithleyDDCProtocol.h @@ -63,7 +63,11 @@ public: // void local (void); // To be implemented in future library versions // void remote (void); - bool readStatusByteRegister (void); //- used to know if the integration cycle is done! + /** + * \brief Electrometer : cmd used to know if the integration cycle is done! + */ + virtual bool SRQLineState (void); //- used to know if the integration cycle is done! + virtual short readStatusByteRegister (void); //- device status byte register value on SRQ! /** * \brief Electrometer : cmd to get electrometer data. diff --git a/include/KeithleySCPIProtocol.h b/include/KeithleySCPIProtocol.h index 14fd1ecfd82505cab2d92e8188edcf59f6d16cf2..46e6a7cbbe0b163da66f368d679c6ee72d1dd21c 100644 --- a/include/KeithleySCPIProtocol.h +++ b/include/KeithleySCPIProtocol.h @@ -80,7 +80,8 @@ public: /** * \brief Electrometer : cmd used to know if the integration cycle is done! */ - bool readStatusByteRegister (void); + bool SRQLineState (void); //- used to know if the integration cycle is done! + short readStatusByteRegister (void); //- device status byte register value on SRQ! void init_keithley (void); //- start operation(s) void abort (void); //- cancel only all operation(s) started by init_keithley() diff --git a/include/TangoGpibLink.h b/include/TangoGpibLink.h index 37066ed8a7f87aeaabbb0c3b39c121e0e6a19422..fbe53b6a49bcf0c96efcbe0bd40c7b14a81d4fb4 100644 --- a/include/TangoGpibLink.h +++ b/include/TangoGpibLink.h @@ -74,7 +74,8 @@ public : * * \throws Tango::DevFailed */ - bool isSRQLineUp(void) throw (Tango::DevFailed); + bool SRQLineState (void); //- used to know if the integration cycle is done! + short readStatusByteRegister (void); //- device status byte register value on SRQ! /** * \brief Clear a specific device (same as reset *RST). diff --git a/src/AbstractElectrometerClass.cpp b/src/AbstractElectrometerClass.cpp index 3b86624187e5a0071f650ce6a163ad746401a9a9..978449206450569a5ed088ec9e112fd43eca28bb 100644 --- a/src/AbstractElectrometerClass.cpp +++ b/src/AbstractElectrometerClass.cpp @@ -11,9 +11,13 @@ // // $Author: xavela $ // -// $Revision: 1.10 $ +// $Revision: 1.11 $ // // $Log: not supported by cvs2svn $ +// Revision 1.10 2008/02/15 10:17:57 xavela +// xavier : +// - command abort added for SCPI Keithleys +// // Revision 1.9 2008/02/15 10:15:18 xavela // xavier : // - command abort added for SCPI Keithleys @@ -499,10 +503,18 @@ void AbstractElectrometerClass::disable_SRQBufferFull (void) _electrometerProtocol->disable_SRQBufferFull(); } +// ============================================================================ +// AbstractElectrometerClass::SRQLineState +// ============================================================================ +bool AbstractElectrometerClass::SRQLineState (void) +{ + return _electrometerProtocol->SRQLineState(); +} + // ============================================================================ // AbstractElectrometerClass::readStatusByteRegister // ============================================================================ -bool AbstractElectrometerClass::readStatusByteRegister (void) +short AbstractElectrometerClass::readStatusByteRegister (void) { return _electrometerProtocol->readStatusByteRegister(); } diff --git a/src/CommunicationLink.cpp b/src/CommunicationLink.cpp index d03cf87c649f7dfffea1d824409a9d746f3fd21f..b6056fd8178ec6ec2e7b84e8bdd455f9a9810397 100644 --- a/src/CommunicationLink.cpp +++ b/src/CommunicationLink.cpp @@ -12,9 +12,13 @@ // // $Author: xavela $ // -// $Revision: 1.4 $ +// $Revision: 1.5 $ // // $Log: not supported by cvs2svn $ +// Revision 1.4 2008/02/15 10:17:57 xavela +// xavier : +// - command abort added for SCPI Keithleys +// // Revision 1.3 2008/02/13 15:51:44 xavela // xavier : // - Integration Mode available for DDC/SCPI devices @@ -63,13 +67,23 @@ CommunicationLink::~CommunicationLink (void) } // ============================================================================ -// CommunicationLink::isSRQLineUp +// CommunicationLink::SRQLineState // ============================================================================ -bool CommunicationLink::isSRQLineUp (void) +bool CommunicationLink::SRQLineState (void) { throw electrometer::ElectrometerException("COMMAND_NOT_SUPPORTED", "This protocol cannot check the SRQ line state.", - "CommunicationLink::isSRQLineUp( )."); + "CommunicationLink::SRQLineState( )."); +} + +// ============================================================================ +// CommunicationLink::readStatusByteRegister +// ============================================================================ +short CommunicationLink::readStatusByteRegister (void) +{ + throw electrometer::ElectrometerException("COMMAND_NOT_SUPPORTED", + "This protocol cannot check the device staus byte register.", + "CommunicationLink::readStatusByteRegister( )."); } // ============================================================================ diff --git a/src/ElectrometerProtocol.cpp b/src/ElectrometerProtocol.cpp index 4ebd5164f4d9dafcb5beea4ddf2077771e8dfaa6..bc80d45c1ec8e17fc0def27a833a0377675c425e 100644 --- a/src/ElectrometerProtocol.cpp +++ b/src/ElectrometerProtocol.cpp @@ -600,10 +600,20 @@ void ElectrometerProtocol::disable_SRQBufferFull (void) "ElectrometerProtocol::disable_SRQBufferFull( )."); } +// ============================================================================ +// ElectrometerProtocol::SRQLineState +// ============================================================================ +bool ElectrometerProtocol::SRQLineState (void) +{ + throw electrometer::ElectrometerException("COMMAND_NOT_SUPPORTED", + "This Electrometer does not support this command.", + "ElectrometerProtocol::SRQLineState( )."); +} + // ============================================================================ // ElectrometerProtocol::readStatusByteRegister // ============================================================================ -bool ElectrometerProtocol::readStatusByteRegister (void) +short ElectrometerProtocol::readStatusByteRegister (void) { throw electrometer::ElectrometerException("COMMAND_NOT_SUPPORTED", "This Electrometer does not support this command.", diff --git a/src/KeithleyDDCProtocol.cpp b/src/KeithleyDDCProtocol.cpp index 1673162a653a6216dc9bb1aed08794e03990a264..dec49ae6cac2fe316e4e144d2857b3b160034871 100644 --- a/src/KeithleyDDCProtocol.cpp +++ b/src/KeithleyDDCProtocol.cpp @@ -466,13 +466,22 @@ std::string cmd_to_send("M0X"); } +// ============================================================================ +// KeithleyDDCProtocol::SRQLineState() +// ============================================================================ +bool KeithleyDDCProtocol::SRQLineState (void) +{ + //- if asserted -> the programmed event occurs : the device can be asked ! + return _communication_link->SRQLineState(); +} + // ============================================================================ // KeithleyDDCProtocol::readStatusByteRegister() // ============================================================================ -bool KeithleyDDCProtocol::readStatusByteRegister (void) +short KeithleyDDCProtocol::readStatusByteRegister (void) { //- if asserted -> the programmed event occurs : the device can be asked ! - return _communication_link->isSRQLineUp(); + return _communication_link->readStatusByteRegister(); } // ============================================================================ diff --git a/src/KeithleySCPIProtocol.cpp b/src/KeithleySCPIProtocol.cpp index 2bb5ccbbafef96590419a307144b65d1ee3cc6c0..0ed5eb565ec752e6edf89c9286be4a53e0b801f6 100644 --- a/src/KeithleySCPIProtocol.cpp +++ b/src/KeithleySCPIProtocol.cpp @@ -826,12 +826,24 @@ std::string cmd_to_send("STAT:MEAS?"); } // ============================================================================ -// KeithleySCPIProtocol::readStatusByteRegister() +// KeithleySCPIProtocol::SRQLineState() // ============================================================================ -bool KeithleySCPIProtocol::readStatusByteRegister (void) +bool KeithleySCPIProtocol::SRQLineState (void) { //- if asserted -> the programmed event occurs : the device can be asked ! - return _communication_link->isSRQLineUp(); + return _communication_link->SRQLineState(); + + //- Cf Keithley doc to know how the to get the wanted event + //- Chapter : Status Structure +} + +// ============================================================================ +// KeithleySCPIProtocol::readStatusByteRegister() +// ============================================================================ +short KeithleySCPIProtocol::readStatusByteRegister (void) +{ + //- if SRQ line UP -> the programmed event(s) occurs : the value is available ! + return _communication_link->readStatusByteRegister(); //- Cf Keithley doc to know how the to get the wanted event //- Chapter : Status Structure diff --git a/src/Makefile.vc b/src/Makefile.vc index a398570c0000dbcb42bd49f24ab70b35a499ff46..2e4aef0f58c1fd703c61edb7c34aa5a7450aaddf 100644 --- a/src/Makefile.vc +++ b/src/Makefile.vc @@ -11,7 +11,7 @@ INCUSER= LIBUSER= # Si vous souhaitez g�n�rer une librairie et pas un executable # decommentez la ligne suivante -LIBRARY_NAME= ..\lib\Electrometers.lib +LIBRARY_NAME= ..\lib\Electrometers_new.lib # # Le chemin ou j'ai d'autres fichiers sources que ceux du DeviceServer � compiler CPPDIRUSER= diff --git a/src/TangoGpibLink.cpp b/src/TangoGpibLink.cpp index eae8ff6d553b598b60287257bac19b17c42fe891..1ce95d57da0de2e61b49a0bc26fb41825eba09e6 100644 --- a/src/TangoGpibLink.cpp +++ b/src/TangoGpibLink.cpp @@ -164,9 +164,9 @@ std::string TangoGpibLink::write_read (std::string command_to_send) throw (Tango } // ============================================================================ -// TangoGpibLink::isSRQLineUp +// TangoGpibLink::SRQLineState // ============================================================================ -bool TangoGpibLink::isSRQLineUp (void) throw (Tango::DevFailed) +bool TangoGpibLink::SRQLineState (void) throw (Tango::DevFailed) { TangoSys_OMemStream description; bool result = false; @@ -177,7 +177,7 @@ bool TangoGpibLink::isSRQLineUp (void) throw (Tango::DevFailed) try { //- try - this->_gpib_proxy->read_attribute("isSRQLineAsserted", result); + this->_gpib_proxy->command_out("IsSRQLineUP", result); return result; } @@ -188,7 +188,38 @@ bool TangoGpibLink::isSRQLineUp (void) throw (Tango::DevFailed) Tango::Except::re_throw_exception (df, (const char*)"COMMUNICATION_ERROR", description.str(), - (const char*)"TangoGpibLink::isSRQLineUp"); + (const char*)"TangoGpibLink::SRQLineState"); + + } + +} + +// ============================================================================ +// TangoGpibLink::readStatusByteRegister +// ============================================================================ +short TangoGpibLink::readStatusByteRegister (void) throw (Tango::DevFailed) +{ + TangoSys_OMemStream description; + short result = -1; + + if(!_is_gpib_proxy_created) + create_gpib_proxy(); + + try + { + //- try + this->_gpib_proxy->read_attribute("statusByteRegister", result); + return result; + + } + catch(Tango::DevFailed& df ) + { + description << "Unable to get device status byte register." << ends; + + Tango::Except::re_throw_exception (df, + (const char*)"COMMUNICATION_ERROR", + description.str(), + (const char*)"TangoGpibLink::readStatusByteRegister"); }