Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
E
Electrometers
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
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
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Software Control System
Tango devices
MeasureInstruments
lib
Electrometers
Commits
1174b201
Commit
1174b201
authored
15 years ago
by
ELATTAOUI
Browse files
Options
Downloads
Patches
Plain Diff
xavier :
Keithley DDC part -> no more data with prefix TODO : change all DDC files.
parent
93dad89e
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
pom.xml
+1
-1
1 addition, 1 deletion
pom.xml
src/KeithleyDDCProtocol.cpp
+22
-17
22 additions, 17 deletions
src/KeithleyDDCProtocol.cpp
src/Keithley_485.cpp
+21
-14
21 additions, 14 deletions
src/Keithley_485.cpp
with
44 additions
and
32 deletions
pom.xml
+
1
−
1
View file @
1174b201
...
...
@@ -8,7 +8,7 @@
</parent>
<groupId>
fr.soleil.lib
</groupId>
<artifactId>
Electrometers-${aol}-${library}-${mode}
</artifactId>
<version>
2.2.
1
</version>
<version>
2.2.
2
</version>
<packaging>
nar
</packaging>
<name>
Electrometers library
</name>
<description>
Electrometers library
</description>
...
...
This diff is collapsed.
Click to expand it.
src/KeithleyDDCProtocol.cpp
+
22
−
17
View file @
1174b201
...
...
@@ -58,6 +58,9 @@ bool KeithleyDDCProtocol::build_communicationLink()
if
(
!
_communication_link
)
return
false
;
//- Read data with no prefix
this
->
disable_readingWithPrefix
();
return
true
;
}
...
...
@@ -294,25 +297,27 @@ std::string argout("no data");
//- send command : G0X -> prefix (to check if device overload !) and second X to get data
// cmd_to_send << "G0" << std::ends;
// _communication_link->write(cmd_to_send.str());
this
->
enable_readingWithPrefix
();
//- get data value
// cmd_to_send << "X" << std::ends;
argout
=
_communication_link
->
read
();
//this->disable_readingWithPrefix();
//- get data value
cmd_to_send
<<
"X"
<<
std
::
ends
;
_communication_link
->
write
(
cmd_to_send
.
str
());
argout
=
_communication_link
->
read
();
std
::
cout
<<
"KeithleyDDCProtocol::get_value = "
<<
argout
<<
std
::
endl
;
// this->enable_readingWithPrefix();
//- send command : G1X -> no prefix and second X to get data
// cmd_to_send << "G1X" << std::ends;
// _communication_link->write(cmd_to_send.str());
this
->
disable_readingWithPrefix
();
//- check if device range is overloaded
if
(
argout
[
0
]
==
'O'
)
_is_overloaded
=
true
;
else
_is_overloaded
=
false
;
//
if(argout[0] == 'O')
//
_is_overloaded = true;
//
else
//
_is_overloaded = false;
//- return value : data begin at idx 4
argout
=
argout
.
substr
(
4
);
//
argout = argout.substr(4);
return
argout
;
}
...
...
@@ -409,15 +414,15 @@ std::stringstream cmd_to_send;
std
::
string
argout
(
"no data"
);
//- send command : G0X -> show prefix ( = keithley type )
this
->
enable_readingWithPrefix
();
//
this->enable_readingWithPrefix();
cmd_to_send
.
str
(
""
);
//- get status word
cmd_to_send
<<
"U1X"
<<
std
::
endl
;
argout
=
_communication_link
->
write_read
(
cmd_to_send
.
str
());
//
std::cout << "
\n\n
KeithleyDDCProtocol::get_raw_status returns *" << argout << "*" << std::ends;
this
->
disable_readingWithPrefix
();
std
::
cout
<<
"KeithleyDDCProtocol::get_raw_status returns *"
<<
argout
<<
"*"
<<
std
::
ends
;
//
this->disable_readingWithPrefix();
return
argout
;
}
...
...
@@ -431,15 +436,15 @@ std::stringstream cmd_to_send;
std
::
string
argout
(
"no data"
);
//- send command : G0X -> show prefix ( = keithley type )
this
->
enable_readingWithPrefix
();
//
this->enable_readingWithPrefix();
cmd_to_send
.
str
(
""
);
//- get status word
cmd_to_send
<<
"U0X"
<<
std
::
endl
;
argout
=
_communication_link
->
write_read
(
cmd_to_send
.
str
());
//
std::cout << "
\n\n
KeithleyDDCProtocol::get_DDC_configuration returns *" << argout << "*" << std::ends;
this
->
disable_readingWithPrefix
();
std
::
cout
<<
"KeithleyDDCProtocol::get_DDC_configuration returns *"
<<
argout
<<
"*"
<<
std
::
ends
;
//
this->disable_readingWithPrefix();
return
argout
;
}
...
...
This diff is collapsed.
Click to expand it.
src/Keithley_485.cpp
+
21
−
14
View file @
1174b201
...
...
@@ -178,7 +178,8 @@ std::stringstream cmd_to_send;
std
::
string
Keithley_485
::
electrometer_status
(
void
)
{
std
::
string
_kstatus
(
"undefined status"
);
std
::
string
argout
(
"undefined status"
);
std
::
string
defaultStatus
(
"0000000000"
);
std
::
string
argout
(
""
);
std
::
string
tmp
(
""
);
//- read keithley status from HW
...
...
@@ -188,46 +189,52 @@ std::string Keithley_485::electrometer_status (void)
try
{
//- model number :
std
::
string
modelNum
=
_kstatus
.
substr
(
0
,
3
);
//- if not expected data (here model number)
if
(
modelNum
.
find
(
"485"
)
==
std
::
string
::
npos
)
//std::string modelNum = _kstatus.substr(0,3);
////- if not expected data (here model number)
//if(modelNum.find("485") == std::string::npos)
//{
// set_electroState(ALARM);
// argout = "Invalid status string received";
// return argout;
//}
//argout = "Keithley Type : " + modelNum + "\n";
if
(
_kstatus
.
size
()
<
defaultStatus
.
size
()
)
{
argout
=
_kstatus
;
set_electroState
(
ALARM
);
argout
=
"Invalid status string received"
;
return
argout
;
}
argout
=
"Keithley Type : "
+
modelNum
+
"
\n
"
;
//- Zero check state
tmp
=
_kstatus
.
substr
(
3
,
1
);
tmp
=
_kstatus
.
substr
(
0
,
1
);
if
(
XString
<
short
>::
convertFromString
(
tmp
))
argout
+=
"Zero Check : ON
\n
"
;
else
argout
+=
"Zero Check : OFF
\n
"
;
//- Log state
tmp
=
_kstatus
.
substr
(
4
,
1
);
tmp
=
_kstatus
.
substr
(
1
,
1
);
if
(
XString
<
short
>::
convertFromString
(
tmp
))
argout
+=
"Log : ON
\n
"
;
else
argout
+=
"Log : OFF
\n
"
;
//- Range
tmp
=
_kstatus
.
substr
(
5
,
1
);
tmp
=
_kstatus
.
substr
(
2
,
1
);
_range
=
XString
<
short
>::
convertFromString
(
tmp
);
_rangeStr
=
K485_rangeValue
[
_range
];
argout
+=
_rangeStr
+
"
\n
"
;
//- Relative (baseline suppress)
tmp
=
_kstatus
.
substr
(
6
,
1
);
tmp
=
_kstatus
.
substr
(
3
,
1
);
if
(
XString
<
short
>::
convertFromString
(
tmp
))
argout
+=
"Relative ON
\n
"
;
else
argout
+=
"Relative OFF
\n
"
;
//- Relative (baseline suppress)
tmp
=
_kstatus
.
substr
(
7
,
1
);
tmp
=
_kstatus
.
substr
(
4
,
1
);
if
(
XString
<
short
>::
convertFromString
(
tmp
))
argout
+=
"EOI : Send
\n
"
;
else
argout
+=
"EOI : Do Not Send
\n
"
;
//- Trigger
tmp
=
_kstatus
.
substr
(
8
,
1
);
tmp
=
_kstatus
.
substr
(
5
,
1
);
short
trigg
=
XString
<
short
>::
convertFromString
(
tmp
);
if
(
!
trigg
)
argout
+=
"Trigger : Continuous on Talk
\n
"
;
...
...
@@ -247,7 +254,7 @@ std::string Keithley_485::electrometer_status (void)
if
(
trigg
==
5
)
argout
+=
"Trigger :One-Shot on
\"
X
\"\n
"
;
//- SRQ Data Mask
tmp
=
_kstatus
.
substr
(
9
,
2
);
tmp
=
_kstatus
.
substr
(
6
,
2
);
short
srqInfo
=
XString
<
short
>::
convertFromString
(
tmp
);
if
(
!
srqInfo
)
argout
+=
"SRQ Data Mask : SRQ Disabled
\n
"
;
...
...
@@ -273,7 +280,7 @@ std::string Keithley_485::electrometer_status (void)
if
(
srqInfo
==
25
)
argout
+=
"SRQ Data Mask : Busy, Reading Done or Reading Overflow
\n
"
;
//- SRQ Error Mask
tmp
=
_kstatus
.
substr
(
9
,
2
);
tmp
=
_kstatus
.
substr
(
6
,
2
);
short
srqMaskErr
=
XString
<
short
>::
convertFromString
(
tmp
);
if
(
!
srqMaskErr
)
argout
+=
"SRQ Error Mask : SRQ Disabled
\n
"
;
...
...
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
register
or
sign in
to comment