Bugfix for non contiguous channels are enabled on UlDAQ

This commit is contained in:
Thijs Hekman 2022-10-25 16:45:48 +02:00
parent bf854b4055
commit 441685ad32
1 changed files with 8 additions and 2 deletions

View File

@ -180,16 +180,22 @@ public:
std::vector<DaqInChanDescriptor> indescs;
boolvec eninchannels_without_mon = daq.eninchannels(false);
DEBUGTRACE_PRINT(eninchannels_without_mon.size());
// Initialize input, if any
dvec ranges = daq.inputRangeForEnabledChannels(false);
// Update range index only when an enabled channel is found.
us range_idx = 0;
for (us chin = 0; chin < 4; chin++) {
if (eninchannels_without_mon[chin] == true) {
DaqInChanDescriptor indesc;
indesc.type = DAQI_ANALOG_SE;
indesc.channel = chin;
double rangeval = ranges.at(chin);
double rangeval = ranges.at(range_idx);
range_idx++;
Range rangenum;
if (fabs(rangeval - 1.0) < 1e-8) {
rangenum = BIP1VOLTS;