Back Midas Rome Roody Rootana
  Midas DAQ System  Not logged in ELOG logo
Entry  09 Dec 2020, Frederik Wauters, Forum, history and variables confusion 
    Reply  09 Dec 2020, Stefan Ritt, Forum, history and variables confusion 
       Reply  10 Dec 2020, Frederik Wauters, Forum, history and variables confusion genesys.odb
          Reply  11 Dec 2020, Frederik Wauters, Forum, history and variables confusion 
             Reply  15 Dec 2020, Konstantin Olchanski, Forum, history and variables confusion 
                Reply  08 Jan 2021, Stefan Ritt, Forum, history and variables confusion 
Message ID: 2051     Entry time: 10 Dec 2020     In reply to: 2050     Reply to this: 2052
Author: Frederik Wauters 
Topic: Forum 
Subject: history and variables confusion 
I wanted to have a c++ style driver, e.g. a instance of a "PowerSupply" class. This was not compatible with the list of DEVICE_DRIVER structs, with needs a C function entry point with variable arguments. 

Anyways, I attach my odb. I believe the issue stands regardless of the specific design choice here. Setting the History Log flag copies the banks created to the "Variables" of every equipments initialized, leading to a mismatch between the names array, and the variables. Can be solved by not using FE history events, but Virtual, but the flag in the Equipment is confusing.  

Bank creation in readout function:

for(const auto& d: drivers)
{
...
...
  bk_create(pevent,bk_name, TID_FLOAT, (void **)&pdata);
...			
  std::vector<float> voltage = d->GetVoltage();
  std::vector<float> current = d->GetCurrent();
  for(channels)
  {
    *pdata++ = voltage.at(iChannel);
    *pdata++ = current.at(iChannel);
  }
  bk_close(pevent, pdata);
}
Attachment 1: genesys.odb  1 kB  Uploaded 10 Dec 2020  | Show | Show all
ELOG V3.1.4-2e1708b5