diff --git a/include/AbstractElectrometerClass.h b/include/AbstractElectrometerClass.h index 0363a865a0ac7fa2bfcbc0b19723a661de9923a7..f71fafb01756b4551d417a57fdfd18049478a3e9 100644 --- a/include/AbstractElectrometerClass.h +++ b/include/AbstractElectrometerClass.h @@ -9,9 +9,12 @@ // // $Author: xavela $ // -// $Revision: 1.18 $ +// $Revision: 1.19 $ // // $Log: not supported by cvs2svn $ +// Revision 1.18 2010/03/17 10:00:15 xavela +// VSource output added for K_6517 +// // Revision 1.17 2009/10/14 15:26:17 xavela // KeithleyMemory leak fixed. // Novelec part updated @@ -196,8 +199,14 @@ public: virtual short get_buffer_size (void); virtual short get_triggerMode (void) { return _trigMod;}; + /** + * \brief VSource operations (only for K_6517) + * + */ virtual void enable_VSourceOutput (void); virtual void disable_VSourceOutput(void); + virtual void set_VSourceValue (double volts); + virtual double get_VSourceValue (void); /** * \brief Novelec Electrometer methods diff --git a/include/KeithleySCPIProtocol.h b/include/KeithleySCPIProtocol.h index 5db7ccee130052097c564bd0c2bb7fc7d133547f..3f36f9ae63d9893ff32c9b984ebea42f1a1065ff 100644 --- a/include/KeithleySCPIProtocol.h +++ b/include/KeithleySCPIProtocol.h @@ -74,8 +74,13 @@ public: void setVoltMeterMode (void); void setOhmMeterMode (void); void setCoulombMeterMode(void); + /** + * \brief VSource operations. + */ void setVSourceOutputON (void); void setVSourceOutputOFF(void); + void setVSourceValue (double volts); + std::string getVSourceValue (void); /** * \brief Electrometer : cmd to get electrometer data. diff --git a/include/Keithley_6517.h b/include/Keithley_6517.h index 11aad3ec27504e3bf327f5914bd589c2755cd567..0c8d22abe89e0c69f2cd369520a9269d2f534eb4 100644 --- a/include/Keithley_6517.h +++ b/include/Keithley_6517.h @@ -89,6 +89,8 @@ public: */ void enable_VSourceOutput (void); void disable_VSourceOutput(void); + void set_VSourceValue (double volts); + double get_VSourceValue (void); //- TODO : // SCPI_Filters* _ddcFilters; diff --git a/pom.xml b/pom.xml index ab80765296c83fc6192fd8907945ee88dbb214f5..9cfb636b9d548b2708e81f717eea2a8b595e095c 100644 --- a/pom.xml +++ b/pom.xml @@ -8,7 +8,7 @@ </parent> <groupId>fr.soleil.lib</groupId> <artifactId>Electrometers-${aol}-${library}-${mode}</artifactId> - <version>2.4.0</version> + <version>2.5.0</version> <packaging>nar</packaging> <name>Electrometers library</name> <description>Electrometers library</description> diff --git a/src/AbstractElectrometerClass.cpp b/src/AbstractElectrometerClass.cpp index b95edfbd1d452063b41738029f00a649656fc2a4..f55de825666d28dcd7a216fbb547b2a9799a5be7 100644 --- a/src/AbstractElectrometerClass.cpp +++ b/src/AbstractElectrometerClass.cpp @@ -11,9 +11,12 @@ // // $Author: xavela $ // -// $Revision: 1.20 $ +// $Revision: 1.21 $ // // $Log: not supported by cvs2svn $ +// Revision 1.20 2010/03/17 10:00:15 xavela +// VSource output added for K_6517 +// // Revision 1.19 2009/10/14 15:26:17 xavela // KeithleyMemory leak fixed. // Novelec part updated @@ -649,6 +652,26 @@ void AbstractElectrometerClass::disable_VSourceOutput (void) "AbstractElectrometerClass::disable_VSourceOutput( )."); } +// ============================================================================ +// AbstractElectrometerClass::set_VSourceValue +// ============================================================================ +void AbstractElectrometerClass::set_VSourceValue (double) +{ + throw electrometer::ElectrometerException("COMMAND_NOT_SUPPORTED", + "This Electrometer does not support this command.", + "AbstractElectrometerClass::set_VSourceValue( )."); +} + +// ============================================================================ +// AbstractElectrometerClass::get_VSourceValue +// ============================================================================ +double AbstractElectrometerClass::get_VSourceValue (void) +{ + throw electrometer::ElectrometerException("COMMAND_NOT_SUPPORTED", + "This Electrometer does not support this command.", + "AbstractElectrometerClass::get_VSourceValue( )."); +} + // ============================================================================ // AbstractElectrometerClass::get_ElectroMeterPolarity // ============================================================================ diff --git a/src/KeithleySCPIProtocol.cpp b/src/KeithleySCPIProtocol.cpp index eaf2d54bbf0f282368b951a4f44ec9580039dd6b..6b3be01ac41acce4d8df0c7866d4e52aa22df4fb 100644 --- a/src/KeithleySCPIProtocol.cpp +++ b/src/KeithleySCPIProtocol.cpp @@ -332,6 +332,29 @@ std::stringstream cmd_to_send; _communication_link->write(cmd_to_send.str()); } +// ============================================================================ +// KeithleySCPIProtocol::setVSourceValue +// ============================================================================ +void KeithleySCPIProtocol::setVSourceValue (double voltsValue) +{ +std::stringstream cmd_to_send; + + //- send command + cmd_to_send << "SOUR:VOLT " << voltsValue << std::endl; + _communication_link->write(cmd_to_send.str()); +} + +// ============================================================================ +// KeithleySCPIProtocol::getVSourceValue +// ============================================================================ +std::string KeithleySCPIProtocol::getVSourceValue (void) +{ +std::string cmd_to_send("SOUR:VOLT?"); + + //- send command + return _communication_link->write_read(cmd_to_send); +} + // ============================================================================ // KeithleySCPIProtocol::get_mode // ============================================================================ diff --git a/src/Keithley_6517.cpp b/src/Keithley_6517.cpp index f8b35f1fe1227685541778272c9424251d85217b..aa2f2bcac35ee2cc0cc3900d790899bb9c559a58 100644 --- a/src/Keithley_6517.cpp +++ b/src/Keithley_6517.cpp @@ -282,6 +282,33 @@ void Keithley_6517::disable_VSourceOutput (void) _kscpi->setVSourceOutputOFF(); } +// ============================================================================ +// Keithley_6517::set_VSourceValue +// ============================================================================ +void Keithley_6517::set_VSourceValue (double volts) +{ + KeithleySCPIProtocol* _kscpi = dynamic_cast<KeithleySCPIProtocol*>(_electrometerProtocol); + if(_kscpi) + _kscpi->setVSourceValue(volts); +} + +// ============================================================================ +// Keithley_6517::set_VSourceValue +// ============================================================================ +double Keithley_6517::get_VSourceValue (void) +{ + std::string response(""); + double volts; + + KeithleySCPIProtocol* _kscpi = dynamic_cast<KeithleySCPIProtocol*>(_electrometerProtocol); + if(_kscpi) + response = _kscpi->getVSourceValue(); + + volts = XString<double>::convertFromString(response); + + return volts; +} + // ============================================================================ // Keithley_6517::update_range // ============================================================================