Skip to content
Snippets Groups Projects
Commit f7a4f1ae authored by Xavier ELATTAOUI's avatar Xavier ELATTAOUI
Browse files

SaveRestoreConfiguration command added. (Available only for SCPI Keithley devices)

parent d30f1a50
Branches
Tags
No related merge requests found
......@@ -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.
*/
......
......@@ -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.
*/
......
......@@ -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.
*/
......
......@@ -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);
/**
......
......@@ -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.
*/
......
......@@ -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.
*/
......
......@@ -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.
*/
......
......@@ -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>
......
......@@ -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);
}
......@@ -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( ).");
}
......@@ -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());
}
// ============================================================================
......
......@@ -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);
}
......@@ -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);
}
......@@ -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);
}
......@@ -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);
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment