Skip to content
Snippets Groups Projects
Commit 1e102017 authored by Karol Krizka's avatar Karol Krizka
Browse files

libPs: Add support for E3631A in AgilentPs and make it possible to set channel using a string.

parent 30c78831
Branches E3631A
No related tags found
No related merge requests found
......@@ -28,9 +28,11 @@ void AgilentPs::send(std::string cmd) {
std::string AgilentPs::receive(std::string cmd)
{
m_com->write("++addr " + std::to_string(m_addr) + "\n\r");
std::this_thread::sleep_for(std::chrono::milliseconds(m_wait));
logger(logDEBUG2) << __PRETTY_FUNCTION__ << " -> Sending: " << cmd;
cmd += "\r\n";
m_com->write(cmd);
std::this_thread::sleep_for(std::chrono::milliseconds(m_wait));
m_com->write("++read eoi\n\r");
std::this_thread::sleep_for(std::chrono::milliseconds(m_wait));
std::string buf;
......@@ -46,7 +48,7 @@ void AgilentPs::init() {
return !std::isspace(ch);
}).base(), idn.end());
if(idn!="HEWLETT-PACKARD,E3633A,0,2.4-6.1-2.1" && idn.find("E3644A") == std::string::npos ){
if(idn!="HEWLETT-PACKARD,E3633A,0,2.4-6.1-2.1" && idn.find("E3644A") == std::string::npos && idn.find("E3631A") == std::string::npos ){
throw "Unknown power supply: "+idn;
}
......@@ -58,11 +60,14 @@ void AgilentPs::init() {
this->send("SYST:BEEP:STAT OFF");//disable beep
}
void AgilentPs::setCh(unsigned ch) {
this->send("INST:SEL OUT" + std::to_string(ch));
}
void AgilentPs::setCh(const std::string& ch) {
this->send("INST:SEL " + ch);
}
void AgilentPs::setRange(unsigned range) {
this->send("VOLTAGE:RANGE P" + std::to_string(range) + "V");
}
......
......@@ -23,6 +23,7 @@ class AgilentPs : public GenericPs {
void init();
void setCh(unsigned ch);
void setCh(const std::string& ch);
void setRange(unsigned range);
void setVoltage(double volt);
std::string getVoltage();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment