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
0779db1d
Commit
0779db1d
authored
16 years ago
by
ELATTAOUI
Browse files
Options
Downloads
Patches
Plain Diff
xavier :
- bug in Novelec part fixed (END_OF_LINE!)
parent
7bd6c9e2
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/NovelecProtocol.cpp
+11
-5
11 additions, 5 deletions
src/NovelecProtocol.cpp
src/TangoSerialLink.cpp
+2
-1
2 additions, 1 deletion
src/TangoSerialLink.cpp
with
13 additions
and
6 deletions
src/NovelecProtocol.cpp
+
11
−
5
View file @
0779db1d
...
...
@@ -33,7 +33,7 @@ static const short RANGE_CMD_NUM = 8;
static
const
short
RESPONSE_LGTH_CMD_NUM
=
17
;
static
const
short
CLEAR_ERRORS_CMD_NUM
=
18
;
//- the specific new line character
static
const
char
END_OF_LINE
[]
=
{
'\r'
,
'\n'
};
static
const
char
END_OF_LINE
[]
=
{
13
,
10
,
0
};
//- modes allowed
static
const
std
::
string
mode_str
[]
=
{
"ERR : UNKNOWN MODE"
,
"ZERO V/F"
,
"OFFSET"
,
"LEAKAGE"
,
"TEST"
,
"MEASURE"
};
static
const
std
::
string
range_str
[
5
][
8
]
=
{
{
"1e-11AcC"
,
"3e-11AcC"
,
"1e-10AcC"
,
"3e-10AcC"
,
"OUT OF RANGE"
,
"OUT OF RANGE"
,
"OUT OF RANGE"
,
"OUT OF RANGE"
},
...
...
@@ -69,11 +69,14 @@ void NovelecProtocol::init_MCCE2_for_communication(void)
std
::
stringstream
explicite_resp
;
std
::
string
tmp
(
"no data"
);
std
::
cout
<<
"NovelecProtocol::init_MCCE2_for_communication(void) -> ENTERING ... ADDRESS = "
<<
this
->
_devAdd
<<
std
::
endl
;
//- CMD to enable PROG cmds
this
->
switch_MCCE2_OFF
();
//- this command is now called in the MCCE2 device !
std
::
cout
<<
"NovelecProtocol::switch_MCCE2_OFF() -> DONE !!!"
<<
std
::
endl
;
//- Clear error registers
this
->
clear_registers
();
std
::
cout
<<
"NovelecProtocol::clear_registers() -> DONE !!!"
<<
std
::
endl
;
//- send cmd to have an explicite response :
explicite_resp
<<
_devAdd
<<
" PROG "
<<
RESPONSE_LGTH_CMD_NUM
<<
" 1"
<<
END_OF_LINE
<<
std
::
endl
;
...
...
@@ -82,6 +85,7 @@ std::string tmp("no data");
check_command
(
tmp
);
//- if no error
_is_explicite_resp_enabled
=
true
;
std
::
cout
<<
"NovelecProtocol::init_MCCE2_for_communication(void) -> DONE !!!"
<<
std
::
endl
;
}
...
...
@@ -104,7 +108,7 @@ std::stringstream cmd_to_send;
std
::
string
tmp
(
"no data"
);
//- send cmd to have a explicite response :
cmd_to_send
<<
_devAdd
<<
" MEASURE 1"
<<
END_OF_LINE
<<
std
::
endl
;
cmd_to_send
<<
_devAdd
<<
" MEASURE 1
"
<<
END_OF_LINE
<<
std
::
endl
;
tmp
=
_communication_link
->
write_read
(
cmd_to_send
.
str
());
//- check only the command response
check_command
(
tmp
);
...
...
@@ -117,12 +121,14 @@ std::string tmp("no data");
// ============================================================================
void
NovelecProtocol
::
switch_MCCE2_OFF
(
void
)
{
std
::
stringstream
cmd_to_send
;
std
::
stringstream
toto
;
std
::
string
tmp
(
"no data"
);
std
::
cout
<<
"NovelecProtocol::switch_MCCE2_OFF : _devAdd"
<<
_devAdd
<<
endl
;
//- send cmd to have a explicite response :
cmd_to_send
<<
_devAdd
<<
" MEASURE 0"
<<
END_OF_LINE
<<
std
::
endl
;
tmp
=
_communication_link
->
write_read
(
cmd_to_send
.
str
());
toto
<<
_devAdd
<<
" MEASURE 0 "
<<
END_OF_LINE
<<
std
::
ends
;
std
::
cout
<<
"
\n\n
NovelecProtocol::switch_MCCE2_OFF -> CMD = ["
<<
toto
.
str
()
<<
"]"
<<
std
::
endl
;
tmp
=
_communication_link
->
write_read
(
toto
.
str
());
//- check only the command response
check_command
(
tmp
);
...
...
This diff is collapsed.
Click to expand it.
src/TangoSerialLink.cpp
+
2
−
1
View file @
0779db1d
...
...
@@ -121,7 +121,8 @@ std::string TangoSerialLink::read (void) throw (Tango::DevFailed)
try
{
//- try in mode LINE
this
->
_serial_proxy
->
command_inout
(
"DevSerReadString"
,
MODE_LINE
,
this
->
response
);
//this->_serial_proxy->command_inout("DevSerReadString", MODE_LINE ,this->response);
this
->
_serial_proxy
->
command_out
(
"DevSerReadLine"
,
this
->
response
);
}
catch
(
Tango
::
DevFailed
&
df
)
{
...
...
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