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 ¤t, 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 ¤t, 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. | |
GPIBBaseInterface * | GetInterface () 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 | |
GPIBBaseInterface * | f_gpib |
std::string | f_error_msg |
size_t | f_error_code |
underlying enum with error types
bool Agilent6627A::SetVoltage | ( | double | voltage, | |
size_t | channel | |||
) | [virtual] |
Sets the voltage of the specified output channel.
voltage | value to set | |
channel | specified output channel |
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.
voltage | present voltage setting returned | |
channel | specified output channel |
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.
voltage | measured output voltage returned | |
channel | specified output channel |
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.
current | measured output voltage returned | |
channel | specified output channel |
Implements PowerSupply.
References ChannelCheck(), and GetDouble().
bool Agilent6627A::SetCurrent | ( | double | current, | |
size_t | channel | |||
) | [virtual] |
Sets the max current for the specified output channel.
current | value to set | |
channel | specified output channel |
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.
current | present current returned | |
channel | specified output channel |
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).
enable | enable staus, if true the specified output is turned on, otherwise (false) is turned off | |
channel | specified output channel |
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.
enable | response, The can be either true (1,turned on) or false (0, turned off). | |
channel | specified output channel |
Implements PowerSupply.
References ChannelCheck(), and GetBool().
virtual size_t Agilent6627A::GetErrorCode | ( | ) | const [inline, virtual] |
Get the error code.
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.
Implements BaseInstrument.
References f_error_msg.
Referenced by ApplyCommand(), and ErrorCheck().
bool Agilent6627A::ErrorCheck | ( | ) | [private] |
ask the hardware if an error occured
References BUFFER_FULL, CAL_ERROR, CAL_LOCKED, DISP_LENGTH, EEPROM_ERROR, GetErrorCode(), GetErrorMsg(), GetInterface(), BaseInstrument::GetName(), BaseInstrument::GetVendor(), HARDWARE_ERR, HDW_ERR_CH_1, HDW_ERR_CH_2, HDW_ERR_CH_3, HDW_ERR_CH_4, INVALID_CH, INVALID_CHAR, INVALID_NUM, INVALID_STR, NO_MODEL_NUM, NO_QUERY, NUMBER_RANGE, ResetError(), SetErrorCode(), SetErrorMsg(), SKIP_SLF_TST, SYNTAX_ERROR, UNCALIBRATED, and UNKNOW_ERR.
Referenced by ApplyCommand(), and GetBool().
bool Agilent6627A::ChannelCheck | ( | size_t | channel | ) | [private] |
check if the specified output channel is valid
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.
cmd | GPIB command | |
voltage | measured output voltage returned |
References ApplyCommand().
Referenced by GetIDN().
bool Agilent6627A::GetDouble | ( | std::string | cmd, | |
double & | value | |||
) | [private] |
Get double response (voltage, current, etc) of the specified command.
cmd | GPIB command | |
voltage | measured output voltage returned |
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.
cmd | GPIB command | |
voltage | measured output voltage returned |
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.
cmd | GPIB command |
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.
cmd | GPIB command | |
answer | hardware response |
References ErrorCheck(), GetErrorCode(), GetErrorMsg(), GetInterface(), SetErrorCode(), and SetErrorMsg().
GPIBBaseInterface* Agilent6627A::f_gpib [private] |
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().