Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
labRemote
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
scipp
labRemote
Commits
1e102017
Commit
1e102017
authored
Jul 25, 2019
by
Karol Krizka
Browse files
Options
Downloads
Patches
Plain Diff
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
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/libPs/AgilentPs.cpp
+7
-2
7 additions, 2 deletions
src/libPs/AgilentPs.cpp
src/libPs/AgilentPs.h
+1
-0
1 addition, 0 deletions
src/libPs/AgilentPs.h
with
8 additions
and
2 deletions
src/libPs/AgilentPs.cpp
+
7
−
2
View file @
1e102017
...
...
@@ -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"
);
}
...
...
This diff is collapsed.
Click to expand it.
src/libPs/AgilentPs.h
+
1
−
0
View file @
1e102017
...
...
@@ -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
();
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
sign in
to comment