Commit 8942b29f authored by Achim Morschhauser's avatar Achim Morschhauser
Browse files

set baud rate (OBSDAQ)

parent 976309c5
......@@ -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);
}
}
......
# Baudrate for ObsDAQ
BAUD=9600 #19200
BAUD=19200 #19200
# PORT for ObsDAQ
PORT=/dev/ttyUSB0
# Resistance of variometer
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment