Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Achim Morschhauser
GeomagLogger
Commits
8942b29f
Commit
8942b29f
authored
Nov 08, 2018
by
Achim Morschhauser
Browse files
set baud rate (OBSDAQ)
parent
976309c5
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/driver_obs_obsdaq.cpp
View file @
8942b29f
...
...
@@ -1069,6 +1069,12 @@ int driver_obs_obsdaq::init_run(double freq){
fprintf
(
stderr
,
"Frequency set to: %6.2f Hz. "
"Requested frequency: %6.2f Hz.
\n
"
,
driver_obs
::
freq
,
freq
);
/////////////////////////////////////////////////////////////////////////
//
// Set the internal trigger frequency (Manual 12.6).
//
/////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////
//
...
...
@@ -1159,6 +1165,8 @@ int driver_obs_obsdaq::set_baud(int baud) {
cmd
=
"%"
+
RS485_addrstr
+
"00"
+
it_map_baud
->
second
+
"00"
;
send
(
cmd
.
c_str
());
////////////////////////////////////////////////////////////////////////
//
...
...
@@ -1174,6 +1182,7 @@ int driver_obs_obsdaq::set_baud(int baud) {
// Check for response
//
////////////////////////////////////////////////////////////////////////
waitanswer
(
1
);
if
(
checked_send
(
"$M"
,
"<ObsDaq"
,
7
,
0.2
,
0
)
!=
0
){
return
(
-
1
);
}
...
...
@@ -1222,16 +1231,15 @@ int driver_obs_obsdaq::check_baud(int baud){
////////////////////////////////////////////////////////////////////////
send
(
"$M"
);
// Check for expected response
if
(
checked_send
(
"$M"
,
"<ObsDaq"
,
7
,
0.2
,
0
)
!=
0
)
{
// No response, but freerun mode might be running, so check for data
int
n
=
0
;
for
(
int
i
=
0
;
i
<
3
;
i
++
)
{
for
(
int
i
=
0
;
i
<
2
;
i
++
)
{
if
(
waitanswer
(
0.4
)
==
0
)
n
++
;
}
fprintf
(
stderr
,
"N: %d
\n
"
,
n
);
if
(
n
<
3
)
{
if
(
n
<
2
)
{
return
(
-
1
);
}
}
...
...
usr/parameters.par
View file @
8942b29f
# Baudrate for ObsDAQ
BAUD=
96
00 #19200
BAUD=
192
00 #19200
# PORT for ObsDAQ
PORT=/dev/ttyUSB0
# Resistance of variometer
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment