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
d4800cd3
Commit
d4800cd3
authored
15 years ago
by
ELATTAOUI
Browse files
Options
Downloads
Patches
Plain Diff
DDC part : no more data with prefix, this slow down the communication.
parent
1174b201
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/KeithleyDDCProtocol.cpp
+11
-29
11 additions, 29 deletions
src/KeithleyDDCProtocol.cpp
src/Keithley_485.cpp
+22
-21
22 additions, 21 deletions
src/Keithley_485.cpp
with
33 additions
and
50 deletions
src/KeithleyDDCProtocol.cpp
+
11
−
29
View file @
d4800cd3
...
...
@@ -32,7 +32,7 @@ KeithleyDDCProtocol::KeithleyDDCProtocol (std::string& gpib_device_name)
_commDevName
=
gpib_device_name
;
std
::
cout
<<
"KeithleyDDCProtocol::KeithleyDDCProtocol ->
"
<<
std
::
endl
;
std
::
cout
<<
"KeithleyDDCProtocol::KeithleyDDCProtocol ->
"
<<
_commDevName
<<
std
::
endl
;
}
// ============================================================================
...
...
@@ -58,7 +58,8 @@ bool KeithleyDDCProtocol::build_communicationLink()
if
(
!
_communication_link
)
return
false
;
//- Read data with no prefix
//- For DDC models are very slow devices, so communication with
//- prefix is disabled !
this
->
disable_readingWithPrefix
();
return
true
;
...
...
@@ -203,7 +204,6 @@ std::stringstream cmd_to_send;
//- send command
cmd_to_send
<<
"R12X"
<<
std
::
ends
;
_communication_link
->
write
(
cmd_to_send
.
str
());
}
// ============================================================================
...
...
@@ -222,7 +222,6 @@ std::stringstream cmd_to_send;
//- send command
cmd_to_send
<<
"F1X"
<<
std
::
ends
;
_communication_link
->
write
(
cmd_to_send
.
str
());
}
// ============================================================================
...
...
@@ -295,28 +294,19 @@ std::string KeithleyDDCProtocol::get_value (void)
std
::
stringstream
cmd_to_send
;
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;
//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());
//- check if device range is overloaded
//- get data value
cmd_to_send
<<
"X"
<<
std
::
ends
;
_communication_link
->
write_read
(
cmd_to_send
.
str
());
argout
=
_communication_link
->
read
();
std
::
cout
<<
"KeithleyDDCProtocol::get_value = "
<<
argout
<<
std
::
endl
;
//- check if device range is overloaded : First char of the prefix !
//if(argout[0] == 'O')
// _is_overloaded = true;
//else
// _is_overloaded = false;
//- return value : data begin at idx 4
//
//- return value : data begin at idx 4
//argout = argout.substr(4);
return
argout
;
}
...
...
@@ -413,16 +403,12 @@ std::string KeithleyDDCProtocol::get_raw_status (void)
std
::
stringstream
cmd_to_send
;
std
::
string
argout
(
"no data"
);
//- send command : G0X -> show prefix ( = keithley type )
//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
<<
"KeithleyDDCProtocol::get_raw_status returns *"
<<
argout
<<
"*"
<<
std
::
ends
;
// this->disable_readingWithPrefix();
return
argout
;
}
...
...
@@ -435,16 +421,12 @@ std::string KeithleyDDCProtocol::get_DDC_configuration (void)
std
::
stringstream
cmd_to_send
;
std
::
string
argout
(
"no data"
);
//- send command : G0X -> show prefix ( = keithley type )
//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
<<
"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
+
22
−
21
View file @
d4800cd3
...
...
@@ -22,6 +22,10 @@
#include
"KeithleyDDCProtocol.h"
#include
"Keithley_485.h"
/*
* model number
*/
static
std
::
string
MODEL_NUMBER
=
"485"
;
/*
* Valid Range values for a K_485
*/
static
const
std
::
string
K485_rangeValue
[]
=
{
"AUTO ON"
,
"2E-9"
,
"2E-8"
,
"2E-7"
,
"2E-6"
,
"2E-5"
,
"2E-4"
,
"2E-3"
};
...
...
@@ -98,7 +102,7 @@ bool Keithley_485::init_protocol (void)
// ============================================================================
void
Keithley_485
::
range_up
(
void
)
{
std
::
stringstream
cmd_to_send
;
std
::
stringstream
cmd_to_send
(
""
)
;
// force read of range on instrument to update _range variable
electrometer_status
();
...
...
@@ -123,8 +127,7 @@ std::stringstream cmd_to_send;
// ============================================================================
void
Keithley_485
::
range_down
(
void
)
{
std
::
stringstream
cmd_to_send
;
std
::
stringstream
cmd_to_send
(
""
);
// force read of range on instrument to update _range variable
electrometer_status
();
...
...
@@ -159,7 +162,7 @@ std::string Keithley_485::get_ElectroMeterRange (void)
// ============================================================================
void
Keithley_485
::
set_triggerMode
(
short
trigMod
)
{
std
::
stringstream
cmd_to_send
;
std
::
stringstream
cmd_to_send
(
""
)
;
if
(
trigMod
<
0
||
trigMod
>
K485_triggerModeLimit
)
throw
electrometer
::
ElectrometerException
(
"OUT_OF_RANGE"
,
...
...
@@ -178,7 +181,7 @@ std::stringstream cmd_to_send;
std
::
string
Keithley_485
::
electrometer_status
(
void
)
{
std
::
string
_kstatus
(
"undefined status"
);
std
::
string
defaultStatus
(
"0000000000"
);
std
::
string
defaultStatus
(
"
485
0000000000"
);
std
::
string
argout
(
""
);
std
::
string
tmp
(
""
);
...
...
@@ -197,7 +200,7 @@ std::string Keithley_485::electrometer_status (void)
// argout = "Invalid status string received";
// return argout;
//}
//
argout = "Keithley Type : " +
modelNum
+ "\n";
argout
=
"Keithley Type : "
+
MODEL_NUMBER
+
"
\n
"
;
if
(
_kstatus
.
size
()
<
defaultStatus
.
size
()
)
{
argout
=
_kstatus
;
...
...
@@ -220,7 +223,7 @@ std::string Keithley_485::electrometer_status (void)
tmp
=
_kstatus
.
substr
(
2
,
1
);
_range
=
XString
<
short
>::
convertFromString
(
tmp
);
_rangeStr
=
K485_rangeValue
[
_range
];
argout
+=
_rangeStr
+
"
\n
"
;
argout
+=
"Range : "
+
_rangeStr
+
"
\n
"
;
//- Relative (baseline suppress)
tmp
=
_kstatus
.
substr
(
3
,
1
);
if
(
XString
<
short
>::
convertFromString
(
tmp
))
...
...
@@ -279,31 +282,29 @@ std::string Keithley_485::electrometer_status (void)
else
if
(
srqInfo
==
25
)
argout
+=
"SRQ Data Mask : Busy, Reading Done or Reading Overflow
\n
"
;
//- SRQ Error Mask
tmp
=
_kstatus
.
substr
(
6
,
2
);
short
srqMaskErr
=
XString
<
short
>::
convertFromString
(
tmp
);
if
(
!
srqMaskErr
)
argout
+=
"SRQ Error Mask : SRQ Disabled
\n
"
;
else
if
(
srqMaskErr
==
1
)
argout
+=
"SRQ Error Mask : IDDCO
\n
"
;
if
(
srqInfo
==
32
)
argout
+=
"SRQ Error Mask : Clear SRQ Errol mask
\n
"
;
else
if
(
srqInfo
==
33
)
argout
+=
"SRQ Error Mask : IDDCQ
\n
"
;
else
if
(
srq
MaskErr
==
2
)
if
(
srq
Info
==
34
)
argout
+=
"SRQ Error Mask : IDDC
\n
"
;
else
if
(
srq
MaskErr
==
3
)
argout
+=
"SRQ Error Mask : IDDC
O
or IDDC
\n
"
;
if
(
srq
Info
==
3
5
)
argout
+=
"SRQ Error Mask : IDDC or IDDC
O
\n
"
;
else
if
(
srq
MaskErr
==
4
)
if
(
srq
Info
==
36
)
argout
+=
"SRQ Error Mask : Not in Remote
\n
"
;
else
if
(
srq
MaskErr
==
5
)
if
(
srq
Info
==
37
)
argout
+=
"SRQ Error Mask : Not in Remote or IDDCO
\n
"
;
else
if
(
srq
MaskErr
==
6
)
if
(
srq
Info
==
38
)
argout
+=
"SRQ Error Mask : Not in Remote or IDDC
\n
"
;
else
if
(
srq
MaskErr
==
7
)
if
(
srq
Info
==
39
)
argout
+=
"SRQ Error Mask : Not in Remote, IDDCO or IDDC
\n
"
;
}
catch
(
std
::
out_of_range
)
...
...
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