diff --git a/include/AbstractElectrometerClass.h b/include/AbstractElectrometerClass.h index dd148e8fc86c14044f2dfa92377f4c1b73699933..7d3ca015f541f4b917cc1591962beeb5f3d911f1 100644 --- a/include/AbstractElectrometerClass.h +++ b/include/AbstractElectrometerClass.h @@ -9,9 +9,12 @@ // // $Author: xavela $ // -// $Revision: 1.20 $ +// $Revision: 1.21 $ // // $Log: not supported by cvs2svn $ +// Revision 1.20 2010/06/10 14:36:15 xavela +// cmd switch_off called before any parameters modifications and then locked with switch_on. +// // Revision 1.19 2010/03/17 11:57:04 xavela // VSource control added ! // @@ -144,6 +147,13 @@ public: virtual void local (void); virtual void remote (void); + /** + * \brief Functions to save/restore specifics configuration. + * NOTE : only available fro SCPI devices + */ + virtual void save_configuration(unsigned short memoryIdx); + virtual void restore_configuration(unsigned short memoryIdx); + /** * \brief Electrometer : cmd to get electrometer data. */ diff --git a/include/ElectrometerProtocol.h b/include/ElectrometerProtocol.h index ed90be3be4429cd943b725d117bb08f1a753412d..663ef378577743cb1eb52f65f3fc4f90d7a0814f 100644 --- a/include/ElectrometerProtocol.h +++ b/include/ElectrometerProtocol.h @@ -12,9 +12,12 @@ // // $Author: xavela $ // -// $Revision: 1.13 $ +// $Revision: 1.14 $ // // $Log: not supported by cvs2svn $ +// Revision 1.13 2010/06/10 14:36:15 xavela +// cmd switch_off called before any parameters modifications and then locked with switch_on. +// // Revision 1.12 2009/10/14 15:26:17 xavela // KeithleyMemory leak fixed. // Novelec part updated @@ -116,6 +119,13 @@ public: */ virtual bool build_communicationLink() = 0; + /** + * \brief Functions to save/restore specifics configuration. + * NOTE : only available fro SCPI devices + */ + virtual void save_configuration(unsigned short memoryIdx); + virtual void restore_configuration(unsigned short memoryIdx); + /** * \brief Common Electrometer Functions. */ diff --git a/include/KeithleySCPIProtocol.h b/include/KeithleySCPIProtocol.h index 3f36f9ae63d9893ff32c9b984ebea42f1a1065ff..3ccc5f5edc5702b79bb1c3baf83749b529353de9 100644 --- a/include/KeithleySCPIProtocol.h +++ b/include/KeithleySCPIProtocol.h @@ -49,6 +49,13 @@ public: */ bool build_communicationLink(); + /** + * \brief Functions to save/restore specifics configuration. + * NOTE : only available fro SCPI devices + */ + void save_configuration(unsigned short memoryIdx); + void restore_configuration(unsigned short memoryIdx); + /** * \brief Electrometer Functions. */ diff --git a/include/Keithley_6485.h b/include/Keithley_6485.h index a02dfeb99abb1cc87355099906729515b91014c2..6bc5be69117319c8b7df5ef3e7e078401c9fb24b 100644 --- a/include/Keithley_6485.h +++ b/include/Keithley_6485.h @@ -47,6 +47,12 @@ public: */ bool init_protocol (void); + /** + * \brief Functions to save/restore specifics configuration. + */ + void save_configuration(unsigned short memoryIdx); + void restore_configuration(unsigned short memoryIdx); + std::vector<double> get_integratedValue (void); std::vector<double> get_fetchValue (void); /** diff --git a/include/Keithley_6487.h b/include/Keithley_6487.h index 255aa4926bfbe73868a95d960cb709c737a24f3e..6713834d84936bc99285ea165abfdb63e2b303ed 100644 --- a/include/Keithley_6487.h +++ b/include/Keithley_6487.h @@ -47,6 +47,12 @@ public: */ bool init_protocol (void); + /** + * \brief Functions to save/restore specifics configuration. + */ + void save_configuration(unsigned short memoryIdx); + void restore_configuration(unsigned short memoryIdx); + /** * \brief Device dependent commands. */ diff --git a/include/Keithley_6514.h b/include/Keithley_6514.h index 621116506af2dd18f3a98da41de92dd6a3cdc911..b86225e65d6f028fd533b98789732744b5067cb8 100644 --- a/include/Keithley_6514.h +++ b/include/Keithley_6514.h @@ -47,6 +47,12 @@ public: */ bool init_protocol (void); + /** + * \brief Functions to save/restore specifics configuration. + */ + void save_configuration(unsigned short memoryIdx); + void restore_configuration(unsigned short memoryIdx); + /** * \brief Device dependent commands. */ diff --git a/include/Keithley_6517.h b/include/Keithley_6517.h index 0c8d22abe89e0c69f2cd369520a9269d2f534eb4..3fcb861a46b63ee05c1e724743564eb7a9203636 100644 --- a/include/Keithley_6517.h +++ b/include/Keithley_6517.h @@ -47,6 +47,12 @@ public: */ bool init_protocol (void); + /** + * \brief Functions to save/restore specifics configuration. + */ + void save_configuration(unsigned short memoryIdx); + void restore_configuration(unsigned short memoryIdx); + /** * \brief Device dependent commands. */ diff --git a/pom.xml b/pom.xml index 9e7dc579e04da371948185b6eb9d718d9210a039..fd7bbb70b40a005addf72a6fe17625edca6c2b39 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.5.2-SNAPSHOT</version> + <version>2.5.2</version> <packaging>nar</packaging> <name>Electrometers library</name> <description>Electrometers library</description> diff --git a/src/AbstractElectrometerClass.cpp b/src/AbstractElectrometerClass.cpp index 518722ae3ef64516075dcc86834834c1c2153bbc..4542651ff6e9dfc0c05cc1c48a8593e549304dbe 100644 --- a/src/AbstractElectrometerClass.cpp +++ b/src/AbstractElectrometerClass.cpp @@ -11,9 +11,12 @@ // // $Author: xavela $ // -// $Revision: 1.22 $ +// $Revision: 1.23 $ // // $Log: not supported by cvs2svn $ +// Revision 1.22 2010/06/10 14:36:15 xavela +// cmd switch_off called before any parameters modifications and then locked with switch_on. +// // Revision 1.21 2010/03/17 11:57:03 xavela // VSource control added ! // @@ -811,3 +814,19 @@ unsigned short AbstractElectrometerClass::get_ElectroChannel (void) return _electrometerProtocol->get_electrometer_active_channel(); } +// ============================================================================ +// AbstractElectrometerClass::save_configuration +// ============================================================================ +void AbstractElectrometerClass::save_configuration (unsigned short memoryIdx) +{ + _electrometerProtocol->save_configuration(memoryIdx); +} + +// ============================================================================ +// AbstractElectrometerClass::restore_configuration +// ============================================================================ +void AbstractElectrometerClass::restore_configuration (unsigned short memoryIdx) +{ + _electrometerProtocol->restore_configuration(memoryIdx); +} + diff --git a/src/ElectrometerProtocol.cpp b/src/ElectrometerProtocol.cpp index 63e9ac3d98d22879b0fd5c2b378471a0eaf2afbb..6ab73553c87f6f2abf8f14f9a1f43b3074b98e3a 100644 --- a/src/ElectrometerProtocol.cpp +++ b/src/ElectrometerProtocol.cpp @@ -740,3 +740,23 @@ unsigned short ElectrometerProtocol::get_electrometer_active_channel (void) "ElectrometerProtocol::get_electrometer_active_channel( )."); } +// ============================================================================ +// ElectrometerProtocol::save_configuration +// ============================================================================ +void ElectrometerProtocol::save_configuration (unsigned short) +{ + throw electrometer::ElectrometerException("COMMAND_NOT_SUPPORTED", + "This Electrometer does not support this command.", + "ElectrometerProtocol::save_configuration( )."); +} + +// ============================================================================ +// ElectrometerProtocol::restore_configuration +// ============================================================================ +void ElectrometerProtocol::restore_configuration (unsigned short) +{ + throw electrometer::ElectrometerException("COMMAND_NOT_SUPPORTED", + "This Electrometer does not support this command.", + "ElectrometerProtocol::restore_configuration( )."); +} + diff --git a/src/KeithleySCPIProtocol.cpp b/src/KeithleySCPIProtocol.cpp index 6b3be01ac41acce4d8df0c7866d4e52aa22df4fb..a9e3a31bcc241dc5f8e822ecc02b3e61ce0e7aad 100644 --- a/src/KeithleySCPIProtocol.cpp +++ b/src/KeithleySCPIProtocol.cpp @@ -950,7 +950,30 @@ std::string cmd_to_send("TRAC:FEED:CONT NEXT"); //- send command : Start storing readings _communication_link->write(cmd_to_send); +} +// ============================================================================ +// KeithleySCPIProtocol::save_configuration +// ============================================================================ +void KeithleySCPIProtocol::save_configuration (unsigned short memoryIdx) +{ +std::stringstream cmd_to_send; + + //- send command + cmd_to_send << "*SAV " << memoryIdx << std::endl; + _communication_link->write(cmd_to_send.str()); +} + +// ============================================================================ +// KeithleySCPIProtocol::restore_configuration +// ============================================================================ +void KeithleySCPIProtocol::restore_configuration (unsigned short memoryIdx) +{ +std::stringstream cmd_to_send; + + //- send command + cmd_to_send << "*RCL " << memoryIdx << std::endl; + _communication_link->write(cmd_to_send.str()); } // ============================================================================ diff --git a/src/Keithley_6485.cpp b/src/Keithley_6485.cpp index e379ec155a793e8e9077a626f6f3c3fa66c5f662..1ad4069c01538580bd73591ae48b0972e3098b2b 100644 --- a/src/Keithley_6485.cpp +++ b/src/Keithley_6485.cpp @@ -30,6 +30,8 @@ static const std::string K6485_rangeValue[] = {"2E-9","2E-8","2E-7","2E-6","2E-5 */ static const short K6485_rangeLimit = 7; +static const unsigned short MAX_SAVED_CONFIG = 2; + // ============================================================================ // Keithley_6485::Keithley_6485 // ============================================================================ @@ -324,3 +326,30 @@ void Keithley_6485::init_keithley (void) _electrometerProtocol->init_keithley(); } +// ============================================================================ +// Keithley_6485::save_configuration +// ============================================================================ +void Keithley_6485::save_configuration (unsigned short memoryIdx) +{ + if( memoryIdx > MAX_SAVED_CONFIG ) + { + throw electrometer::ElectrometerException("OUT_OF_RANGE", + "Index of saved configuration must be in the range [0-2].", + "Keithley_6485::save_configuration( )."); + } + _electrometerProtocol->save_configuration(memoryIdx); +} + +// ============================================================================ +// Keithley_6485::restore_configuration +// ============================================================================ +void Keithley_6485::restore_configuration (unsigned short memoryIdx) +{ + if( memoryIdx > MAX_SAVED_CONFIG ) + { + throw electrometer::ElectrometerException("OUT_OF_RANGE", + "Index of saved configuration must be in the range [0-2].", + "Keithley_6485::restore_configuration( )."); + } + _electrometerProtocol->restore_configuration(memoryIdx); +} diff --git a/src/Keithley_6487.cpp b/src/Keithley_6487.cpp index 2d99965e0b091dc2be6fbe03e415f3f836abe6d3..f1fe59cebde741eec9e9a95d6cb4d310af483037 100644 --- a/src/Keithley_6487.cpp +++ b/src/Keithley_6487.cpp @@ -30,6 +30,8 @@ static const std::string K6487_rangeValue[8] = {"2E-2","2E-3","2E-4","2E-5","2E- */ static const short K6487_rangeLimit = 7; +static const unsigned short MAX_SAVED_CONFIG = 2; + // ============================================================================ // Keithley_6487::Keithley_6487 // ============================================================================ @@ -326,3 +328,30 @@ void Keithley_6487::init_keithley (void) _electrometerProtocol->init_keithley(); } +// ============================================================================ +// Keithley_6487::save_configuration +// ============================================================================ +void Keithley_6487::save_configuration (unsigned short memoryIdx) +{ + if( memoryIdx > MAX_SAVED_CONFIG ) + { + throw electrometer::ElectrometerException("OUT_OF_RANGE", + "Index of saved configuration must be in the range [0-2].", + "Keithley_6487::save_configuration( )."); + } + _electrometerProtocol->save_configuration(memoryIdx); +} + +// ============================================================================ +// Keithley_6487::restore_configuration +// ============================================================================ +void Keithley_6487::restore_configuration (unsigned short memoryIdx) +{ + if( memoryIdx > MAX_SAVED_CONFIG ) + { + throw electrometer::ElectrometerException("OUT_OF_RANGE", + "Index of saved configuration must be in the range [0-2].", + "Keithley_6487::restore_configuration( )."); + } + _electrometerProtocol->restore_configuration(memoryIdx); +} diff --git a/src/Keithley_6514.cpp b/src/Keithley_6514.cpp index f5b436363ef8eb18d0361c5787c3e62170e13695..87fd2b2807fb01805d5a31349dfc0b7a159055a0 100644 --- a/src/Keithley_6514.cpp +++ b/src/Keithley_6514.cpp @@ -37,6 +37,8 @@ static const short K6514_VOLT_rangeLimit= 2; static const short K6514_OHM_rangeLimit = 8; static const short K6514_COU_rangeLimit = 3; +static const unsigned short MAX_SAVED_CONFIG = 2; + /* * Trigger Mode limit (millisec) */ @@ -452,3 +454,30 @@ void Keithley_6514::init_keithley (void) _electrometerProtocol->init_keithley(); } +// ============================================================================ +// Keithley_6514::save_configuration +// ============================================================================ +void Keithley_6514::save_configuration (unsigned short memoryIdx) +{ + if( memoryIdx > MAX_SAVED_CONFIG ) + { + throw electrometer::ElectrometerException("OUT_OF_RANGE", + "Index of saved configuration must be in the range [0-2].", + "Keithley_6514::save_configuration( )."); + } + _electrometerProtocol->save_configuration(memoryIdx); +} + +// ============================================================================ +// Keithley_6514::restore_configuration +// ============================================================================ +void Keithley_6514::restore_configuration (unsigned short memoryIdx) +{ + if( memoryIdx > MAX_SAVED_CONFIG ) + { + throw electrometer::ElectrometerException("OUT_OF_RANGE", + "Index of saved configuration must be in the range [0-2].", + "Keithley_6514::restore_configuration( )."); + } + _electrometerProtocol->restore_configuration(memoryIdx); +} diff --git a/src/Keithley_6517.cpp b/src/Keithley_6517.cpp index aa2f2bcac35ee2cc0cc3900d790899bb9c559a58..d0abba2ae03faf5590f39d28722b6c64458eecc7 100644 --- a/src/Keithley_6517.cpp +++ b/src/Keithley_6517.cpp @@ -36,6 +36,8 @@ static const short K6517_VOLT_rangeLimit= 2; static const short K6517_OHM_rangeLimit = 9; static const short K6517_COU_rangeLimit = 3; +static const unsigned short MAX_SAVED_CONFIG = 9; + // ============================================================================ // Keithley_6517::Keithley_6517 // ============================================================================ @@ -595,4 +597,30 @@ void Keithley_6517::auto_zero_off (void) "Keithley_6517::auto_zero_off( )."); } +// ============================================================================ +// Keithley_6517::save_configuration +// ============================================================================ +void Keithley_6517::save_configuration (unsigned short memoryIdx) +{ + if( memoryIdx > MAX_SAVED_CONFIG ) + { + throw electrometer::ElectrometerException("OUT_OF_RANGE", + "Index of saved configuration must be in the range [0-2].", + "Keithley_6487::save_configuration( )."); + } + _electrometerProtocol->save_configuration(memoryIdx); +} +// ============================================================================ +// Keithley_6517::restore_configuration +// ============================================================================ +void Keithley_6517::restore_configuration (unsigned short memoryIdx) +{ + if( memoryIdx > MAX_SAVED_CONFIG ) + { + throw electrometer::ElectrometerException("OUT_OF_RANGE", + "Index of saved configuration must be in the range [0-9].", + "Keithley_6517::restore_configuration( )."); + } + _electrometerProtocol->restore_configuration(memoryIdx); +}