Implementing a generic SCPI class
Many PS use SCPI so a generic SCPIPs class has been created. PS that use SCPI will inherit from the SCPIPs class.
They include:
- AgilentE3631APs
- AgilentE3634APs
- AgilentE364xAPs
- RS_HMPXXXX
- RigolDP832
This MR addresses issue 28
@mariog , could you please verify that this runs without issues on your RS_HMPXXXX PS?
Merge request reports
Activity
- Resolved by Elodie Deborah Resseguie
Hi Elodie,
I'm afraid it's not working for us, since the implementation on this branch is trying to communicate with our HMP4040 via gpib, but we are just using usb. This is the trace from the "powersupply" binary until the error (from top to bottom)
file function line powersupply.cpp main(int argc, char*argv[])
std::shared_ptr<IPowerSupply> PSreal = hw.getPowerSupply(name);
EquipConf.cpp EquipConf::getPowerSupply(const std::string& name)
ps->checkCompatibilityList();
IPowerSupply.cpp IPowerSupply::checkCompatibilityList()
std::string idn = identify();
SCPIPs.cpp SCPIPs::identify()
std::string idn=this->receive("*IDN?");
SCPIPs.cpp SCPIPs::receive(const std::string& cmd)
m_com->write("++addr " + std::to_string(m_config["communication"]["gpib_addr"].get<uint32_t>()) + "\n\r");
So it returns an error since we don't have any "gpib_addr" entry the json config for this PS, which looks like
"HMP4040" : { "hw-type": "PS", "hw-model": "RS_HMPXXXX", "communication": { "protocol" : "usb", "port" : "/dev/ttyACM0" } }
If I add the entry with a dummy value, the error moves to SerialCom.cpp (
Error reading from /dev/ttyACM0: Resource temporarily unavailable
). I don't know if I'm missing something or doing anything wrong.Are both the Agilent and the Rigol PSs using the GPIB protocol?
- Resolved by Elodie Deborah Resseguie
@eressegu, I've been getting a different error now, coming from
SerialCom.cpp
, and due to the way we send commands to the PS by calling thewrite
function fromSCPIPs.cpp
.The error is
terminate called after throwing an instance of 'std::runtime_error' what(): Error reading from /dev/ttyACM0: Resource temporarily unavailable Aborted (core dumped)
And the solution is to change all the
\n\r
sequences in thesend
andreceive
functions ofSCPIPs.cpp
to just\n
.I'm wondering now if this would affect the Rigol and Agilent PSs.
mentioned in issue #35 (closed)
added 6 commits
-
f2b5db12...87eddd63 - 4 commits from branch
devel
- 86b5bf64 - creating SCPIPs class and migrating PS that use that language to inherit from that class
- 259595c9 - add check for gpib address
-
f2b5db12...87eddd63 - 4 commits from branch
added libPS label
added 1 commit
- d0c6d5d3 - remove registration for AgilentPs and SCPIPs
- Resolved by Elodie Deborah Resseguie
added 1 commit
- 026732dd - register Agilent and SCPI, add turn on/off functions for AgilentE3631APs
mentioned in issue #36