diff --git a/include/TangoGpibLink.h b/include/TangoGpibLink.h index dabfae1efed726c1c0899d451ea1099b0a6792a9..a17c310a64dd76787d94f38641e3323b5cca467b 100644 --- a/include/TangoGpibLink.h +++ b/include/TangoGpibLink.h @@ -37,22 +37,22 @@ class TangoGpibLink : public CommunicationLink public : /** - * Initialization. + * Initialization. */ TangoGpibLink (std::string& gpib_device_name); - + /** * \brief Release resources. */ virtual ~TangoGpibLink (void); - + /** * \brief Send command (data) as string to hardware. * * \throws Tango::DevFailed */ void write(std::string cmd) throw (Tango::DevFailed); - + /** * \brief Gets hardware response as string. * @@ -68,13 +68,13 @@ public : std::string write_read(std::string cmd, size_t readLength=0) throw (Tango::DevFailed); /** - * \brief Returns the Gpib SRQ line state : used here to know if Keithley + * \brief Returns the Gpib SRQ line state : used here to know if Keithley * device is ready after an integration cycle. * * \throws Tango::DevFailed */ - bool SRQLineState (void) throw (Tango::DevFailed); //- used to know if the integration cycle is done! - short readStatusByteRegister (void) throw (Tango::DevFailed); //- device status byte register value on SRQ! + bool SRQLineState (void) throw (Tango::DevFailed); //- used to know if the integration cycle is done! + short readStatusByteRegister (void) throw (Tango::DevFailed); //- device status byte register value on SRQ! /** * \brief Clear a specific device (same as reset *RST). @@ -96,10 +96,8 @@ private : * Creates a proxy on the specified GPIB Device. */ void create_gpib_proxy(void) throw (Tango::DevFailed); - + Tango::DeviceProxy* _gpib_proxy; - - std::string response; }; diff --git a/include/TangoSerialLink.h b/include/TangoSerialLink.h index ac9d7674011da6dc74630bf58d5940aa6d9a48ce..0c7c518f1065b3a4e6e4c4c76ed7391148f6e1be 100644 --- a/include/TangoSerialLink.h +++ b/include/TangoSerialLink.h @@ -34,14 +34,14 @@ class TangoSerialLink : public CommunicationLink { - + public : /** - * \brief Initialization. + * \brief Initialization. */ TangoSerialLink (std::string& serial_device_name); - - /** + + /** * \brief Release resources. */ ~TangoSerialLink (); @@ -80,13 +80,11 @@ private : * Creates a proxy on the specified Serial Device. */ void create_serial_proxy(void) throw (Tango::DevFailed); - + //Tango::DeviceProxyHelper* _serial_proxy; Tango::DeviceProxy* _serial_proxy; bool _is_serial_proxy_created; - - std::string response; }; diff --git a/pom.xml b/pom.xml index dfb1fda3d41c3854f8d7ec151b9bdb3e5e0322e8..dac1eeabf46f880939e5acb140b093e45390fb6f 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.12-SNAPSHOT</version> + <version>2.5.12</version> <packaging>nar</packaging> <name>Electrometers library</name> <description>Electrometers library</description> diff --git a/src/AbstractElectrometerClass.cpp b/src/AbstractElectrometerClass.cpp index 78abaf53f022fc849ccf7d1ec7e75a93106900e6..2cc075f0b3ec4d9c22d267eb5f604ee62c518431 100644 --- a/src/AbstractElectrometerClass.cpp +++ b/src/AbstractElectrometerClass.cpp @@ -152,7 +152,7 @@ AbstractElectrometerClass::AbstractElectrometerClass (std::string comLink_device _electrometerProtocol(0), _size(-1), _trigMod(-1) - + { // std::cout << "AbstractElectrometerClass::AbstractElectrometerClass <-" << std::endl; @@ -179,7 +179,7 @@ AbstractElectrometerClass::~AbstractElectrometerClass (void) // ============================================================================ // AbstractElectrometerClass::operator= // ============================================================================ -AbstractElectrometerClass& AbstractElectrometerClass::operator= (const AbstractElectrometerClass& src) +AbstractElectrometerClass& AbstractElectrometerClass::operator= (const AbstractElectrometerClass& src) { //- no self assign if (this == &src) { @@ -196,7 +196,7 @@ AbstractElectrometerClass& AbstractElectrometerClass::operator= (const AbstractE // ============================================================================ // AbstractElectrometerClass::zero_check_on // ============================================================================ -void AbstractElectrometerClass::zero_check_on (void) +void AbstractElectrometerClass::zero_check_on (void) { //- send command _electrometerProtocol->zero_check_on( ); @@ -204,7 +204,7 @@ void AbstractElectrometerClass::zero_check_on (void) // ============================================================================ // AbstractElectrometerClass::zero_check_off // ============================================================================ -void AbstractElectrometerClass::zero_check_off (void) +void AbstractElectrometerClass::zero_check_off (void) { //- send command _electrometerProtocol->zero_check_off( ); @@ -213,7 +213,7 @@ void AbstractElectrometerClass::zero_check_off (void) // ============================================================================ // AbstractElectrometerClass::zero_correct_on // ============================================================================ -void AbstractElectrometerClass::zero_correct_on (void) +void AbstractElectrometerClass::zero_correct_on (void) { //- send command _electrometerProtocol->zero_correct_on( ); @@ -222,7 +222,7 @@ void AbstractElectrometerClass::zero_correct_on (void) // ============================================================================ // AbstractElectrometerClass::zero_correct_off // ============================================================================ -void AbstractElectrometerClass::zero_correct_off (void) +void AbstractElectrometerClass::zero_correct_off (void) { //- send command _electrometerProtocol->zero_correct_off( ); @@ -231,7 +231,7 @@ void AbstractElectrometerClass::zero_correct_off (void) // ============================================================================ // AbstractElectrometerClass::autoRange_ON // ============================================================================ -void AbstractElectrometerClass::autoRange_on (void) +void AbstractElectrometerClass::autoRange_on (void) { _electrometerProtocol->autoRange_on( ); } @@ -239,7 +239,7 @@ void AbstractElectrometerClass::autoRange_on (void) // ============================================================================ // AbstractElectrometerClass::autoRange_OFF // ============================================================================ -void AbstractElectrometerClass::autoRange_off (void) +void AbstractElectrometerClass::autoRange_off (void) { _electrometerProtocol->autoRange_off( ); } @@ -247,7 +247,7 @@ void AbstractElectrometerClass::autoRange_off (void) // ============================================================================ // AbstractElectrometerClass::auto_zero_on // ============================================================================ -void AbstractElectrometerClass::auto_zero_on (void) +void AbstractElectrometerClass::auto_zero_on (void) { _electrometerProtocol->auto_zero_on( ); } @@ -255,7 +255,7 @@ void AbstractElectrometerClass::auto_zero_on (void) // ============================================================================ // AbstractElectrometerClass::auto_zero_off // ============================================================================ -void AbstractElectrometerClass::auto_zero_off (void) +void AbstractElectrometerClass::auto_zero_off (void) { _electrometerProtocol->auto_zero_off( ); } @@ -263,9 +263,9 @@ void AbstractElectrometerClass::auto_zero_off (void) // ============================================================================ // AbstractElectrometerClass::init_keithley // ============================================================================ -void AbstractElectrometerClass::init_keithley (void) +void AbstractElectrometerClass::init_keithley (void) { - throw electrometer::ElectrometerException("COMMAND_NOT_SUPPORTED", + throw electrometer::ElectrometerException("COMMAND_NOT_SUPPORTED", "This Electrometer does not support this command.", "AbstractElectrometerClass::init_keithley( )."); } @@ -273,7 +273,7 @@ void AbstractElectrometerClass::init_keithley (void) // ============================================================================ // AbstractElectrometerClass::abort // ============================================================================ -void AbstractElectrometerClass::abort (void) +void AbstractElectrometerClass::abort (void) { _electrometerProtocol->abort( ); } @@ -281,9 +281,9 @@ void AbstractElectrometerClass::abort (void) // ============================================================================ // AbstractElectrometerClass::set_knplc // ============================================================================ -void AbstractElectrometerClass::set_knplc (float) +void AbstractElectrometerClass::set_knplc (float) { - throw electrometer::ElectrometerException("COMMAND_NOT_SUPPORTED", + throw electrometer::ElectrometerException("COMMAND_NOT_SUPPORTED", "This Electrometer does not support this command.", "AbstractElectrometerClass::set_knplc( )."); } @@ -291,7 +291,7 @@ void AbstractElectrometerClass::set_knplc (float) // ============================================================================ // AbstractElectrometerClass::get_knplc // ============================================================================ -std::string AbstractElectrometerClass::get_knplc (void) +std::string AbstractElectrometerClass::get_knplc (void) { return _electrometerProtocol->get_knplc( ); } @@ -299,9 +299,9 @@ std::string AbstractElectrometerClass::get_knplc (void) // ============================================================================ // AbstractElectrometerClass::set_triggerMode // ============================================================================ -void AbstractElectrometerClass::set_triggerMode (short) +void AbstractElectrometerClass::set_triggerMode (short) { - throw electrometer::ElectrometerException("COMMAND_NOT_SUPPORTED", + throw electrometer::ElectrometerException("COMMAND_NOT_SUPPORTED", "This Electrometer does not support this command.", "AbstractElectrometerClass::set_triggerMode( )."); } @@ -309,9 +309,9 @@ void AbstractElectrometerClass::set_triggerMode (short) // ============================================================================ // AbstractElectrometerClass::set_triggercount // ============================================================================ -void AbstractElectrometerClass::set_triggercount (short ) +void AbstractElectrometerClass::set_triggercount (short ) { - throw electrometer::ElectrometerException("COMMAND_NOT_SUPPORTED", + throw electrometer::ElectrometerException("COMMAND_NOT_SUPPORTED", "This Electrometer does not support this command.", "AbstractElectrometerClass::set_triggercount( )."); } @@ -319,7 +319,7 @@ void AbstractElectrometerClass::set_triggercount (short ) // ============================================================================ // AbstractElectrometerClass::get_triggercount // ============================================================================ -std::string AbstractElectrometerClass::get_triggercount (void) +std::string AbstractElectrometerClass::get_triggercount (void) { return _electrometerProtocol->get_triggercount( ); } @@ -327,7 +327,7 @@ std::string AbstractElectrometerClass::get_triggercount (void) // ============================================================================ // AbstractElectrometerClass::set_triggerdelay // ============================================================================ -void AbstractElectrometerClass::set_triggerdelay (std::string trigDelStr) +void AbstractElectrometerClass::set_triggerdelay (std::string trigDelStr) { _electrometerProtocol->set_triggerdelay(trigDelStr); } @@ -335,7 +335,7 @@ void AbstractElectrometerClass::set_triggerdelay (std::string trigDelStr) // ============================================================================ // AbstractElectrometerClass::get_triggerdelay // ============================================================================ -std::string AbstractElectrometerClass::get_triggerdelay (void) +std::string AbstractElectrometerClass::get_triggerdelay (void) { return _electrometerProtocol->get_triggerdelay( ); } @@ -343,7 +343,7 @@ std::string AbstractElectrometerClass::get_triggerdelay (void) // ============================================================================ // AbstractElectrometerClass::set_triggerdelayAuto // ============================================================================ -void AbstractElectrometerClass::set_triggerdelayAuto (std::string trigDelAutoStr) +void AbstractElectrometerClass::set_triggerdelayAuto (std::string trigDelAutoStr) { _electrometerProtocol->set_triggerdelayAuto(trigDelAutoStr); } @@ -351,7 +351,7 @@ void AbstractElectrometerClass::set_triggerdelayAuto (std::string trigDelAutoStr // ============================================================================ // AbstractElectrometerClass::get_triggerdelayAuto // ============================================================================ -std::string AbstractElectrometerClass::get_triggerdelayAuto (void) +std::string AbstractElectrometerClass::get_triggerdelayAuto (void) { return _electrometerProtocol->get_triggerdelayAuto( ); } @@ -359,7 +359,7 @@ std::string AbstractElectrometerClass::get_triggerdelayAuto (void) // ============================================================================ // AbstractElectrometerClass::set_averagecount // ============================================================================ -void AbstractElectrometerClass::set_averagecount (std::string averCountStr) +void AbstractElectrometerClass::set_averagecount (std::string averCountStr) { _electrometerProtocol->set_averagecount(averCountStr); } @@ -367,7 +367,7 @@ void AbstractElectrometerClass::set_averagecount (std::string averCountStr) // ============================================================================ // AbstractElectrometerClass::get_averagecount // ============================================================================ -std::string AbstractElectrometerClass::get_averagecount (void) +std::string AbstractElectrometerClass::get_averagecount (void) { return _electrometerProtocol->get_averagecount( ); } @@ -375,7 +375,7 @@ std::string AbstractElectrometerClass::get_averagecount (void) // ============================================================================ // AbstractElectrometerClass::set_averagecontrol // ============================================================================ -void AbstractElectrometerClass::set_averagecontrol (std::string averCtrlStr) +void AbstractElectrometerClass::set_averagecontrol (std::string averCtrlStr) { _electrometerProtocol->set_averagecontrol(averCtrlStr); } @@ -383,7 +383,7 @@ void AbstractElectrometerClass::set_averagecontrol (std::string averCtrlStr) // ============================================================================ // AbstractElectrometerClass::get_averagecontrol // ============================================================================ -std::string AbstractElectrometerClass::get_averagecontrol (void) +std::string AbstractElectrometerClass::get_averagecontrol (void) { return _electrometerProtocol->get_averagecontrol( ); } @@ -391,7 +391,7 @@ std::string AbstractElectrometerClass::get_averagecontrol (void) // ============================================================================ // AbstractElectrometerClass::clear_registers // ============================================================================ -void AbstractElectrometerClass::clear_registers (void) +void AbstractElectrometerClass::clear_registers (void) { _electrometerProtocol->clear_registers(); } @@ -399,7 +399,7 @@ void AbstractElectrometerClass::clear_registers (void) // ============================================================================ // AbstractElectrometerClass::averageStateON // ============================================================================ -void AbstractElectrometerClass::averageStateON (void) +void AbstractElectrometerClass::averageStateON (void) { _electrometerProtocol->averageStateON(); } @@ -407,7 +407,7 @@ void AbstractElectrometerClass::averageStateON (void) // ============================================================================ // AbstractElectrometerClass::averageStateOFF // ============================================================================ -void AbstractElectrometerClass::averageStateOFF (void) +void AbstractElectrometerClass::averageStateOFF (void) { _electrometerProtocol->averageStateOFF(); } @@ -415,9 +415,9 @@ void AbstractElectrometerClass::averageStateOFF (void) // ============================================================================ // AbstractElectrometerClass::get_value // ============================================================================ -std::string AbstractElectrometerClass::get_value (void) +std::string AbstractElectrometerClass::get_value (void) { - std::string argout("no data"); + std::string argout(""); argout = _electrometerProtocol->get_value( ); return argout; @@ -426,7 +426,7 @@ std::string AbstractElectrometerClass::get_value (void) // ============================================================================ // AbstractElectrometerClass::get_integratedValue // ============================================================================ -std::vector<double> AbstractElectrometerClass::get_integratedValue (void) +std::vector<double> AbstractElectrometerClass::get_integratedValue (void) { return _electrometerProtocol->get_integratedValue( ); } @@ -434,7 +434,7 @@ std::vector<double> AbstractElectrometerClass::get_integratedValue (void) // ============================================================================ // AbstractElectrometerClass::get_fetchValue // ============================================================================ -std::vector<double> AbstractElectrometerClass::get_fetchValue (void) +std::vector<double> AbstractElectrometerClass::get_fetchValue (void) { return _electrometerProtocol->get_fetchValue( ); } @@ -442,7 +442,7 @@ std::vector<double> AbstractElectrometerClass::get_fetchValue (void) // ============================================================================ // AbstractElectrometerClass::reset // ============================================================================ -void AbstractElectrometerClass::reset (void) +void AbstractElectrometerClass::reset (void) { _electrometerProtocol->reset( ); } @@ -450,7 +450,7 @@ void AbstractElectrometerClass::reset (void) // ============================================================================ // AbstractElectrometerClass::local // ============================================================================ -void AbstractElectrometerClass::local (void) +void AbstractElectrometerClass::local (void) { _electrometerProtocol->local( ); } @@ -458,7 +458,7 @@ void AbstractElectrometerClass::local (void) // ============================================================================ // AbstractElectrometerClass::remote // ============================================================================ -void AbstractElectrometerClass::remote (void) +void AbstractElectrometerClass::remote (void) { _electrometerProtocol->remote( ); } @@ -467,44 +467,44 @@ void AbstractElectrometerClass::remote (void) // AbstractElectrometerClass::get_ElectroMeterMode // ============================================================================ std::string AbstractElectrometerClass::get_ElectroMeterMode (void) -{ - return _electrometerProtocol->get_mode( ); +{ + return _electrometerProtocol->get_mode( ); } // ============================================================================ // AbstractElectrometerClass::get_ElectroMeterRange // ============================================================================ std::string AbstractElectrometerClass::get_ElectroMeterRange (void) -{ - return _electrometerProtocol->get_range( ); +{ + return _electrometerProtocol->get_range( ); } // ============================================================================ // AbstractElectrometerClass::get_overloadRangeState // ============================================================================ bool AbstractElectrometerClass::get_overloadRangeState (void) -{ - return _electrometerProtocol->get_overloadRangeState( ); +{ + return _electrometerProtocol->get_overloadRangeState( ); } // ============================================================================ // AbstractElectrometerClass::get_configuration // ============================================================================ std::string AbstractElectrometerClass::get_configuration (void) -{ - return _electrometerProtocol->get_DDC_configuration( ); +{ + return _electrometerProtocol->get_DDC_configuration( ); } // ============================================================================ // AbstractElectrometerClass::electrometer_status // ============================================================================ -std::string AbstractElectrometerClass::electrometer_status (void) +std::string AbstractElectrometerClass::electrometer_status (void) { /** * This command is sent for SCPI devices only, so the SCPI State is updated here */ std::string argout("no data"); - + try { argout = _electrometerProtocol->get_raw_status( ); @@ -526,10 +526,10 @@ std::string AbstractElectrometerClass::electrometer_status (void) // ============================================================================ // AbstractElectrometerClass::set_buffer_size // ============================================================================ -void AbstractElectrometerClass::set_buffer_size (short ) +void AbstractElectrometerClass::set_buffer_size (short ) { // force read of range on instrument to update _range variable - throw electrometer::ElectrometerException("COMMAND_NOT_SUPPORTED", + throw electrometer::ElectrometerException("COMMAND_NOT_SUPPORTED", "This Keithley device does not support this command.", "AbstractElectrometerClass::set_buffer_size( )."); @@ -538,20 +538,20 @@ void AbstractElectrometerClass::set_buffer_size (short ) // ============================================================================ // AbstractElectrometerClass::get_buffer_size // ============================================================================ -short AbstractElectrometerClass::get_buffer_size () +short AbstractElectrometerClass::get_buffer_size () { std::string size = _electrometerProtocol->get_buffer_size(); - + return XString<short>::convertFromString(size); } // ============================================================================ // AbstractElectrometerClass::set_integrationTime // ============================================================================ -void AbstractElectrometerClass::set_integrationTime (double) +void AbstractElectrometerClass::set_integrationTime (double) { // force read of range on instrument to update _range variable - throw electrometer::ElectrometerException("COMMAND_NOT_SUPPORTED", + throw electrometer::ElectrometerException("COMMAND_NOT_SUPPORTED", "This Keithley device does not support this command.", "AbstractElectrometerClass::set_integrationTime( )."); @@ -560,7 +560,7 @@ void AbstractElectrometerClass::set_integrationTime (double) // ============================================================================ // AbstractElectrometerClass::clear_buffer // ============================================================================ -void AbstractElectrometerClass::clear_buffer (void) +void AbstractElectrometerClass::clear_buffer (void) { _electrometerProtocol->clear_buffer(); } @@ -568,7 +568,7 @@ void AbstractElectrometerClass::clear_buffer (void) // ============================================================================ // AbstractElectrometerClass::store_raw_input // ============================================================================ -void AbstractElectrometerClass::store_raw_input (void) +void AbstractElectrometerClass::store_raw_input (void) { _electrometerProtocol->store_raw_input(); } @@ -576,7 +576,7 @@ void AbstractElectrometerClass::store_raw_input (void) // ============================================================================ // AbstractElectrometerClass::start_storing // ============================================================================ -void AbstractElectrometerClass::start_storing (void) +void AbstractElectrometerClass::start_storing (void) { _electrometerProtocol->start_storing(); } @@ -584,7 +584,7 @@ void AbstractElectrometerClass::start_storing (void) // ============================================================================ // AbstractElectrometerClass::enable_SRQBufferFull // ============================================================================ -void AbstractElectrometerClass::enable_SRQBufferFull (void) +void AbstractElectrometerClass::enable_SRQBufferFull (void) { _electrometerProtocol->enable_SRQBufferFull(); } @@ -592,7 +592,7 @@ void AbstractElectrometerClass::enable_SRQBufferFull (void) // ============================================================================ // AbstractElectrometerClass::disable_SRQBufferFull // ============================================================================ -void AbstractElectrometerClass::disable_SRQBufferFull (void) +void AbstractElectrometerClass::disable_SRQBufferFull (void) { _electrometerProtocol->disable_SRQBufferFull(); } @@ -600,7 +600,7 @@ void AbstractElectrometerClass::disable_SRQBufferFull (void) // ============================================================================ // AbstractElectrometerClass::SRQLineState // ============================================================================ -bool AbstractElectrometerClass::SRQLineState (void) +bool AbstractElectrometerClass::SRQLineState (void) { return _electrometerProtocol->SRQLineState(); } @@ -608,7 +608,7 @@ bool AbstractElectrometerClass::SRQLineState (void) // ============================================================================ // AbstractElectrometerClass::readStatusByteRegister // ============================================================================ -short AbstractElectrometerClass::readStatusByteRegister (void) +short AbstractElectrometerClass::readStatusByteRegister (void) { return _electrometerProtocol->readStatusByteRegister(); } @@ -616,16 +616,16 @@ short AbstractElectrometerClass::readStatusByteRegister (void) // ============================================================================ // AbstractElectrometerClass::MODE -> Ampere, Volt, Ohm, Coulomb and V on I meters // The general case is that following functions are not supported -// When supported by a particular electrometer, these methods must be defined in the +// When supported by a particular electrometer, these methods must be defined in the // corresponding electrometer class // ============================================================================ // ============================================================================ // AbstractElectrometerClass::setAmperMeterMode // ============================================================================ -void AbstractElectrometerClass::setAmperMeterMode (void) +void AbstractElectrometerClass::setAmperMeterMode (void) { _electrometerProtocol->setAmperMeterMode( ); -/* throw electrometer::ElectrometerException("COMMAND_NOT_SUPPORTED", +/* throw electrometer::ElectrometerException("COMMAND_NOT_SUPPORTED", "This Electrometer does not support this command.", "AbstractElectrometerClass::setAmperMeterMode( )."); */} @@ -633,10 +633,10 @@ void AbstractElectrometerClass::setAmperMeterMode (void) // ============================================================================ // AbstractElectrometerClass::setVoltMeterMode // ============================================================================ -void AbstractElectrometerClass::setVoltMeterMode (void) +void AbstractElectrometerClass::setVoltMeterMode (void) { _electrometerProtocol->setVoltMeterMode( ); -/* throw electrometer::ElectrometerException("COMMAND_NOT_SUPPORTED", +/* throw electrometer::ElectrometerException("COMMAND_NOT_SUPPORTED", "This Electrometer does not support this command.", "AbstractElectrometerClass::setAmperMeterMode( )."); */} @@ -644,10 +644,10 @@ void AbstractElectrometerClass::setVoltMeterMode (void) // ============================================================================ // AbstractElectrometerClass::setOhmMeterMode // ============================================================================ -void AbstractElectrometerClass::setOhmMeterMode (void) +void AbstractElectrometerClass::setOhmMeterMode (void) { _electrometerProtocol->setOhmMeterMode( ); -/* throw electrometer::ElectrometerException("COMMAND_NOT_SUPPORTED", +/* throw electrometer::ElectrometerException("COMMAND_NOT_SUPPORTED", "This Electrometer does not support this command.", "AbstractElectrometerClass::setAmperMeterMode( )."); */} @@ -656,10 +656,10 @@ void AbstractElectrometerClass::setOhmMeterMode (void) // ============================================================================ // AbstractElectrometerClass::setCoulombMeterMode // ============================================================================ -void AbstractElectrometerClass::setCoulombMeterMode (void) +void AbstractElectrometerClass::setCoulombMeterMode (void) { _electrometerProtocol->setCoulombMeterMode( ); -/* throw electrometer::ElectrometerException("COMMAND_NOT_SUPPORTED", +/* throw electrometer::ElectrometerException("COMMAND_NOT_SUPPORTED", "This Electrometer does not support this command.", "AbstractElectrometerClass::setAmperMeterMode( )."); */} @@ -667,9 +667,9 @@ void AbstractElectrometerClass::setCoulombMeterMode (void) // ============================================================================ // AbstractElectrometerClass::enable_VSourceOutput // ============================================================================ -void AbstractElectrometerClass::enable_VSourceOutput (void) +void AbstractElectrometerClass::enable_VSourceOutput (void) { - throw electrometer::ElectrometerException("COMMAND_NOT_SUPPORTED", + throw electrometer::ElectrometerException("COMMAND_NOT_SUPPORTED", "This Electrometer does not support this command.", "AbstractElectrometerClass::enable_VSourceOutput( )."); } @@ -677,9 +677,9 @@ void AbstractElectrometerClass::enable_VSourceOutput (void) // ============================================================================ // AbstractElectrometerClass::disable_VSourceOutput // ============================================================================ -void AbstractElectrometerClass::disable_VSourceOutput (void) +void AbstractElectrometerClass::disable_VSourceOutput (void) { - throw electrometer::ElectrometerException("COMMAND_NOT_SUPPORTED", + throw electrometer::ElectrometerException("COMMAND_NOT_SUPPORTED", "This Electrometer does not support this command.", "AbstractElectrometerClass::disable_VSourceOutput( )."); } @@ -687,9 +687,9 @@ void AbstractElectrometerClass::disable_VSourceOutput (void) // ============================================================================ // AbstractElectrometerClass::set_VSourceValue // ============================================================================ -void AbstractElectrometerClass::set_VSourceValue (double) +void AbstractElectrometerClass::set_VSourceValue (double) { - throw electrometer::ElectrometerException("COMMAND_NOT_SUPPORTED", + throw electrometer::ElectrometerException("COMMAND_NOT_SUPPORTED", "This Electrometer does not support this command.", "AbstractElectrometerClass::set_VSourceValue( )."); } @@ -697,9 +697,9 @@ void AbstractElectrometerClass::set_VSourceValue (double) // ============================================================================ // AbstractElectrometerClass::get_VSourceValue // ============================================================================ -double AbstractElectrometerClass::get_VSourceValue (void) +double AbstractElectrometerClass::get_VSourceValue (void) { - throw electrometer::ElectrometerException("COMMAND_NOT_SUPPORTED", + throw electrometer::ElectrometerException("COMMAND_NOT_SUPPORTED", "This Electrometer does not support this command.", "AbstractElectrometerClass::get_VSourceValue( )."); } @@ -707,7 +707,7 @@ double AbstractElectrometerClass::get_VSourceValue (void) // ============================================================================ // AbstractElectrometerClass::get_ElectroMeterPolarity // ============================================================================ -std::string AbstractElectrometerClass::get_ElectroMeterPolarity (void) +std::string AbstractElectrometerClass::get_ElectroMeterPolarity (void) { return _electrometerProtocol->get_polarity( ); } @@ -715,7 +715,7 @@ std::string AbstractElectrometerClass::get_ElectroMeterPolarity (void) // ============================================================================ // AbstractElectrometerClass::get_ElectroMeterFrequency // ============================================================================ -std::string AbstractElectrometerClass::get_ElectroMeterFrequency (void) +std::string AbstractElectrometerClass::get_ElectroMeterFrequency (void) { return _electrometerProtocol->get_frequency( ); } @@ -723,7 +723,7 @@ std::string AbstractElectrometerClass::get_ElectroMeterFrequency (void) // ============================================================================ // AbstractElectrometerClass::get_ElectroMeterGain // ============================================================================ -std::string AbstractElectrometerClass::get_ElectroMeterGain (void) +std::string AbstractElectrometerClass::get_ElectroMeterGain (void) { return _electrometerProtocol->get_gain( ); } @@ -731,7 +731,7 @@ std::string AbstractElectrometerClass::get_ElectroMeterGain (void) // ============================================================================ // AbstractElectrometerClass::set_ElectroMeterRange // ============================================================================ -void AbstractElectrometerClass::set_ElectroMeterRange (std::string rang) +void AbstractElectrometerClass::set_ElectroMeterRange (std::string rang) { _electrometerProtocol->set_range(rang); std::cout << "\t AbstractElectrometerClass::set_ElectroMeterRange val = " << rang << std::endl; @@ -740,7 +740,7 @@ void AbstractElectrometerClass::set_ElectroMeterRange (std::string rang) // ============================================================================ // AbstractElectrometerClass::set_ElectroMeterPolarity // ============================================================================ -void AbstractElectrometerClass::set_ElectroMeterPolarity (std::string pola) +void AbstractElectrometerClass::set_ElectroMeterPolarity (std::string pola) { _electrometerProtocol->set_polarity(pola); } @@ -748,7 +748,7 @@ void AbstractElectrometerClass::set_ElectroMeterPolarity (std::string pola) // ============================================================================ // AbstractElectrometerClass::set_ElectroMeterFrequency // ============================================================================ -void AbstractElectrometerClass::set_ElectroMeterFrequency (std::string freq) +void AbstractElectrometerClass::set_ElectroMeterFrequency (std::string freq) { _electrometerProtocol->set_frequency(freq); } @@ -756,7 +756,7 @@ void AbstractElectrometerClass::set_ElectroMeterFrequency (std::string freq) // ============================================================================ // AbstractElectrometerClass::set_ElectroMeterGain // ============================================================================ -void AbstractElectrometerClass::set_ElectroMeterGain (std::string gain) +void AbstractElectrometerClass::set_ElectroMeterGain (std::string gain) { _electrometerProtocol->set_gain(gain); } @@ -764,7 +764,7 @@ void AbstractElectrometerClass::set_ElectroMeterGain (std::string gain) // ============================================================================ // AbstractElectrometerClass::set_Zero_VonF_function // ============================================================================ -void AbstractElectrometerClass::set_Zero_VonF_function (void) +void AbstractElectrometerClass::set_Zero_VonF_function (void) { _electrometerProtocol->unable_zeroVF_func( ); } @@ -772,7 +772,7 @@ void AbstractElectrometerClass::set_Zero_VonF_function (void) // ============================================================================ // AbstractElectrometerClass::set_Offset_ZeroV1_function // ============================================================================ -void AbstractElectrometerClass::set_Offset_ZeroV1_function (void) +void AbstractElectrometerClass::set_Offset_ZeroV1_function (void) { _electrometerProtocol->unable_offset_zeroV1_func( ); } @@ -780,7 +780,7 @@ void AbstractElectrometerClass::set_Offset_ZeroV1_function (void) // ============================================================================ // AbstractElectrometerClass::set_Leakage_ZeroV2_function // ============================================================================ -void AbstractElectrometerClass::set_Leakage_ZeroV2_function (void) +void AbstractElectrometerClass::set_Leakage_ZeroV2_function (void) { _electrometerProtocol->unable_leakage_zeroV2_func( ); } @@ -788,7 +788,7 @@ void AbstractElectrometerClass::set_Leakage_ZeroV2_function (void) // ============================================================================ // AbstractElectrometerClass::set_Test_function // ============================================================================ -void AbstractElectrometerClass::set_Test_function (void) +void AbstractElectrometerClass::set_Test_function (void) { _electrometerProtocol->unable_test_func( ); } @@ -796,7 +796,7 @@ void AbstractElectrometerClass::set_Test_function (void) // ============================================================================ // AbstractElectrometerClass::set_Measure_function // ============================================================================ -void AbstractElectrometerClass::set_Measure_function (void) +void AbstractElectrometerClass::set_Measure_function (void) { _electrometerProtocol->unable_measure_func( ); } @@ -804,7 +804,7 @@ void AbstractElectrometerClass::set_Measure_function (void) // ============================================================================ // AbstractElectrometerClass::mcce_on // ============================================================================ -void AbstractElectrometerClass::mcce_on (void) +void AbstractElectrometerClass::mcce_on (void) { _electrometerProtocol->switch_MCCE2_ON( ); } @@ -812,7 +812,7 @@ void AbstractElectrometerClass::mcce_on (void) // ============================================================================ // AbstractElectrometerClass::mcce_off // ============================================================================ -void AbstractElectrometerClass::mcce_off (void) +void AbstractElectrometerClass::mcce_off (void) { _electrometerProtocol->switch_MCCE2_OFF( ); } @@ -820,7 +820,7 @@ void AbstractElectrometerClass::mcce_off (void) // ============================================================================ // AbstractElectrometerClass::mcce_init // ============================================================================ -void AbstractElectrometerClass::mcce_init (void) +void AbstractElectrometerClass::mcce_init (void) { _electrometerProtocol->init_MCCE2_for_communication( ); } @@ -828,7 +828,7 @@ void AbstractElectrometerClass::mcce_init (void) // ============================================================================ // AbstractElectrometerClass::set_ElectroChannel // ============================================================================ -void AbstractElectrometerClass::set_ElectroChannel (unsigned short address) +void AbstractElectrometerClass::set_ElectroChannel (unsigned short address) { _electrometerProtocol->set_electrometer_active_channel(address); } @@ -836,7 +836,7 @@ void AbstractElectrometerClass::set_ElectroChannel (unsigned short address) // ============================================================================ // AbstractElectrometerClass::get_ElectroChannel // ============================================================================ -unsigned short AbstractElectrometerClass::get_ElectroChannel (void) +unsigned short AbstractElectrometerClass::get_ElectroChannel (void) { return _electrometerProtocol->get_electrometer_active_channel(); } @@ -844,7 +844,7 @@ unsigned short AbstractElectrometerClass::get_ElectroChannel (void) // ============================================================================ // AbstractElectrometerClass::save_configuration // ============================================================================ -void AbstractElectrometerClass::save_configuration (unsigned short memoryIdx) +void AbstractElectrometerClass::save_configuration (unsigned short memoryIdx) { _electrometerProtocol->save_configuration(memoryIdx); } @@ -852,7 +852,7 @@ void AbstractElectrometerClass::save_configuration (unsigned short memoryIdx) // ============================================================================ // AbstractElectrometerClass::restore_configuration // ============================================================================ -void AbstractElectrometerClass::restore_configuration (unsigned short memoryIdx) +void AbstractElectrometerClass::restore_configuration (unsigned short memoryIdx) { _electrometerProtocol->restore_configuration(memoryIdx); } diff --git a/src/KeithleyDDCProtocol.cpp b/src/KeithleyDDCProtocol.cpp index eeab0c21dbb5a79f596d0098ebf4cbbd6a10a070..d8884e2808087fc081e24d241d0d9bfb5add3121 100644 --- a/src/KeithleyDDCProtocol.cpp +++ b/src/KeithleyDDCProtocol.cpp @@ -41,7 +41,7 @@ KeithleyDDCProtocol::KeithleyDDCProtocol (std::string& gpib_device_name) KeithleyDDCProtocol::~KeithleyDDCProtocol (void) { std::cout << "KeithleyDDCProtocol::~KeithleyDDCProtocol <-" << std::endl; - + if(_communication_link) { delete _communication_link; @@ -73,7 +73,7 @@ bool KeithleyDDCProtocol::build_communicationLink() // ============================================================================ // KeithleyDDCProtocol::set_range // ============================================================================ -void KeithleyDDCProtocol::set_range (std::string value) +void KeithleyDDCProtocol::set_range (std::string value) { std::stringstream cmd_to_send; @@ -86,9 +86,9 @@ std::stringstream cmd_to_send; // ============================================================================ // KeithleyDDCProtocol::get_range // ============================================================================ -std::string KeithleyDDCProtocol::get_range (void) +std::string KeithleyDDCProtocol::get_range (void) { - throw electrometer::ElectrometerException("COMMAND_NOT_SUPPORTED", + throw electrometer::ElectrometerException("COMMAND_NOT_SUPPORTED", "For DDC Keithley type, please check the status.", "KeithleyDDCProtocol::get_range( )."); } @@ -96,7 +96,7 @@ std::string KeithleyDDCProtocol::get_range (void) // ============================================================================ // KeithleyDDCProtocol::zero_check_on // ============================================================================ -void KeithleyDDCProtocol::zero_check_on (void) +void KeithleyDDCProtocol::zero_check_on (void) { std::stringstream cmd_to_send; @@ -108,7 +108,7 @@ std::stringstream cmd_to_send; // ============================================================================ // KeithleyDDCProtocol::zero_check_off // ============================================================================ -void KeithleyDDCProtocol::zero_check_off (void) +void KeithleyDDCProtocol::zero_check_off (void) { std::stringstream cmd_to_send; @@ -121,7 +121,7 @@ std::stringstream cmd_to_send; // ============================================================================ // KeithleyDDCProtocol::zero_correct_on // ============================================================================ -void KeithleyDDCProtocol::zero_correct_on (void) +void KeithleyDDCProtocol::zero_correct_on (void) { std::stringstream cmd_to_send; @@ -134,7 +134,7 @@ std::stringstream cmd_to_send; // ============================================================================ // KeithleyDDCProtocol::zero_correct_off // ============================================================================ -void KeithleyDDCProtocol::zero_correct_off (void) +void KeithleyDDCProtocol::zero_correct_off (void) { std::stringstream cmd_to_send; @@ -147,9 +147,9 @@ std::stringstream cmd_to_send; // ============================================================================ // KeithleyDDCProtocol::auto_zero_on // ============================================================================ -void KeithleyDDCProtocol::auto_zero_on (void) +void KeithleyDDCProtocol::auto_zero_on (void) { - throw electrometer::ElectrometerException("COMMAND_NOT_SUPPORTED", + throw electrometer::ElectrometerException("COMMAND_NOT_SUPPORTED", "DDC Keithley does not support this command.", "KeithleyDDCProtocol::auto_zero_on( )."); @@ -158,9 +158,9 @@ void KeithleyDDCProtocol::auto_zero_on (void) // ============================================================================ // KeithleyDDCProtocol::auto_zero_off // ============================================================================ -void KeithleyDDCProtocol::auto_zero_off (void) +void KeithleyDDCProtocol::auto_zero_off (void) { - throw electrometer::ElectrometerException("COMMAND_NOT_SUPPORTED", + throw electrometer::ElectrometerException("COMMAND_NOT_SUPPORTED", "DDC Keithley does not support this command.", "KeithleyDDCProtocol::auto_zero_off( )."); @@ -169,7 +169,7 @@ void KeithleyDDCProtocol::auto_zero_off (void) // ============================================================================ // KeithleyDDCProtocol::autoRange_ON // ============================================================================ -void KeithleyDDCProtocol::autoRange_on (void) +void KeithleyDDCProtocol::autoRange_on (void) { std::stringstream cmd_to_send; @@ -180,9 +180,9 @@ std::stringstream cmd_to_send; // ============================================================================ // KeithleyDDCProtocol::autoRange_OFF // ============================================================================ -void KeithleyDDCProtocol::autoRange_off (void) +void KeithleyDDCProtocol::autoRange_off (void) { - throw electrometer::ElectrometerException("COMMAND_NOT_SUPPORTED", + throw electrometer::ElectrometerException("COMMAND_NOT_SUPPORTED", "DDC Keithley does not support this command.", "KeithleyDDCProtocol::autoRange_off( )."); } @@ -190,7 +190,7 @@ void KeithleyDDCProtocol::autoRange_off (void) // ============================================================================ // KeithleyDDCProtocol::autoRange_OFF for Keithley 486 & 487 // ============================================================================ -void KeithleyDDCProtocol::autoRange_OFF_forK486_487 (void) +void KeithleyDDCProtocol::autoRange_OFF_forK486_487 (void) { std::stringstream cmd_to_send; @@ -202,7 +202,7 @@ std::stringstream cmd_to_send; // ============================================================================ // KeithleyDDCProtocol::autoRange_OFF for Keithley 617 & 6512 // ============================================================================ -void KeithleyDDCProtocol::autoRange_OFF_forK617_6512 (void) +void KeithleyDDCProtocol::autoRange_OFF_forK617_6512 (void) { std::stringstream cmd_to_send; @@ -217,7 +217,7 @@ std::stringstream cmd_to_send; // ============================================================================ // KeithleyDDCProtocol::setAmperMeterMode (617 & 6512 Keithley DDC models // ============================================================================ -void KeithleyDDCProtocol::setAmperMeterMode (void) +void KeithleyDDCProtocol::setAmperMeterMode (void) { std::stringstream cmd_to_send; @@ -232,7 +232,7 @@ std::stringstream cmd_to_send; // ============================================================================ // KeithleyDDCProtocol::setAmperMeterMode (487 Keithley DDC model // ============================================================================ -void KeithleyDDCProtocol::setAmperMeterMode_forK487 (void) +void KeithleyDDCProtocol::setAmperMeterMode_forK487 (void) { std::stringstream cmd_to_send; @@ -247,7 +247,7 @@ std::stringstream cmd_to_send; // ============================================================================ // KeithleyDDCProtocol::setVoltMeterMode (617 & 6512 Keithley DDC models // ============================================================================ -void KeithleyDDCProtocol::setVoltMeterMode (void) +void KeithleyDDCProtocol::setVoltMeterMode (void) { std::stringstream cmd_to_send; @@ -263,7 +263,7 @@ std::stringstream cmd_to_send; // ============================================================================ // KeithleyDDCProtocol::setOhmMeterMode (617 & 6512 Keithley DDC models // ============================================================================ -void KeithleyDDCProtocol::setOhmMeterMode (void) +void KeithleyDDCProtocol::setOhmMeterMode (void) { std::stringstream cmd_to_send; @@ -279,7 +279,7 @@ std::stringstream cmd_to_send; // ============================================================================ // KeithleyDDCProtocol::setCoulombMeterMode (617 & 6512 Keithley DDC models // ============================================================================ -void KeithleyDDCProtocol::setCoulombMeterMode (void) +void KeithleyDDCProtocol::setCoulombMeterMode (void) { std::stringstream cmd_to_send; @@ -294,7 +294,7 @@ std::stringstream cmd_to_send; // ============================================================================ // KeithleyDDCProtocol::get_value // ============================================================================ -std::string KeithleyDDCProtocol::get_value (void) +std::string KeithleyDDCProtocol::get_value (void) { std::stringstream cmd_to_send; std::string argout("no data"); @@ -303,7 +303,7 @@ std::string argout("no data"); cmd_to_send << "X" << std::ends; _communication_link->write(cmd_to_send.str()); argout = _communication_link->read(); - + //- check if device range is overloaded : First char of the prefix ! if(argout[0] == 'O') //- O means overload ! _is_overloaded = true; @@ -318,7 +318,7 @@ std::string argout("no data"); // ============================================================================ // KeithleyDDCProtocol::get_integratedValue // ============================================================================ -std::vector<double> KeithleyDDCProtocol::get_integratedValue (void) +std::vector<double> KeithleyDDCProtocol::get_integratedValue (void) { std::string tmp(""); @@ -332,7 +332,7 @@ std::string tmp(""); // ============================================================================ // KeithleyDDCProtocol::get_fetchValue // ============================================================================ -std::vector<double> KeithleyDDCProtocol::get_fetchValue (void) +std::vector<double> KeithleyDDCProtocol::get_fetchValue (void) { std::string tmp(""); @@ -356,7 +356,7 @@ std::vector<double> argout; std::string::size_type posBeg; std::string::size_type posEnd; - //- + //- posBeg = 0; posEnd = datalist.find(',', posBeg); @@ -390,10 +390,10 @@ std::string::size_type posEnd; // ============================================================================ // KeithleyDDCProtocol::reset // ============================================================================ -void KeithleyDDCProtocol::reset (void) +void KeithleyDDCProtocol::reset (void) { std::stringstream cmd_to_send; - + //- send command to return to default conditions !! cmd_to_send << "*RST" << std::ends; _communication_link->write(cmd_to_send.str()); @@ -402,7 +402,7 @@ std::stringstream cmd_to_send; // ============================================================================ // KeithleyDDCProtocol::get_raw_status // ============================================================================ -std::string KeithleyDDCProtocol::get_raw_status (void) +std::string KeithleyDDCProtocol::get_raw_status (void) { std::stringstream cmd_to_send; std::string argout("no data"); @@ -420,7 +420,7 @@ std::string argout("no data"); // ============================================================================ // KeithleyDDCProtocol::get_DDC_configuration // ============================================================================ -std::string KeithleyDDCProtocol::get_DDC_configuration (void) +std::string KeithleyDDCProtocol::get_DDC_configuration (void) { std::stringstream cmd_to_send; std::string argout("no data"); @@ -437,10 +437,10 @@ std::string argout("no data"); // ============================================================================ // KeithleyDDCProtocol::clear_registers // ============================================================================ -void KeithleyDDCProtocol::clear_registers (void) +void KeithleyDDCProtocol::clear_registers (void) { std::stringstream cmd_to_send; - + //- send command cmd_to_send << "*CLS" << std::ends; _communication_link->write(cmd_to_send.str()); @@ -450,7 +450,7 @@ std::stringstream cmd_to_send; // ============================================================================ // KeithleyDDCProtocol::set_buffer_size() // ============================================================================ -void KeithleyDDCProtocol::set_buffer_size (std::string cmd) +void KeithleyDDCProtocol::set_buffer_size (std::string cmd) { //- send command _communication_link->write(cmd); @@ -459,7 +459,7 @@ void KeithleyDDCProtocol::set_buffer_size (std::string cmd) // ============================================================================ // KeithleyDDCProtocol::set_triggerMode() // ============================================================================ -void KeithleyDDCProtocol::set_triggerMode (std::string cmd) +void KeithleyDDCProtocol::set_triggerMode (std::string cmd) { //- send command _communication_link->write(cmd); @@ -468,7 +468,7 @@ void KeithleyDDCProtocol::set_triggerMode (std::string cmd) // ============================================================================ // KeithleyDDCProtocol::enable_SRQBufferFull() // ============================================================================ -void KeithleyDDCProtocol::enable_SRQBufferFull (void) +void KeithleyDDCProtocol::enable_SRQBufferFull (void) { std::string cmd_to_send("M2X"); @@ -480,7 +480,7 @@ void KeithleyDDCProtocol::enable_SRQBufferFull (void) // ============================================================================ // KeithleyDDCProtocol::disable_SRQBufferFull() // ============================================================================ -void KeithleyDDCProtocol::disable_SRQBufferFull (void) +void KeithleyDDCProtocol::disable_SRQBufferFull (void) { std::string cmd_to_send("M0X"); @@ -492,7 +492,7 @@ std::string cmd_to_send("M0X"); // ============================================================================ // KeithleyDDCProtocol::SRQLineState() // ============================================================================ -bool KeithleyDDCProtocol::SRQLineState (void) +bool KeithleyDDCProtocol::SRQLineState (void) { //- if asserted -> the programmed event occurs : the device can be asked ! return _communication_link->SRQLineState(); @@ -501,7 +501,7 @@ bool KeithleyDDCProtocol::SRQLineState (void) // ============================================================================ // KeithleyDDCProtocol::readStatusByteRegister() // ============================================================================ -short KeithleyDDCProtocol::readStatusByteRegister (void) +short KeithleyDDCProtocol::readStatusByteRegister (void) { //- if asserted -> the programmed event occurs : the device can be asked ! return _communication_link->readStatusByteRegister(); @@ -510,7 +510,7 @@ short KeithleyDDCProtocol::readStatusByteRegister (void) // ============================================================================ // KeithleyDDCProtocol::set_conversionRate() // ============================================================================ -void KeithleyDDCProtocol::set_conversionRate (void) +void KeithleyDDCProtocol::set_conversionRate (void) { std::string cmd_to_send("Q0X"); @@ -521,7 +521,7 @@ std::string cmd_to_send("Q0X"); // ============================================================================ // KeithleyDDCProtocol::enable_readingWithPrefix() // ============================================================================ -void KeithleyDDCProtocol::enable_readingWithPrefix (void) +void KeithleyDDCProtocol::enable_readingWithPrefix (void) { std::string cmd_to_send("G0X"); @@ -532,7 +532,7 @@ std::string cmd_to_send("G0X"); // ============================================================================ // KeithleyDDCProtocol::disable_readingWithPrefix() // ============================================================================ -void KeithleyDDCProtocol::disable_readingWithPrefix (void) +void KeithleyDDCProtocol::disable_readingWithPrefix (void) { std::string cmd_to_send("G1X"); @@ -543,7 +543,7 @@ std::string cmd_to_send("G1X"); // ============================================================================ // KeithleyDDCProtocol::enable_ReadingsFromElectrometer() -> disable storing mode // ============================================================================ -void KeithleyDDCProtocol::enable_ReadingsFromElectrometer (void) +void KeithleyDDCProtocol::enable_ReadingsFromElectrometer (void) { std::string cmd_to_send("B0X"); @@ -555,7 +555,7 @@ std::string cmd_to_send("B0X"); // ============================================================================ // KeithleyDDCProtocol::enable_readingsFromBuffer_K617_6512() // ============================================================================ -void KeithleyDDCProtocol::enable_readingsFromBuffer_K617_6512 (void) +void KeithleyDDCProtocol::enable_readingsFromBuffer_K617_6512 (void) { std::string cmd_to_send("B1X"); @@ -566,7 +566,7 @@ std::string cmd_to_send("B1X"); // ============================================================================ // KeithleyDDCProtocol::enable_readingsFromBuffer_K486_487() // ============================================================================ -void KeithleyDDCProtocol::enable_readingsFromBuffer_K486_487 (void) +void KeithleyDDCProtocol::enable_readingsFromBuffer_K486_487 (void) { std::string cmd_to_send("B2X"); @@ -577,10 +577,10 @@ std::string cmd_to_send("B2X"); // ============================================================================ // KeithleyDDCProtocol::enable_integrationPeriod() // ============================================================================ -void KeithleyDDCProtocol::enable_integrationPeriod (void) +void KeithleyDDCProtocol::enable_integrationPeriod (void) { std::string cmd_to_send("S1X"); - + //- //- send command : this command is only for k_486 or K_487 //- S1 is for : "Line cycle integration period (5-I /2d resolution)" @@ -591,7 +591,7 @@ std::string cmd_to_send("S1X"); /*// ============================================================================ // KeithleyDDCProtocol::init_keithley to perform reading(s) data // ============================================================================ -void KeithleyDDCProtocol::init_keithley (void) +void KeithleyDDCProtocol::init_keithley (void) { //- Set default conversion rate (internal keithley device conversion rate) this->set_conversionRate(); @@ -604,13 +604,13 @@ void KeithleyDDCProtocol::init_keithley (void) _communication_link->write(cmd_to_send); } -// Following functions are part of commands supported via the DDC protocol. +// Following functions are part of commands supported via the DDC protocol. // We may have to implement them after first tests on beamlines // ============================================================================ // KeithleyDDCProtocol::setExternalFeedbackMeterMode (617 & 6512 Keithley DDC models // ============================================================================ -void KeithleyDDCProtocol::setExternalFeedbackMeterMode (void) +void KeithleyDDCProtocol::setExternalFeedbackMeterMode (void) throw (electrometer::ElectrometerException, Tango::DevFailed) { std::stringstream cmd_to_send; @@ -624,7 +624,7 @@ std::stringstream cmd_to_send; // ============================================================================ // KeithleyDDCProtocol::setVonIMeterMode (only 617 Keithley DDC model // ============================================================================ -void KeithleyDDCProtocol::setVonIMeterMode (void) +void KeithleyDDCProtocol::setVonIMeterMode (void) throw (electrometer::ElectrometerException, Tango::DevFailed) { std::stringstream cmd_to_send; @@ -638,7 +638,7 @@ std::stringstream cmd_to_send; // ============================================================================ // KeithleyDDCProtocol::setVonIMeterMode (only 487 Keithley DDC model // ============================================================================ -void KeithleyDDCProtocol::setVonIMeterMode_forK487 (void) +void KeithleyDDCProtocol::setVonIMeterMode_forK487 (void) throw (electrometer::ElectrometerException, Tango::DevFailed) { std::stringstream cmd_to_send; @@ -649,12 +649,12 @@ std::stringstream cmd_to_send; } - ... TO BE IMPLEMENTED !!!!! + ... TO BE IMPLEMENTED !!!!! // ============================================================================ // KeithleyDDCProtocol::reading_source // ============================================================================ -void KeithleyDDCProtocol::reading_source (void) +void KeithleyDDCProtocol::reading_source (void) throw (electrometer::ElectrometerException, Tango::DevFailed) { @@ -663,7 +663,7 @@ void KeithleyDDCProtocol::reading_source (void) // ============================================================================ // KeithleyDDCProtocol::reading_source // ============================================================================ -void KeithleyDDCProtocol::data_store (void) +void KeithleyDDCProtocol::data_store (void) throw (electrometer::ElectrometerException, Tango::DevFailed) { @@ -672,7 +672,7 @@ void KeithleyDDCProtocol::data_store (void) // ============================================================================ // KeithleyDDCProtocol::reading_source // ============================================================================ -void KeithleyDDCProtocol::data_format (void) +void KeithleyDDCProtocol::data_format (void) throw (electrometer::ElectrometerException, Tango::DevFailed) { @@ -681,7 +681,7 @@ void KeithleyDDCProtocol::data_format (void) // ============================================================================ // KeithleyDDCProtocol::reading_source // ============================================================================ -void KeithleyDDCProtocol::baseline_suppression_ON (void) +void KeithleyDDCProtocol::baseline_suppression_ON (void) throw (electrometer::ElectrometerException, Tango::DevFailed) { @@ -690,7 +690,7 @@ void KeithleyDDCProtocol::baseline_suppression_ON (void) // ============================================================================ // KeithleyDDCProtocol::reading_source // ============================================================================ -void KeithleyDDCProtocol::baseline_suppression_OFF (void) +void KeithleyDDCProtocol::baseline_suppression_OFF (void) throw (electrometer::ElectrometerException, Tango::DevFailed) { @@ -698,7 +698,7 @@ void KeithleyDDCProtocol::baseline_suppression_OFF (void) // ============================================================================ // KeithleyDDCProtocol::reading_source // ============================================================================ -void KeithleyDDCProtocol::keithley_status (void) +void KeithleyDDCProtocol::keithley_status (void) throw (electrometer::ElectrometerException, Tango::DevFailed) { diff --git a/src/KeithleySCPIProtocol.cpp b/src/KeithleySCPIProtocol.cpp index 34e903fed01729512a89bdd178d487cd803fec4b..573f996e134744f969b0fb6ac169d7108b28a95d 100644 --- a/src/KeithleySCPIProtocol.cpp +++ b/src/KeithleySCPIProtocol.cpp @@ -111,7 +111,7 @@ bool KeithleySCPIProtocol::build_communicationLink() // ============================================================================ // KeithleySCPIProtocol::set_range // ============================================================================ -void KeithleySCPIProtocol::set_range (std::string value) +void KeithleySCPIProtocol::set_range (std::string value) { std::string cmd_to_send(""); std::string tmpMode; @@ -119,17 +119,17 @@ std::string tmpMode; if( !this->_communication_link ) { throw electrometer::ElectrometerException( - "INITIALIZATION_ERROR", + "INITIALIZATION_ERROR", "No communication protocol available.", "KeithleySCPIProtocol::set_range()"); } - + //- get electrometer mode tmpMode = get_mode( ); //- erase bad caracters tmpMode.erase(tmpMode.find("\n") ); - + //- send command to Keithley device cmd_to_send = tmpMode + ":RANGe " + value ; _communication_link->write(cmd_to_send); @@ -138,18 +138,18 @@ std::string tmpMode; // ============================================================================ // KeithleySCPIProtocol::zero_check_on // ============================================================================ -void KeithleySCPIProtocol::zero_check_on (void) +void KeithleySCPIProtocol::zero_check_on (void) { std::string cmd_to_send(""); if( !this->_communication_link ) { throw electrometer::ElectrometerException( - "INITIALIZATION_ERROR", + "INITIALIZATION_ERROR", "No communication protocol available.", "KeithleySCPIProtocol::zero_check_on()"); } - + //- send command cmd_to_send = "SYST:ZCH ON" ; _communication_link->write(cmd_to_send); @@ -158,18 +158,18 @@ std::string cmd_to_send(""); // ============================================================================ // KeithleySCPIProtocol::zero_check_off // ============================================================================ -void KeithleySCPIProtocol::zero_check_off (void) +void KeithleySCPIProtocol::zero_check_off (void) { std::string cmd_to_send(""); if( !this->_communication_link ) { throw electrometer::ElectrometerException( - "INITIALIZATION_ERROR", + "INITIALIZATION_ERROR", "No communication protocol available.", "KeithleySCPIProtocol::zero_check_off()"); } - + //- send command cmd_to_send = "SYST:ZCH OFF"; _communication_link->write(cmd_to_send); @@ -179,18 +179,18 @@ std::string cmd_to_send(""); // ============================================================================ // KeithleySCPIProtocol::zero_correct_on // ============================================================================ -void KeithleySCPIProtocol::zero_correct_on (void) +void KeithleySCPIProtocol::zero_correct_on (void) { std::string cmd_to_send(""); if( !this->_communication_link ) { throw electrometer::ElectrometerException( - "INITIALIZATION_ERROR", + "INITIALIZATION_ERROR", "No communication protocol available.", "KeithleySCPIProtocol::zero_correct_on()"); } - + //- send command cmd_to_send = "SYST:ZCOR ON" ; _communication_link->write(cmd_to_send); @@ -200,18 +200,18 @@ std::string cmd_to_send(""); // ============================================================================ // KeithleySCPIProtocol::zero_correct_off // ============================================================================ -void KeithleySCPIProtocol::zero_correct_off (void) +void KeithleySCPIProtocol::zero_correct_off (void) { std::string cmd_to_send(""); if( !this->_communication_link ) { throw electrometer::ElectrometerException( - "INITIALIZATION_ERROR", + "INITIALIZATION_ERROR", "No communication protocol available.", "KeithleySCPIProtocol::zero_correct_off()"); } - + //- send command cmd_to_send = "SYST:ZCOR OFF" ; _communication_link->write(cmd_to_send); @@ -221,18 +221,18 @@ std::string cmd_to_send(""); // ============================================================================ // KeithleySCPIProtocol::zero_correct_state_on // ============================================================================ -void KeithleySCPIProtocol::zero_correct_state_on (void) +void KeithleySCPIProtocol::zero_correct_state_on (void) { std::string cmd_to_send(""); if( !this->_communication_link ) { throw electrometer::ElectrometerException( - "INITIALIZATION_ERROR", + "INITIALIZATION_ERROR", "No communication protocol available.", "KeithleySCPIProtocol::zero_correct_state_on()"); } - + //- send command cmd_to_send = "SYST:ZCOR:STAT ON" ; _communication_link->write(cmd_to_send); @@ -242,18 +242,18 @@ std::string cmd_to_send(""); // ============================================================================ // KeithleySCPIProtocol::zero_correct_state_off // ============================================================================ -void KeithleySCPIProtocol::zero_correct_state_off (void) +void KeithleySCPIProtocol::zero_correct_state_off (void) { std::string cmd_to_send(""); if( !this->_communication_link ) { throw electrometer::ElectrometerException( - "INITIALIZATION_ERROR", + "INITIALIZATION_ERROR", "No communication protocol available.", "KeithleySCPIProtocol::zero_correct_state_off()"); } - + //- send command cmd_to_send = "SYST:ZCOR:STAT OFF" ; _communication_link->write(cmd_to_send); @@ -263,19 +263,19 @@ std::string cmd_to_send(""); // ============================================================================ // KeithleySCPIProtocol::autoRange_ON // ============================================================================ -void KeithleySCPIProtocol::autoRange_on (void) +void KeithleySCPIProtocol::autoRange_on (void) { std::string cmd_to_send(""); std::string tmpMode; - + if( !this->_communication_link ) { throw electrometer::ElectrometerException( - "INITIALIZATION_ERROR", + "INITIALIZATION_ERROR", "No communication protocol available.", "KeithleySCPIProtocol::autoRange_ON()"); } - + //- get electrometer mode tmpMode = get_mode( ); @@ -290,19 +290,19 @@ std::string tmpMode; // ============================================================================ // KeithleySCPIProtocol::autoRange_OFF // ============================================================================ -void KeithleySCPIProtocol::autoRange_off (void) +void KeithleySCPIProtocol::autoRange_off (void) { std::string cmd_to_send(""); std::string tmpMode; - + if( !this->_communication_link ) { throw electrometer::ElectrometerException( - "INITIALIZATION_ERROR", + "INITIALIZATION_ERROR", "No communication protocol available.", "KeithleySCPIProtocol::autoRange_off()"); } - + //- get electrometer mode tmpMode = get_mode( ); @@ -318,18 +318,18 @@ std::string tmpMode; // ============================================================================ // KeithleySCPIProtocol::auto_zero_on // ============================================================================ -void KeithleySCPIProtocol::auto_zero_on (void) +void KeithleySCPIProtocol::auto_zero_on (void) { std::string cmd_to_send(""); if( !this->_communication_link ) { throw electrometer::ElectrometerException( - "INITIALIZATION_ERROR", + "INITIALIZATION_ERROR", "No communication protocol available.", "KeithleySCPIProtocol::auto_zero_on()"); } - + //- send command cmd_to_send = "SYST:AZER ON" ; _communication_link->write(cmd_to_send); @@ -338,18 +338,18 @@ std::string cmd_to_send(""); // ============================================================================ // KeithleySCPIProtocol::auto_zero_off // ============================================================================ -void KeithleySCPIProtocol::auto_zero_off (void) +void KeithleySCPIProtocol::auto_zero_off (void) { std::string cmd_to_send(""); if( !this->_communication_link ) { throw electrometer::ElectrometerException( - "INITIALIZATION_ERROR", + "INITIALIZATION_ERROR", "No communication protocol available.", "KeithleySCPIProtocol::auto_zero_off()"); } - + //- send command cmd_to_send = "SYST:AZER OFF" ; _communication_link->write(cmd_to_send); @@ -361,7 +361,7 @@ std::string cmd_to_send(""); // ============================================================================ // KeithleySCPIProtocol::setAmperMeterMode // ============================================================================ -void KeithleySCPIProtocol::setAmperMeterMode (void) +void KeithleySCPIProtocol::setAmperMeterMode (void) { std::stringstream cmd_to_send; std::string mode (""); @@ -369,11 +369,11 @@ std::string mode (""); if( !this->_communication_link ) { throw electrometer::ElectrometerException( - "INITIALIZATION_ERROR", + "INITIALIZATION_ERROR", "No communication protocol available.", "KeithleySCPIProtocol::setAmperMeterMode()"); } - + //- mode current (send CURR) mode = "CURRent"; @@ -386,7 +386,7 @@ std::string mode (""); // ============================================================================ // KeithleySCPIProtocol::setVoltMeterMode // ============================================================================ -void KeithleySCPIProtocol::setVoltMeterMode (void) +void KeithleySCPIProtocol::setVoltMeterMode (void) { std::stringstream cmd_to_send; std::string mode (""); @@ -394,11 +394,11 @@ std::string mode (""); if( !this->_communication_link ) { throw electrometer::ElectrometerException( - "INITIALIZATION_ERROR", + "INITIALIZATION_ERROR", "No communication protocol available.", "KeithleySCPIProtocol::setVoltMeterMode()"); } - + //- mode volt mode = "VOLTage"; @@ -410,7 +410,7 @@ std::string mode (""); // ============================================================================ // KeithleySCPIProtocol::setOhmMeterMode // ============================================================================ -void KeithleySCPIProtocol::setOhmMeterMode (void) +void KeithleySCPIProtocol::setOhmMeterMode (void) { std::stringstream cmd_to_send; std::string mode (""); @@ -418,11 +418,11 @@ std::string mode (""); if( !this->_communication_link ) { throw electrometer::ElectrometerException( - "INITIALIZATION_ERROR", + "INITIALIZATION_ERROR", "No communication protocol available.", "KeithleySCPIProtocol::setOhmMeterMode()"); } - + //- mode ohm mode = "RESistance"; @@ -435,7 +435,7 @@ std::string mode (""); // ============================================================================ // KeithleySCPIProtocol::setCoulombMeterMode // ============================================================================ -void KeithleySCPIProtocol::setCoulombMeterMode (void) +void KeithleySCPIProtocol::setCoulombMeterMode (void) { std::stringstream cmd_to_send; std::string mode (""); @@ -443,11 +443,11 @@ std::string mode (""); if( !this->_communication_link ) { throw electrometer::ElectrometerException( - "INITIALIZATION_ERROR", + "INITIALIZATION_ERROR", "No communication protocol available.", "KeithleySCPIProtocol::setCoulombMeterMode()"); } - + //- mode coulomb mode = "CHARge"; @@ -460,16 +460,16 @@ std::string mode (""); // ============================================================================ // KeithleySCPIProtocol::setVSourceOutputON // ============================================================================ -void KeithleySCPIProtocol::setVSourceOutputON (void) +void KeithleySCPIProtocol::setVSourceOutputON (void) { if( !this->_communication_link ) { throw electrometer::ElectrometerException( - "INITIALIZATION_ERROR", + "INITIALIZATION_ERROR", "No communication protocol available.", "KeithleySCPIProtocol::setVSourceOutputON()"); } - + std::string cmd_to_send ("OUTP 1"); //- send command @@ -479,16 +479,16 @@ std::string cmd_to_send ("OUTP 1"); // ============================================================================ // KeithleySCPIProtocol::setVSourceOutputOFF // ============================================================================ -void KeithleySCPIProtocol::setVSourceOutputOFF (void) +void KeithleySCPIProtocol::setVSourceOutputOFF (void) { if( !this->_communication_link ) { throw electrometer::ElectrometerException( - "INITIALIZATION_ERROR", + "INITIALIZATION_ERROR", "No communication protocol available.", "KeithleySCPIProtocol::setVSourceOutputOFF()"); } - + std::string cmd_to_send ("OUTP 1"); //- send command _communication_link->write(cmd_to_send); @@ -497,16 +497,16 @@ std::string cmd_to_send ("OUTP 1"); // ============================================================================ // KeithleySCPIProtocol::setVSourceValue // ============================================================================ -void KeithleySCPIProtocol::setVSourceValue (double voltsValue) +void KeithleySCPIProtocol::setVSourceValue (double voltsValue) { if( !this->_communication_link ) { throw electrometer::ElectrometerException( - "INITIALIZATION_ERROR", + "INITIALIZATION_ERROR", "No communication protocol available.", "KeithleySCPIProtocol::setVSourceValue()"); } - + std::stringstream cmd_to_send; //- send command cmd_to_send << "SOUR:VOLT " << voltsValue << std::endl; @@ -516,16 +516,16 @@ std::stringstream cmd_to_send; // ============================================================================ // KeithleySCPIProtocol::getVSourceValue // ============================================================================ -std::string KeithleySCPIProtocol::getVSourceValue (void) +std::string KeithleySCPIProtocol::getVSourceValue (void) { if( !this->_communication_link ) { throw electrometer::ElectrometerException( - "INITIALIZATION_ERROR", + "INITIALIZATION_ERROR", "No communication protocol available.", "KeithleySCPIProtocol::getVSourceValue()"); } - + std::string cmd_to_send("SOUR:VOLT?"); //- send command return _communication_link->write_read(cmd_to_send); @@ -534,16 +534,16 @@ std::string cmd_to_send("SOUR:VOLT?"); // ============================================================================ // KeithleySCPIProtocol::get_mode // ============================================================================ -std::string KeithleySCPIProtocol::get_mode (void) +std::string KeithleySCPIProtocol::get_mode (void) { if( !this->_communication_link ) { throw electrometer::ElectrometerException( - "INITIALIZATION_ERROR", + "INITIALIZATION_ERROR", "No communication protocol available.", "KeithleySCPIProtocol::get_mode()"); } - + std::string cmd_to_send(""); //- get electrometer mode if(isDiffSuportedMode) @@ -564,34 +564,34 @@ std::string cmd_to_send(""); // ============================================================================ // KeithleySCPIProtocol::get_range // ============================================================================ -std::string KeithleySCPIProtocol::get_range (void) +std::string KeithleySCPIProtocol::get_range (void) { if( !this->_communication_link ) { throw electrometer::ElectrometerException( - "INITIALIZATION_ERROR", + "INITIALIZATION_ERROR", "No communication protocol available.", "KeithleySCPIProtocol::get_range()"); } - + std::string cmd_to_send(""); //- get electrometer mode std::string tmpMode = get_mode( ); //- erase bad caracters tmpMode.erase(tmpMode.find("\n") ); - + //- send command cmd_to_send = tmpMode + ":RANGe?" ; std::string _rangeStr = _communication_link->write_read(cmd_to_send); - + return _rangeStr; } // ============================================================================ // KeithleySCPIProtocol::get_value // ============================================================================ -std::string KeithleySCPIProtocol::get_value (void) +std::string KeithleySCPIProtocol::get_value (void) { std::string cmd_to_send(""); std::string tmp(""); @@ -599,14 +599,14 @@ std::string tmp(""); if( !this->_communication_link ) { throw electrometer::ElectrometerException( - "INITIALIZATION_ERROR", + "INITIALIZATION_ERROR", "No communication protocol available.", "KeithleySCPIProtocol::get_value()"); } - + ////- This command performs a CONFIGURE and a READ? //cmd_to_send = "MEAS?" ; - + //- This command performs an INIT and then query the updated value cmd_to_send = "READ?" ; @@ -619,7 +619,7 @@ std::string tmp(""); // ============================================================================ // KeithleySCPIProtocol::get_integratedValue // ============================================================================ -std::vector<double> KeithleySCPIProtocol::get_integratedValue (void) +std::vector<double> KeithleySCPIProtocol::get_integratedValue (void) { std::string cmd_to_send(""); std::string tmp(""); @@ -627,11 +627,11 @@ std::string tmp(""); if( !this->_communication_link ) { throw electrometer::ElectrometerException( - "INITIALIZATION_ERROR", + "INITIALIZATION_ERROR", "No communication protocol available.", "KeithleySCPIProtocol::get_integratedValue()"); } - + //- This command performs an INIT and then query the bufferised values cmd_to_send = "TRAC:DATA?" ; tmp = _communication_link->write_read(cmd_to_send); @@ -643,7 +643,7 @@ std::string tmp(""); // ============================================================================ // KeithleySCPIProtocol::get_fetchValue // ============================================================================ -std::vector<double> KeithleySCPIProtocol::get_fetchValue (void) +std::vector<double> KeithleySCPIProtocol::get_fetchValue (void) { std::string cmd_to_send(""); std::string tmp(""); @@ -651,11 +651,11 @@ std::string tmp(""); if( !this->_communication_link ) { throw electrometer::ElectrometerException( - "INITIALIZATION_ERROR", + "INITIALIZATION_ERROR", "No communication protocol available.", "KeithleySCPIProtocol::get_fetchValue()"); } - + //- This command queries the last value(s) cmd_to_send = "FETCh?" ; tmp = _communication_link->write_read(cmd_to_send); @@ -677,18 +677,18 @@ std::vector<double> argout; std::string::size_type posBeg; std::string::size_type posEnd; short numberOfData = 0; - //- + //- posBeg = 0; posEnd = datalist.find(',', posBeg); -//-DEBUG +//-DEBUG std::cout << "\t*****::buildDataList -> argin :\n$" << datalist << "$" << std::endl; - + //- there is just one value if(posEnd == std::string::npos) { argout.push_back( XString<double>::convertFromString(datalist) ); -//-DEBUG +//-DEBUG std::cout << "\t*****::buildDataList -> JUST ONE DATA :$" << datalist << "$" << std::endl; } else @@ -701,7 +701,7 @@ std::cout << "\t*****::buildDataList -> JUST ONE DATA :$" << datalist << "$" << { dataStr = datalist.substr(posBeg,posEnd); argout.push_back( XString<double>::convertFromString(dataStr) ); -//-DEBUG +//-DEBUG std::cout << "\t*****::buildDataList -> FULL OF DATA : " << i << " -> $" << argout[i] << "$" << std::endl; posBeg = posEnd+1; posEnd = datalist.find(',', posBeg); @@ -722,12 +722,12 @@ std::cout << "\t*****::buildDataList -> FULL OF DATA : " << i << " -> $" << argo // ============================================================================ // KeithleySCPIProtocol::init_keithley to perform reading(s) data // ============================================================================ -void KeithleySCPIProtocol::init_keithley (void) +void KeithleySCPIProtocol::init_keithley (void) { if( !this->_communication_link ) { throw electrometer::ElectrometerException( - "INITIALIZATION_ERROR", + "INITIALIZATION_ERROR", "No communication protocol available.", "KeithleySCPIProtocol::init_keithley()"); } @@ -746,16 +746,16 @@ std::string cmd_to_send("INIT"); // ============================================================================ // KeithleySCPIProtocol::abort -> cancel all operations started by INIT command // ============================================================================ -void KeithleySCPIProtocol::abort (void) +void KeithleySCPIProtocol::abort (void) { if( !this->_communication_link ) { throw electrometer::ElectrometerException( - "INITIALIZATION_ERROR", + "INITIALIZATION_ERROR", "No communication protocol available.", "KeithleySCPIProtocol::abort()"); } - + std::string cmd_to_send("ABORt"); //- send command : ABORt to cancel all operations _communication_link->write(cmd_to_send); @@ -764,22 +764,22 @@ std::string cmd_to_send("ABORt"); // ============================================================================ // KeithleySCPIProtocol::set_knplc : specify the integration rate // ============================================================================ -void KeithleySCPIProtocol::set_knplc (std::string nbNPLC) +void KeithleySCPIProtocol::set_knplc (std::string nbNPLC) { if( !this->_communication_link ) { throw electrometer::ElectrometerException( - "INITIALIZATION_ERROR", + "INITIALIZATION_ERROR", "No communication protocol available.", "KeithleySCPIProtocol::set_knplc()"); } - + //- get electrometer mode std::string tmpMode = get_mode(); //- erase bad caracters tmpMode.erase(tmpMode.find("\n") ); - + std::string cmd_to_send(""); //- send command cmd_to_send = tmpMode + ":NPLC " + nbNPLC ; @@ -789,22 +789,22 @@ std::string cmd_to_send(""); // ============================================================================ // KeithleySCPIProtocol::get_knplc : get the integration rate // ============================================================================ -std::string KeithleySCPIProtocol::get_knplc (void) +std::string KeithleySCPIProtocol::get_knplc (void) { if( !this->_communication_link ) { throw electrometer::ElectrometerException( - "INITIALIZATION_ERROR", + "INITIALIZATION_ERROR", "No communication protocol available.", "KeithleySCPIProtocol::get_knplc()"); } - + //- get electrometer mode std::string tmpMode = get_mode(); //- erase bad caracters tmpMode.erase( tmpMode.find("\n") ); - + std::string cmd_to_send(""); //- send command cmd_to_send = tmpMode + ":NPLCycles?" ; @@ -814,16 +814,16 @@ std::string cmd_to_send(""); // ============================================================================ // KeithleySCPIProtocol::set_triggercount // ============================================================================ -void KeithleySCPIProtocol::set_triggercount (std::string nbTrigCount) +void KeithleySCPIProtocol::set_triggercount (std::string nbTrigCount) { if( !this->_communication_link ) { throw electrometer::ElectrometerException( - "INITIALIZATION_ERROR", + "INITIALIZATION_ERROR", "No communication protocol available.", "KeithleySCPIProtocol::set_triggercount()"); } - + std::string cmd_to_send(""); //- send command cmd_to_send = "TRIG:COUN " + nbTrigCount ; @@ -836,16 +836,16 @@ std::string cmd_to_send(""); // ============================================================================ // KeithleySCPIProtocol::get_triggercount // ============================================================================ -std::string KeithleySCPIProtocol::get_triggercount (void) +std::string KeithleySCPIProtocol::get_triggercount (void) { if( !this->_communication_link ) { throw electrometer::ElectrometerException( - "INITIALIZATION_ERROR", + "INITIALIZATION_ERROR", "No communication protocol available.", "KeithleySCPIProtocol::get_triggercount()"); } - + //- send command std::string cmd_to_send("TRIG:COUNt?"); std::string response = _communication_link->write_read(cmd_to_send); @@ -856,16 +856,16 @@ std::string KeithleySCPIProtocol::get_triggercount (void) // ============================================================================ // KeithleySCPIProtocol::set_triggerdelay // ============================================================================ -void KeithleySCPIProtocol::set_triggerdelay (std::string trigDelay) +void KeithleySCPIProtocol::set_triggerdelay (std::string trigDelay) { if( !this->_communication_link ) { throw electrometer::ElectrometerException( - "INITIALIZATION_ERROR", + "INITIALIZATION_ERROR", "No communication protocol available.", "KeithleySCPIProtocol::set_triggerdelay()"); } - + //- send command std::string cmd_to_send = "TRIG:DEL " + trigDelay ; _communication_link->write(cmd_to_send); @@ -874,16 +874,16 @@ void KeithleySCPIProtocol::set_triggerdelay (std::string trigDelay) // ============================================================================ // KeithleySCPIProtocol::get_triggerdelay // ============================================================================ -std::string KeithleySCPIProtocol::get_triggerdelay (void) +std::string KeithleySCPIProtocol::get_triggerdelay (void) { if( !this->_communication_link ) { throw electrometer::ElectrometerException( - "INITIALIZATION_ERROR", + "INITIALIZATION_ERROR", "No communication protocol available.", "KeithleySCPIProtocol::get_triggerdelay()"); } - + //- send command std::string cmd_to_send = "TRIG:DEL?" ; return _communication_link->write_read(cmd_to_send); @@ -892,16 +892,16 @@ std::string KeithleySCPIProtocol::get_triggerdelay (void) // ============================================================================ // KeithleySCPIProtocol::set_triggerdelayAuto // ============================================================================ -void KeithleySCPIProtocol::set_triggerdelayAuto (std::string trigDelayAuto) +void KeithleySCPIProtocol::set_triggerdelayAuto (std::string trigDelayAuto) { if( !this->_communication_link ) { throw electrometer::ElectrometerException( - "INITIALIZATION_ERROR", + "INITIALIZATION_ERROR", "No communication protocol available.", "KeithleySCPIProtocol::set_triggerdelayAuto()"); } - + //- send command std::string cmd_to_send = "TRIG:DEL:" + trigDelayAuto ; _communication_link->write(cmd_to_send); @@ -910,16 +910,16 @@ void KeithleySCPIProtocol::set_triggerdelayAuto (std::string trigDelayAuto) // ============================================================================ // KeithleySCPIProtocol::get_triggerdelayAuto // ============================================================================ -std::string KeithleySCPIProtocol::get_triggerdelayAuto (void) +std::string KeithleySCPIProtocol::get_triggerdelayAuto (void) { if( !this->_communication_link ) { throw electrometer::ElectrometerException( - "INITIALIZATION_ERROR", + "INITIALIZATION_ERROR", "No communication protocol available.", "KeithleySCPIProtocol::get_triggerdelayAuto()"); } - + //- send command std::string cmd_to_send = "TRIG:DEL:AUTO?" ; return _communication_link->write_read(cmd_to_send); @@ -928,16 +928,16 @@ std::string KeithleySCPIProtocol::get_triggerdelayAuto (void) // ============================================================================ // KeithleySCPIProtocol::set_averagecount // ============================================================================ -void KeithleySCPIProtocol::set_averagecount (std::string nbAverageCount) +void KeithleySCPIProtocol::set_averagecount (std::string nbAverageCount) { if( !this->_communication_link ) { throw electrometer::ElectrometerException( - "INITIALIZATION_ERROR", + "INITIALIZATION_ERROR", "No communication protocol available.", "KeithleySCPIProtocol::set_averagecount()"); } - + //- send command std::string cmd_to_send = "AVER:COUN " + nbAverageCount; _communication_link->write(cmd_to_send); @@ -946,22 +946,22 @@ void KeithleySCPIProtocol::set_averagecount (std::string nbAverageCount) // ============================================================================ // KeithleySCPIProtocol::set_averagecount // ============================================================================ -void KeithleySCPIProtocol::set_averagecount_K6517 (std::string nbAverageCount) +void KeithleySCPIProtocol::set_averagecount_K6517 (std::string nbAverageCount) { if( !this->_communication_link ) { throw electrometer::ElectrometerException( - "INITIALIZATION_ERROR", + "INITIALIZATION_ERROR", "No communication protocol available.", "KeithleySCPIProtocol::set_averagecount()"); } - + //- get electrometer mode std::string tmpMode = get_mode(); //- erase bad caracters tmpMode.erase( tmpMode.find("\n") ); - + //- send command std::string cmd_to_send = tmpMode + ":AVER:COUN " + nbAverageCount ; _communication_link->write(cmd_to_send); @@ -970,16 +970,16 @@ void KeithleySCPIProtocol::set_averagecount_K6517 (std::string nbAverageCount) // ============================================================================ // KeithleySCPIProtocol::get_averagecount // ============================================================================ -std::string KeithleySCPIProtocol::get_averagecount (void) +std::string KeithleySCPIProtocol::get_averagecount (void) { if( !this->_communication_link ) { throw electrometer::ElectrometerException( - "INITIALIZATION_ERROR", + "INITIALIZATION_ERROR", "No communication protocol available.", "KeithleySCPIProtocol::get_averagecount()"); } - + //- send command std::string cmd_to_send("AVER:COUNt?"); return _communication_link->write_read(cmd_to_send); @@ -988,22 +988,22 @@ std::string KeithleySCPIProtocol::get_averagecount (void) // ============================================================================ // KeithleySCPIProtocol::get_averagecount // ============================================================================ -std::string KeithleySCPIProtocol::get_averagecount_K6517 (void) +std::string KeithleySCPIProtocol::get_averagecount_K6517 (void) { if( !this->_communication_link ) { throw electrometer::ElectrometerException( - "INITIALIZATION_ERROR", + "INITIALIZATION_ERROR", "No communication protocol available.", "KeithleySCPIProtocol::get_averagecount()"); } - + //- get electrometer mode std::string tmpMode = get_mode(); //- erase bad caracters tmpMode.erase(tmpMode.find("\n") ); - + //- send command std::string cmd_to_send = tmpMode + ":AVER:COUNt?" ; return _communication_link->write_read(cmd_to_send); @@ -1012,16 +1012,16 @@ std::string KeithleySCPIProtocol::get_averagecount_K6517 (void) // ============================================================================ // KeithleySCPIProtocol::set_averagecontrol // ============================================================================ -void KeithleySCPIProtocol::set_averagecontrol (std::string nbAverageControl) +void KeithleySCPIProtocol::set_averagecontrol (std::string nbAverageControl) { if( !this->_communication_link ) { throw electrometer::ElectrometerException( - "INITIALIZATION_ERROR", + "INITIALIZATION_ERROR", "No communication protocol available.", "KeithleySCPIProtocol::set_averagecontrol()"); } - + //- send command std::string cmd_to_send = "AVER:TCON " + nbAverageControl; _communication_link->write(cmd_to_send); @@ -1030,22 +1030,22 @@ void KeithleySCPIProtocol::set_averagecontrol (std::string nbAverageControl) // ============================================================================ // KeithleySCPIProtocol::set_averagecontrol // ============================================================================ -void KeithleySCPIProtocol::set_averagecontrol_K6517 (std::string nbAverageControl) +void KeithleySCPIProtocol::set_averagecontrol_K6517 (std::string nbAverageControl) { if( !this->_communication_link ) { throw electrometer::ElectrometerException( - "INITIALIZATION_ERROR", + "INITIALIZATION_ERROR", "No communication protocol available.", "KeithleySCPIProtocol::set_averagecontrol_K6517()"); } - + //- get electrometer mode std::string tmpMode = get_mode( ); //- erase bad caracters tmpMode.erase(tmpMode.find("\n") ); - + //- send command std::string cmd_to_send = tmpMode + ":AVER:TCON " + nbAverageControl; _communication_link->write(cmd_to_send); @@ -1054,16 +1054,16 @@ void KeithleySCPIProtocol::set_averagecontrol_K6517 (std::string nbAverageContro // ============================================================================ // KeithleySCPIProtocol::get_averagecontrol // ============================================================================ -std::string KeithleySCPIProtocol::get_averagecontrol (void) +std::string KeithleySCPIProtocol::get_averagecontrol (void) { if( !this->_communication_link ) { throw electrometer::ElectrometerException( - "INITIALIZATION_ERROR", + "INITIALIZATION_ERROR", "No communication protocol available.", "KeithleySCPIProtocol::get_averagecontrol()"); } - + //- send command std::string cmd_to_send = "AVER:TCONtrol?" ; return _communication_link->write_read(cmd_to_send); @@ -1072,22 +1072,22 @@ std::string KeithleySCPIProtocol::get_averagecontrol (void) // ============================================================================ // KeithleySCPIProtocol::get_averagecount // ============================================================================ -std::string KeithleySCPIProtocol::get_averagecontrol_K6517 (void) +std::string KeithleySCPIProtocol::get_averagecontrol_K6517 (void) { if( !this->_communication_link ) { throw electrometer::ElectrometerException( - "INITIALIZATION_ERROR", + "INITIALIZATION_ERROR", "No communication protocol available.", "KeithleySCPIProtocol::get_averagecontrol_K6517()"); } - + //- get electrometer mode std::string tmpMode = get_mode( ); //- erase bad caracters tmpMode.erase(tmpMode.find("\n") ); - + //- send command std::string cmd_to_send = tmpMode + ":AVER:TCONtrol?" ; return _communication_link->write_read(cmd_to_send); @@ -1096,16 +1096,16 @@ std::string KeithleySCPIProtocol::get_averagecontrol_K6517 (void) // ============================================================================ // KeithleySCPIProtocol::clear_registers // ============================================================================ -void KeithleySCPIProtocol::clear_registers (void) +void KeithleySCPIProtocol::clear_registers (void) { if( !this->_communication_link ) { throw electrometer::ElectrometerException( - "INITIALIZATION_ERROR", + "INITIALIZATION_ERROR", "No communication protocol available.", "KeithleySCPIProtocol::clear_registers()"); } - + //- send command std::string cmd_to_send("*CLS"); _communication_link->write(cmd_to_send); @@ -1114,16 +1114,16 @@ void KeithleySCPIProtocol::clear_registers (void) // ============================================================================ // KeithleySCPIProtocol::averageStateON // ============================================================================ -void KeithleySCPIProtocol::averageStateON (void) +void KeithleySCPIProtocol::averageStateON (void) { if( !this->_communication_link ) { throw electrometer::ElectrometerException( - "INITIALIZATION_ERROR", + "INITIALIZATION_ERROR", "No communication protocol available.", "KeithleySCPIProtocol::averageStateON()"); } - + //- send command std::string cmd_to_send = "AVER ON" ; _communication_link->write(cmd_to_send); @@ -1132,22 +1132,22 @@ void KeithleySCPIProtocol::averageStateON (void) // ============================================================================ // KeithleySCPIProtocol::averageStateON_K6517 // ============================================================================ -void KeithleySCPIProtocol::averageStateON_K6517 (void) +void KeithleySCPIProtocol::averageStateON_K6517 (void) { if( !this->_communication_link ) { throw electrometer::ElectrometerException( - "INITIALIZATION_ERROR", + "INITIALIZATION_ERROR", "No communication protocol available.", "KeithleySCPIProtocol::averageStateON_K6517()"); } - + //- get electrometer mode std::string tmpMode = get_mode(); //- erase bad caracters tmpMode.erase( tmpMode.find("\n") ); - + //- send command std::string cmd_to_send = tmpMode + ":AVER ON"; _communication_link->write(cmd_to_send); @@ -1156,16 +1156,16 @@ void KeithleySCPIProtocol::averageStateON_K6517 (void) // ============================================================================ // KeithleySCPIProtocol::averageStateOFF // ============================================================================ -void KeithleySCPIProtocol::averageStateOFF (void) +void KeithleySCPIProtocol::averageStateOFF (void) { if( !this->_communication_link ) { throw electrometer::ElectrometerException( - "INITIALIZATION_ERROR", + "INITIALIZATION_ERROR", "No communication protocol available.", "KeithleySCPIProtocol::averageStateOFF()"); } - + //- send command std::string cmd_to_send = "AVER OFF"; _communication_link->write(cmd_to_send); @@ -1174,22 +1174,22 @@ void KeithleySCPIProtocol::averageStateOFF (void) // ============================================================================ // KeithleySCPIProtocol::averageStateOFF_K6517 // ============================================================================ -void KeithleySCPIProtocol::averageStateOFF_K6517 (void) +void KeithleySCPIProtocol::averageStateOFF_K6517 (void) { if( !this->_communication_link ) { throw electrometer::ElectrometerException( - "INITIALIZATION_ERROR", + "INITIALIZATION_ERROR", "No communication protocol available.", "KeithleySCPIProtocol::averageStateOFF_K6517()"); } - + //- get electrometer mode std::string tmpMode = get_mode(); //- erase bad caracters tmpMode.erase(tmpMode.find("\n") ); - + //- send command std::string cmd_to_send = tmpMode + ":AVER OFF" ; _communication_link->write(cmd_to_send); @@ -1198,16 +1198,16 @@ void KeithleySCPIProtocol::averageStateOFF_K6517 (void) // ============================================================================ // KeithleySCPIProtocol::reset // ============================================================================ -void KeithleySCPIProtocol::reset (void) +void KeithleySCPIProtocol::reset (void) { if( !this->_communication_link ) { throw electrometer::ElectrometerException( - "INITIALIZATION_ERROR", + "INITIALIZATION_ERROR", "No communication protocol available.", "KeithleySCPIProtocol::reset()"); } - + //- send command std::string cmd_to_send = "*RST" ; _communication_link->write(cmd_to_send); @@ -1222,16 +1222,16 @@ void KeithleySCPIProtocol::reset (void) // ============================================================================ // KeithleySCPIProtocol::get_raw_status // ============================================================================ -std::string KeithleySCPIProtocol::get_raw_status (void) +std::string KeithleySCPIProtocol::get_raw_status (void) { if( !this->_communication_link ) { throw electrometer::ElectrometerException( - "INITIALIZATION_ERROR", + "INITIALIZATION_ERROR", "No communication protocol available.", "KeithleySCPIProtocol::get_raw_status()"); } - + //- send command : read error queue only std::string cmd_to_send = "STAT:QUE?"; std::string argout = _communication_link->write_read(cmd_to_send); @@ -1242,16 +1242,16 @@ std::string KeithleySCPIProtocol::get_raw_status (void) // ============================================================================ // KeithleySCPIProtocol::set_buffer_size() // ============================================================================ -void KeithleySCPIProtocol::set_buffer_size (std::string size) +void KeithleySCPIProtocol::set_buffer_size (std::string size) { if( !this->_communication_link ) { throw electrometer::ElectrometerException( - "INITIALIZATION_ERROR", + "INITIALIZATION_ERROR", "No communication protocol available.", "KeithleySCPIProtocol::set_buffer_size()"); } - + //- send command : size = number of triggers std::string cmd_to_send = "TRAC:POIN " + size; _communication_link->write(cmd_to_send); @@ -1260,16 +1260,16 @@ void KeithleySCPIProtocol::set_buffer_size (std::string size) // ============================================================================ // KeithleySCPIProtocol::get_buffer_size() // ============================================================================ -std::string KeithleySCPIProtocol::get_buffer_size ( ) +std::string KeithleySCPIProtocol::get_buffer_size ( ) { if( !this->_communication_link ) { throw electrometer::ElectrometerException( - "INITIALIZATION_ERROR", + "INITIALIZATION_ERROR", "No communication protocol available.", "KeithleySCPIProtocol::get_buffer_size()"); } - + //- send command : std::string cmd_to_send("TRAC:POIN:ACTual?"); return _communication_link->write_read(cmd_to_send); @@ -1278,16 +1278,16 @@ std::string KeithleySCPIProtocol::get_buffer_size ( ) // ============================================================================ // KeithleySCPIProtocol::clear_buffer() // ============================================================================ -void KeithleySCPIProtocol::clear_buffer (void) +void KeithleySCPIProtocol::clear_buffer (void) { if( !this->_communication_link ) { throw electrometer::ElectrometerException( - "INITIALIZATION_ERROR", + "INITIALIZATION_ERROR", "No communication protocol available.", "KeithleySCPIProtocol::clear_buffer()"); } - + //- send command : clear previous data std::string cmd_to_send("TRAC:CLEAR"); _communication_link->write(cmd_to_send); @@ -1296,16 +1296,16 @@ void KeithleySCPIProtocol::clear_buffer (void) // ============================================================================ // KeithleySCPIProtocol::store_raw_input() // ============================================================================ -void KeithleySCPIProtocol::store_raw_input (void) +void KeithleySCPIProtocol::store_raw_input (void) { if( !this->_communication_link ) { throw electrometer::ElectrometerException( - "INITIALIZATION_ERROR", + "INITIALIZATION_ERROR", "No communication protocol available.", "KeithleySCPIProtocol::store_raw_input()"); } - + std::string cmd_to_send("TRAC:FEED SENS"); //- send command : Store raw input readings _communication_link->write(cmd_to_send); @@ -1314,16 +1314,16 @@ void KeithleySCPIProtocol::store_raw_input (void) // ============================================================================ // KeithleySCPIProtocol::start_storing() // ============================================================================ -void KeithleySCPIProtocol::start_storing (void) +void KeithleySCPIProtocol::start_storing (void) { if( !this->_communication_link ) { throw electrometer::ElectrometerException( - "INITIALIZATION_ERROR", + "INITIALIZATION_ERROR", "No communication protocol available.", "KeithleySCPIProtocol::start_storing()"); } - + std::string cmd_to_send("TRAC:FEED:CONT NEXT"); //- send command : Start storing readings _communication_link->write(cmd_to_send); @@ -1332,16 +1332,16 @@ void KeithleySCPIProtocol::start_storing (void) // ============================================================================ // KeithleySCPIProtocol::save_configuration // ============================================================================ -void KeithleySCPIProtocol::save_configuration (unsigned short memoryIdx) +void KeithleySCPIProtocol::save_configuration (unsigned short memoryIdx) { if( !this->_communication_link ) { throw electrometer::ElectrometerException( - "INITIALIZATION_ERROR", + "INITIALIZATION_ERROR", "No communication protocol available.", "KeithleySCPIProtocol::save_configuration()"); } - + std::stringstream cmd_to_send; //- send command cmd_to_send << "*SAV " << memoryIdx << std::endl; @@ -1351,16 +1351,16 @@ std::stringstream cmd_to_send; // ============================================================================ // KeithleySCPIProtocol::restore_configuration // ============================================================================ -void KeithleySCPIProtocol::restore_configuration (unsigned short memoryIdx) +void KeithleySCPIProtocol::restore_configuration (unsigned short memoryIdx) { if( !this->_communication_link ) { throw electrometer::ElectrometerException( - "INITIALIZATION_ERROR", + "INITIALIZATION_ERROR", "No communication protocol available.", "KeithleySCPIProtocol::restore_configuration()"); } - + std::stringstream cmd_to_send; //- send command cmd_to_send << "*RCL " << memoryIdx << std::endl; @@ -1370,24 +1370,24 @@ std::stringstream cmd_to_send; // ============================================================================ // KeithleySCPIProtocol::enable_SRQBufferFull() // ============================================================================ -void KeithleySCPIProtocol::enable_SRQBufferFull (void) +void KeithleySCPIProtocol::enable_SRQBufferFull (void) { /**********************************************************/ /* NOTE : */ /* 512 is the 10th bit in the MESUREMENT EVENT REGISTERS */ /* which the BUFFER FULL bit that can be enabled */ /**********************************************************/ - + std::string cmd_to_send("STAT:MEAS:ENAB 512"); if( !this->_communication_link ) { throw electrometer::ElectrometerException( - "INITIALIZATION_ERROR", + "INITIALIZATION_ERROR", "No communication protocol available.", "KeithleySCPIProtocol::enable_SRQBufferFull()"); } - + //- send command : enable buffer full in the Measurement event enable register _communication_link->write(cmd_to_send); @@ -1401,18 +1401,18 @@ void KeithleySCPIProtocol::enable_SRQBufferFull (void) // ============================================================================ // KeithleySCPIProtocol::disable_SRQBufferFull() // ============================================================================ -void KeithleySCPIProtocol::disable_SRQBufferFull (void) +void KeithleySCPIProtocol::disable_SRQBufferFull (void) { std::string cmd_to_send("STAT:MEAS?"); if( !this->_communication_link ) { throw electrometer::ElectrometerException( - "INITIALIZATION_ERROR", + "INITIALIZATION_ERROR", "No communication protocol available.", "KeithleySCPIProtocol::disable_SRQBufferFull()"); } - + //- send command : disable buffer full event _communication_link->write_read(cmd_to_send); @@ -1425,56 +1425,56 @@ std::string cmd_to_send("STAT:MEAS?"); // ============================================================================ // KeithleySCPIProtocol::SRQLineState() // ============================================================================ -bool KeithleySCPIProtocol::SRQLineState (void) +bool KeithleySCPIProtocol::SRQLineState (void) { if( !this->_communication_link ) { throw electrometer::ElectrometerException( - "INITIALIZATION_ERROR", + "INITIALIZATION_ERROR", "No communication protocol available.", "KeithleySCPIProtocol::SRQLineState()"); } - + //- if asserted -> the programmed event occurs : the device can be asked ! return _communication_link->SRQLineState(); - //- Cf Keithley doc to know how the to get the wanted event + //- Cf Keithley doc to know how the to get the wanted event //- Chapter : Status Structure } // ============================================================================ // KeithleySCPIProtocol::readStatusByteRegister() // ============================================================================ -short KeithleySCPIProtocol::readStatusByteRegister (void) +short KeithleySCPIProtocol::readStatusByteRegister (void) { if( !this->_communication_link ) { throw electrometer::ElectrometerException( - "INITIALIZATION_ERROR", + "INITIALIZATION_ERROR", "No communication protocol available.", "KeithleySCPIProtocol::readStatusByteRegister()"); } - + //- 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 + //- Cf Keithley doc to know how the to get the wanted event //- Chapter : Status Structure } // ============================================================================ // KeithleySCPIProtocol::read_data_with_no_timestamp // ============================================================================ -void KeithleySCPIProtocol::read_data_with_no_timestamp (void) +void KeithleySCPIProtocol::read_data_with_no_timestamp (void) { if( !this->_communication_link ) { throw electrometer::ElectrometerException( - "INITIALIZATION_ERROR", + "INITIALIZATION_ERROR", "No communication protocol available.", "KeithleySCPIProtocol::read_data_with_no_timestamp()"); } - + std::string cmd_to_send("FORM:ELEM READ"); _communication_link->write(cmd_to_send); } @@ -1483,14 +1483,14 @@ void KeithleySCPIProtocol::read_data_with_no_timestamp (void) -// Following functions are part of commands supported via the SCPI protocol. +// Following functions are part of commands supported via the SCPI protocol. // We may have to implement them after first tests on beamlines /* // ============================================================================ // KeithleySCPIProtocol::setExternalFeedbackMeterMode // ============================================================================ -void KeithleySCPIProtocol::setExternalFeedbackMeterMode (void) +void KeithleySCPIProtocol::setExternalFeedbackMeterMode (void) { std::stringstream cmd_to_send; @@ -1502,7 +1502,7 @@ std::stringstream cmd_to_send; // ============================================================================ // KeithleySCPIProtocol::setVonIMeterMode // ============================================================================ -void KeithleySCPIProtocol::setVonIMeterMode (void) +void KeithleySCPIProtocol::setVonIMeterMode (void) { std::stringstream cmd_to_send; @@ -1527,12 +1527,12 @@ std::stringstream cmd_to_send; } */ -/* TO BE IMPLEMENTED !!!!! +/* TO BE IMPLEMENTED !!!!! // ============================================================================ // KeithleySCPIProtocol::reading_source // ============================================================================ -void KeithleySCPIProtocol::reading_source (void) +void KeithleySCPIProtocol::reading_source (void) { } @@ -1540,7 +1540,7 @@ void KeithleySCPIProtocol::reading_source (void) // ============================================================================ // KeithleySCPIProtocol::reading_source // ============================================================================ -void KeithleySCPIProtocol::data_store (void) +void KeithleySCPIProtocol::data_store (void) { } @@ -1548,7 +1548,7 @@ void KeithleySCPIProtocol::data_store (void) // ============================================================================ // KeithleySCPIProtocol::reading_source // ============================================================================ -void KeithleySCPIProtocol::data_format (void) +void KeithleySCPIProtocol::data_format (void) { } @@ -1556,7 +1556,7 @@ void KeithleySCPIProtocol::data_format (void) // ============================================================================ // KeithleySCPIProtocol::reading_source // ============================================================================ -void KeithleySCPIProtocol::baseline_suppression_ON (void) +void KeithleySCPIProtocol::baseline_suppression_ON (void) { } @@ -1564,14 +1564,14 @@ void KeithleySCPIProtocol::baseline_suppression_ON (void) // ============================================================================ // KeithleySCPIProtocol::reading_source // ============================================================================ -void KeithleySCPIProtocol::baseline_suppression_OFF (void) +void KeithleySCPIProtocol::baseline_suppression_OFF (void) { } // ============================================================================ // KeithleySCPIProtocol::reading_source // ============================================================================ -void KeithleySCPIProtocol::keithley_status (void) +void KeithleySCPIProtocol::keithley_status (void) { } diff --git a/src/TangoGpibLink.cpp b/src/TangoGpibLink.cpp index 6763c0054bc389c51126672aacf6b73e28536811..0709f345b7a62808de7ca7545410a1b9a0120887 100644 --- a/src/TangoGpibLink.cpp +++ b/src/TangoGpibLink.cpp @@ -22,14 +22,12 @@ // ============================================================================ // TangoGpibLink::TangoGpibLink // ============================================================================ -TangoGpibLink::TangoGpibLink (std::string& gpib_device_name) +TangoGpibLink::TangoGpibLink (std::string& gpib_device_name) : CommunicationLink(gpib_device_name), _gpib_proxy (0) { std::cout << "TangoGpibLink::TangoGpibLink <-" << std::endl; - - response.erase(); - + std::cout << "TangoGpibLink::TangoGpibLink ->" << std::endl; } @@ -39,13 +37,13 @@ TangoGpibLink::TangoGpibLink (std::string& gpib_device_name) TangoGpibLink::~TangoGpibLink (void) { std::cout << "TangoGpibLink::~TangoGpibLink <-" << std::endl; - + if(_gpib_proxy) { delete _gpib_proxy; _gpib_proxy = 0; } - + std::cout << "TangoGpibLink::~TangoGpibLink ->" << std::endl; } @@ -56,7 +54,7 @@ TangoGpibLink::~TangoGpibLink (void) void TangoGpibLink::create_gpib_proxy (void) throw (Tango::DevFailed) { std::string description(""); - + try { //- try @@ -65,7 +63,7 @@ void TangoGpibLink::create_gpib_proxy (void) throw (Tango::DevFailed) catch(Tango::DevFailed& df ) { description = "Unable to create proxy on : " + _communication_Device_name + ". Check GPIB device is up !"; - + Tango::Except::re_throw_exception (df, (const char*)"COMMUNICATION_ERROR", description.c_str(), @@ -90,7 +88,7 @@ void TangoGpibLink::write (std::string command_to_send) throw (Tango::DevFailed Tango::DeviceData dd_in; Tango::DevString cmd = 0; std::string description(""); - + if(!_gpib_proxy) create_gpib_proxy(); try @@ -135,7 +133,7 @@ void TangoGpibLink::write (std::string command_to_send) throw (Tango::DevFailed (const char*)"COMMUNICATION_ERROR", description.c_str(), (const char*)"TangoGpibLink::write"); - + } catch(...) { @@ -155,16 +153,17 @@ void TangoGpibLink::write (std::string command_to_send) throw (Tango::DevFailed // ============================================================================ std::string TangoGpibLink::read (void) throw (Tango::DevFailed) { - Tango::DeviceData dd_out; - + Tango::DeviceData dd_out; + std::string response(""); + if(!_gpib_proxy) create_gpib_proxy(); - + try { //- try dd_out = this->_gpib_proxy->command_inout("Read"); - dd_out >> this->response; + dd_out >> response; } catch(Tango::DevFailed& df ) { @@ -180,8 +179,8 @@ std::string TangoGpibLink::read (void) throw (Tango::DevFailed) (const char*)"Unable to perform a read operation, caught [...].", (const char*)"TangoGpibLink::read"); } - - return this->response; + + return response; } // ============================================================================ @@ -190,12 +189,13 @@ std::string TangoGpibLink::read (void) throw (Tango::DevFailed) std::string TangoGpibLink::write_read (std::string command_to_send, size_t /*unusedLgth*/) throw (Tango::DevFailed) { std::string description(""); - + std::string response(""); + if(!_gpib_proxy) create_gpib_proxy(); Tango::DeviceData dd_in, dd_out; Tango::DevString argin = 0; - + try { //- try @@ -203,7 +203,7 @@ std::string TangoGpibLink::write_read (std::string command_to_send, size_t /*unu strcpy(argin, command_to_send.c_str()); dd_in << argin; dd_out = this->_gpib_proxy->command_inout("WriteRead", dd_in); - dd_out >> this->response; + dd_out >> response; if ( argin ) delete [] argin; } @@ -215,7 +215,7 @@ std::string TangoGpibLink::write_read (std::string command_to_send, size_t /*unu Tango::Except::re_throw_exception (df, (const char*)"COMMUNICATION_ERROR", description.c_str(), - (const char*)"TangoGpibLink::write_read"); + (const char*)"TangoGpibLink::write_read"); } catch(...) { @@ -228,7 +228,7 @@ std::string TangoGpibLink::write_read (std::string command_to_send, size_t /*unu (const char*)"TangoGpibLink::write_read"); } - return this->response; + return response; } // ============================================================================ @@ -239,10 +239,10 @@ bool TangoGpibLink::SRQLineState (void) throw (Tango::DevFailed) std::string description(""); bool result = false; Tango::DeviceData dd_out; - + if(!_gpib_proxy) create_gpib_proxy(); - + try { //- try @@ -252,12 +252,12 @@ bool TangoGpibLink::SRQLineState (void) throw (Tango::DevFailed) catch(Tango::DevFailed& df ) { description = "Unable to get Gpib SRQ line state."; - + Tango::Except::re_throw_exception (df, (const char*)"COMMUNICATION_ERROR", description.c_str(), (const char*)"TangoGpibLink::SRQLineState"); - + } catch(...) { @@ -280,10 +280,10 @@ short TangoGpibLink::readStatusByteRegister (void) throw (Tango::DevFailed) short result = -1; Tango::DeviceAttribute da_out; - + if(!_gpib_proxy) create_gpib_proxy(); - + try { //- try @@ -293,13 +293,13 @@ short TangoGpibLink::readStatusByteRegister (void) throw (Tango::DevFailed) catch(Tango::DevFailed& df ) { description = "Unable to get device status byte register."; - + Tango::Except::re_throw_exception (df, (const char*)"COMMUNICATION_ERROR", description.c_str(), (const char*)"TangoGpibLink::readStatusByteRegister"); - - } + + } catch(...) { description = "Unable to get device status byte register."; @@ -318,10 +318,10 @@ short TangoGpibLink::readStatusByteRegister (void) throw (Tango::DevFailed) void TangoGpibLink::clear (void) throw (Tango::DevFailed) { std::string description(""); - + if(!_gpib_proxy) create_gpib_proxy(); - + try { //- try @@ -333,8 +333,8 @@ void TangoGpibLink::clear (void) throw (Tango::DevFailed) Tango::Except::re_throw_exception (df, (const char*)"COMMUNICATION_ERROR", description.c_str(), - (const char*)"TangoGpibLink::clear"); - } + (const char*)"TangoGpibLink::clear"); + } catch(...) { description = "Unable send Clear Device command."; @@ -351,10 +351,10 @@ void TangoGpibLink::clear (void) throw (Tango::DevFailed) void TangoGpibLink::trigger (void) throw (Tango::DevFailed) { std::string description(""); - + if(!_gpib_proxy) create_gpib_proxy(); - + try { //- try diff --git a/src/TangoSerialLink.cpp b/src/TangoSerialLink.cpp index 593b3ff62c96c5b094629f868455af8cd54ba4d6..cc32c4dc598a9dfcefaee2871027a80f84a104a5 100644 --- a/src/TangoSerialLink.cpp +++ b/src/TangoSerialLink.cpp @@ -25,15 +25,13 @@ static const long MODE_LINE = 2; // ============================================================================ // TangoSerialLink::TangoSerialLink // ============================================================================ -TangoSerialLink::TangoSerialLink (std::string& serial_device_name) +TangoSerialLink::TangoSerialLink (std::string& serial_device_name) : CommunicationLink(serial_device_name), _serial_proxy (0), _is_serial_proxy_created (false) { // //std::cout << "TangoSerialLink::TangoSerialLink <-" << std::endl; - response.erase(); - // //std::cout << "TangoSerialLink::TangoSerialLink ->" << std::endl; } @@ -119,7 +117,7 @@ void TangoSerialLink::write (std::string command_to_send) throw (Tango::DevFail } catch(Tango::DevFailed& df ) { - if( argin ) + if( argin ) { delete [] argin; argin = 0; @@ -144,7 +142,7 @@ void TangoSerialLink::write (std::string command_to_send) throw (Tango::DevFail //- try dd_in << argin; this->_serial_proxy->command_inout("DevSerWriteString", dd_in); - if( argin ) + if( argin ) { delete [] argin; argin = 0; @@ -153,7 +151,7 @@ void TangoSerialLink::write (std::string command_to_send) throw (Tango::DevFail } catch(Tango::DevFailed& df ) { - if( argin ) + if( argin ) { delete [] argin; argin = 0; @@ -167,7 +165,7 @@ void TangoSerialLink::write (std::string command_to_send) throw (Tango::DevFail } catch(...) { - if( argin ) + if( argin ) { delete [] argin; argin = 0; @@ -189,13 +187,14 @@ std::string TangoSerialLink::read (void) throw (Tango::DevFailed) if(!_serial_proxy) create_serial_proxy(); - Tango::DeviceData dd_out; + Tango::DeviceData dd_out; + std::string response(""); try { //- try in mode LINE dd_out = this->_serial_proxy->command_inout("DevSerReadLine"); - dd_out >> this->response; + dd_out >> response; } catch(Tango::DevFailed& df ) { @@ -212,7 +211,7 @@ std::string TangoSerialLink::read (void) throw (Tango::DevFailed) (const char*)"TangoSerialLink::read"); } - return this->response ; + return response ; } // ============================================================================ @@ -225,14 +224,15 @@ std::string TangoSerialLink::read (long nbCharToRead) throw (Tango::DevFailed) create_serial_proxy(); Tango::DeviceData dd_in; Tango::DeviceData dd_out; + std::string response(""); try { dd_in << nbCharToRead; //- try get the specified nb characters dd_out = this->_serial_proxy->command_inout("DevSerReadNChar", dd_in); - dd_out >> this->response; - //std::cout << "TangoSerialLink::read -> nb_char = " << nbCharToRead << " and resp : \"" << this->response << "\"" << std::endl; + dd_out >> response; + //std::cout << "TangoSerialLink::read -> nb_char = " << nbCharToRead << " and resp : \"" << response << "\"" << std::endl; } catch(Tango::DevFailed& df ) { @@ -242,7 +242,7 @@ std::string TangoSerialLink::read (long nbCharToRead) throw (Tango::DevFailed) (const char*)"TangoSerialLink::read(nChar)"); } - return this->response ; + return response ; } // ============================================================================ @@ -282,7 +282,7 @@ std::string TangoSerialLink::write_read (std::string command_to_send, size_t nbC } //std::cout << "END WHILE -> nbRetries = " << nbRetries << " & nbCharReceived = " << nbCharReceived << std::endl; - // now read response from HW + // now read response from HW return this->read(nbChar); }