Agilent6627A Class Reference

Inheritance diagram for Agilent6627A:

PowerSupply BaseInstrument

List of all members.


Detailed Description

Interface for the Agilent6627A power supply.

Author:
Andrea Giachero (Andrea.Giachero@lngs.infn.it)

Public Types

enum  AgilentError_t {
  NO_ERROR = 0, INVALID_CHAR = 1, INVALID_NUM = 2, INVALID_STR = 3,
  SYNTAX_ERROR = 4, NUMBER_RANGE = 5, NO_QUERY = 6, DISP_LENGTH = 7,
  BUFFER_FULL = 8, EEPROM_ERROR = 9, HARDWARE_ERR = 10, HDW_ERR_CH_1 = 11,
  HDW_ERR_CH_2 = 12, HDW_ERR_CH_3 = 13, HDW_ERR_CH_4 = 14, NO_MODEL_NUM = 15,
  CAL_ERROR = 16, UNCALIBRATED = 17, CAL_LOCKED = 18, SKIP_SLF_TST = 22,
  INVALID_CH = 30, UNKNOW_ERR = 31
}
 underlying enum with error types More...

Public Member Functions

 Agilent6627A (GPIBBaseInterface *iFace)
 ctor
virtual ~Agilent6627A ()
 dtor
virtual bool SetVoltage (double voltage, size_t channel)
 Sets the voltage of the specified output channel.
virtual bool GetVoltage (double &voltage, size_t channel)
 Get the present voltage setting of the specified output channel.
virtual bool GetOutputVoltage (double &voltage, size_t channel)
 Get the measured output voltage of the specified output channel.
virtual bool GetOutputCurrent (double &current, size_t channel)
 Gets the measured output current of the specified output channel.
virtual bool SetCurrent (double current, size_t channel)
 Sets the max current for the specified output channel.
virtual bool GetCurrent (double &current, size_t channel)
 Get the max current setting for the specified output channel.
virtual bool SetOutputEnable (bool enable, size_t channel)
 Turns the specified output channel on (true, 1) or off (false, 0).
virtual bool GetOutputEnable (bool &enable, size_t channel)
 Get whether the specified output channel is turned on or off.
virtual bool IsError () const
 Return true if an error occurred.
virtual size_t GetErrorCode () const
 Get the error code.
virtual const std::string & GetErrorMsg () const
 Get the error message.
virtual std::string GetIDN ()
 Get the instrument identification.
GPIBBaseInterfaceGetInterface () const
 Get Used GPIB Interface.

Private Member Functions

void SetErrorCode (size_t error)
 Set Error right code.
void SetErrorMsg (std::string err_msg)
 Set Error right message.
bool ResetError ()
 Reset Errors (code = 0x00, message="No Error").
bool ErrorCheck ()
 ask the hardware if an error occured
bool ChannelCheck (size_t channel)
 check if the specified output channel is valid
bool GetString (std::string cmd, std::string &value)
 Get string response (idn, etc) of the specified command.
bool GetDouble (std::string cmd, double &value)
 Get double response (voltage, current, etc) of the specified command.
bool GetBool (std::string cmd, bool &value)
 Get bool response (ON, OFF, etc) of the specified command.
bool ApplyCommand (std::string cmd)
 Interface between the class setters and GPIB Interface DoCommand() method.
bool ApplyCommand (std::string cmd, std::string &answer)
 Interface between the class setters and GPIB Interface DoCommand() method.

Private Attributes

GPIBBaseInterfacef_gpib
std::string f_error_msg
size_t f_error_code

Member Enumeration Documentation

underlying enum with error types

Enumerator:
NO_ERROR  Indicates there are no errors.
INVALID_CHAR  Character not recognize.
INVALID_NUM  The number format is incorrect.
INVALID_STR  Command not understand.
SYNTAX_ERROR  Command with improper syntax.
NUMBER_RANGE  An out of range number was sent.
NO_QUERY  The computer addressed the supply to talk, but it did not first request data.
DISP_LENGTH  Quoted string in the DSP command exceeds the display length of 12 characters.
BUFFER_FULL  May occur if too many numbers are sent.
EEPROM_ERROR  The EEPROM on the GP-IB board is not responding correctly to programming commands.
HARDWARE_ERR  An output error has occurred on an unknown output.
HDW_ERR_CH_1  Error codes refer to a specific output where an output error has occurred.
HDW_ERR_CH_2  Same as in error HDW_ERR_CH_1.
HDW_ERR_CH_3  Same as in error HDW_ERR_CH_1.
HDW_ERR_CH_4  Same as in error HDW_ERR_CH_1.
NO_MODEL_NUM  The supply’s model number cannot be found. The GP-IB Interface board may be defective or the supply may require reprogramming.
CAL_ERROR  An error has occurred during calibration.
UNCALIBRATED  Unexplained EEPROM error; possibly as the result of incorrect calibration procedure.
CAL_LOCKED  Calibration was attempted with the calibration jumper on the GP-IB board in the lockout position.
SKIP_SLF_TST  The self test jumper on the GP-IB board is in the Skip Self Test Position
INVALID_CH  The channel number is incorrect or out of range
UNKNOW_ERR  Uknown Error


Member Function Documentation

bool Agilent6627A::SetVoltage ( double  voltage,
size_t  channel 
) [virtual]

Sets the voltage of the specified output channel.

Parameters:
voltage value to set
channel specified output channel
Returns:
true on success, false on failure. In case of failure the error code is set. The error code can be retrieved by mean of GetErrorCode() while the error message can be retrieved by mean of GetErrorMsg()

Implements PowerSupply.

References ApplyCommand(), and ChannelCheck().

bool Agilent6627A::GetVoltage ( double &  voltage,
size_t  channel 
) [virtual]

Get the present voltage setting of the specified output channel.

Parameters:
voltage present voltage setting returned
channel specified output channel
Returns:
true on success, false on failure. In case of failure the error code is set. The error code can be retrieved by mean of GetErrorCode() while the error message can be retrieved by mean of GetErrorMsg()

Implements PowerSupply.

References ChannelCheck(), and GetDouble().

bool Agilent6627A::GetOutputVoltage ( double &  voltage,
size_t  channel 
) [virtual]

Get the measured output voltage of the specified output channel.

Parameters:
voltage measured output voltage returned
channel specified output channel
Returns:
true on success, false on failure. In case of failure the error code is set. The error code can be retrieved by mean of GetErrorCode() while the error message can be retrieved by mean of GetErrorMsg()

Implements PowerSupply.

References ChannelCheck(), and GetDouble().

bool Agilent6627A::GetOutputCurrent ( double &  current,
size_t  channel 
) [virtual]

Gets the measured output current of the specified output channel.

Parameters:
current measured output voltage returned
channel specified output channel
Returns:
true on success, false on failure. In case of failure the error code is set. The error code can be retrieved by mean of GetErrorCode() while the error message can be retrieved by mean of GetErrorMsg()

Implements PowerSupply.

References ChannelCheck(), and GetDouble().

bool Agilent6627A::SetCurrent ( double  current,
size_t  channel 
) [virtual]

Sets the max current for the specified output channel.

Parameters:
current value to set
channel specified output channel
Returns:
true on success, false on failure. In case of failure the error code is set. The error code can be retrieved by mean of GetErrorCode() while the error message can be retrieved by mean of GetErrorMsg()

Implements PowerSupply.

References ApplyCommand(), and ChannelCheck().

bool Agilent6627A::GetCurrent ( double &  current,
size_t  channel 
) [virtual]

Get the max current setting for the specified output channel.

Parameters:
current present current returned
channel specified output channel
Returns:
true on success, false on failure. In case of failure the error code is set. The error code can be retrieved by mean of GetErrorCode() while the error message can be retrieved by mean of GetErrorMsg()

Implements PowerSupply.

References ChannelCheck(), and GetDouble().

bool Agilent6627A::SetOutputEnable ( bool  enable,
size_t  channel 
) [virtual]

Turns the specified output channel on (true, 1) or off (false, 0).

Parameters:
enable enable staus, if true the specified output is turned on, otherwise (false) is turned off
channel specified output channel
Returns:
true on success, false on failure. In case of failure the error code is set. The error code can be retrieved by mean of GetErrorCode() while the error message can be retrieved by mean of GetErrorMsg()

Implements PowerSupply.

References ApplyCommand(), and ChannelCheck().

bool Agilent6627A::GetOutputEnable ( bool &  enable,
size_t  channel 
) [virtual]

Get whether the specified output channel is turned on or off.

Parameters:
enable response, The can be either true (1,turned on) or false (0, turned off).
channel specified output channel
Returns:
true on success, false on failure. In case of failure the error code is set. The error code can be retrieved by mean of GetErrorCode() while the error message can be retrieved by mean of GetErrorMsg()

Implements PowerSupply.

References ChannelCheck(), and GetBool().

virtual size_t Agilent6627A::GetErrorCode (  )  const [inline, virtual]

Get the error code.

Returns:
if an error occured returns the related errorcod

Implements BaseInstrument.

References f_error_code.

Referenced by ApplyCommand(), ErrorCheck(), and IsError().

virtual const std::string& Agilent6627A::GetErrorMsg (  )  const [inline, virtual]

Get the error message.

Returns:
if an error occured returns the related error message Otherwise return "No Error"

Implements BaseInstrument.

References f_error_msg.

Referenced by ApplyCommand(), and ErrorCheck().

bool Agilent6627A::ErrorCheck (  )  [private]

bool Agilent6627A::ChannelCheck ( size_t  channel  )  [private]

check if the specified output channel is valid

Returns:
if the channel il valid returns true, false otherwise

References PowerSupply::GetNumberOfChannel(), INVALID_CH, SetErrorCode(), and SetErrorMsg().

Referenced by GetCurrent(), GetOutputCurrent(), GetOutputEnable(), GetOutputVoltage(), GetVoltage(), SetCurrent(), SetOutputEnable(), and SetVoltage().

bool Agilent6627A::GetString ( std::string  cmd,
std::string &  value 
) [inline, private]

Get string response (idn, etc) of the specified command.

Parameters:
cmd GPIB command
voltage measured output voltage returned
Returns:
true on success, false on failure. In case of failure the error code is set. The error code can be retrieved by mean of GetErrorCode() while the error message can be retrieved by mean of GetErrorMsg()

References ApplyCommand().

Referenced by GetIDN().

bool Agilent6627A::GetDouble ( std::string  cmd,
double &  value 
) [private]

Get double response (voltage, current, etc) of the specified command.

Parameters:
cmd GPIB command
voltage measured output voltage returned
Returns:
true on success, false on failure. In case of failure the error code is set. The error code can be retrieved by mean of GetErrorCode() while the error message can be retrieved by mean of GetErrorMsg()

References ApplyCommand(), INVALID_CHAR, SetErrorCode(), and SetErrorMsg().

Referenced by GetCurrent(), GetOutputCurrent(), GetOutputVoltage(), and GetVoltage().

bool Agilent6627A::GetBool ( std::string  cmd,
bool &  value 
) [private]

Get bool response (ON, OFF, etc) of the specified command.

Parameters:
cmd GPIB command
voltage measured output voltage returned
Returns:
true on success, false on failure. In case of failure the error code is set. The error code can be retrieved by mean of GetErrorCode() while the error message can be retrieved by mean of GetErrorMsg()

References ApplyCommand(), ErrorCheck(), INVALID_CHAR, SetErrorCode(), and SetErrorMsg().

Referenced by GetOutputEnable().

bool Agilent6627A::ApplyCommand ( std::string  cmd  )  [private]

Interface between the class setters and GPIB Interface DoCommand() method.

Parameters:
cmd GPIB command
Returns:
true on success, false on failure. In case of failure the error code is set. The error code can be retrieved by mean of GetErrorCode() while the error message can be retrieved by mean of GetErrorMsg()

References ErrorCheck(), GetErrorCode(), GetErrorMsg(), GetInterface(), SetErrorCode(), and SetErrorMsg().

Referenced by GetBool(), GetDouble(), GetString(), SetCurrent(), SetOutputEnable(), and SetVoltage().

bool Agilent6627A::ApplyCommand ( std::string  cmd,
std::string &  answer 
) [private]

Interface between the class setters and GPIB Interface DoCommand() method.

Parameters:
cmd GPIB command
answer hardware response
Returns:
true on success, false on failure. In case of failure the error code is set. The error code can be retrieved by mean of GetErrorCode() while the error message can be retrieved by mean of GetErrorMsg()

References ErrorCheck(), GetErrorCode(), GetErrorMsg(), GetInterface(), SetErrorCode(), and SetErrorMsg().


Member Data Documentation

GPIB Interface

Referenced by GetInterface().

std::string Agilent6627A::f_error_msg [private]

Error Message, if no error occurs f_error_msg = "No Error"

Referenced by GetErrorMsg(), and SetErrorMsg().

size_t Agilent6627A::f_error_code [private]

Error code, if no error occurs f_error_code = "0x00"

Referenced by GetErrorCode(), and SetErrorCode().


The documentation for this class was generated from the following files:

Generated on Tue Nov 16 10:50:01 2010 for CUORE Software by  doxygen 1.5.6