Back Midas Rome Roody Rootana
  Midas DAQ System  Not logged in ELOG logo
Entry  23 Oct 2023, Francesco Renga, Forum, Device with inputs and outputs 
    Reply  24 Oct 2023, Stefan Ritt, Forum, Device with inputs and outputs 
Message ID: 2623     Entry time: 24 Oct 2023     In reply to: 2622
Author: Stefan Ritt 
Topic: Forum 
Subject: Device with inputs and outputs 
The "multi" class driver takes care of that. It properly calls the SET and GET functions 
with the correct index. The code for that is in multi.cxx:105:

 device_driver(m_info->driver_input[i], CMD_GET,
               i - m_info->channel_offset_input[i],
               &m_info->var_input[i]);

The "channel_offset_input" and "channel_offset_output" store the first index of the 
channel in the overall ODB array (where inputs and outputs are staggered together), so 
the device_driver is always called with an index 0...n each for input and output, but 
with different commands CMD_GET and CMD_SET. You can take the mscbdev.cxx device driver 
as a working example.

Stefan
ELOG V3.1.4-2e1708b5