Commit 366fc1ee authored by Achim Morschhauser's avatar Achim Morschhauser
Browse files

AUX channels

parent 105f860b
......@@ -882,10 +882,10 @@ int driver_obs_obsdaq::parse_data_bin(data_obs_vector* data, char* buf) {
}
// Check supplementary data
if (buf[1]& (unsigned char) 64){
if (buf[1]&1){
if (buf[1] & (unsigned char) 64){
if (buf[1] & 1){
supp_count=1;
} else if (supp_count) {
} else {
supp_count+=1;
}
}
......@@ -920,12 +920,26 @@ int driver_obs_obsdaq::parse_data_bin(data_obs_vector* data, char* buf) {
//
// Extract data from supplementary channels
//
num = (uint32_t) 0x8000;
if ((buf[1]&64) && supp_count >= 3 && supp_count <=4){
if ((buf[1]&64) && supp_count >= 1 && supp_count <= 2){
n32 = ( ( (buf[11 ]&127) + ((buf[1]&4 )<<5) ) <<8 )
+ ( ( (buf[12 ]&127) + ((buf[1]&2 )<<6) ) );
n[supp_count] = ((double) ((int32_t) ((n32 ^ num) - num))) / 8000.0;
switch (supp_count) {
case 1:
n[3] = ((double) ((int32_t) ((n32 ^ num) - num)))
* 0.000575 + 1.0; break;
case 2:
n[4] = ((double) ((int32_t) ((n32 ^ num) - num)))
/ 128.0; break;
default:
n[supp_count] = ((double) ((int32_t) ((n32 ^ num) - num)))
/ 8000.0; break;
}
}
// Save the data
......
Markdown is supported
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