I am implementing hardware trigger support for the GTEC usb amplifier. My problem is that if I send 500 stimulation with "SetStimulations" method of the AcquistionServer then I get a different output number like: 350. I mean the driver sends 500 and Acqusition server sends 350 to the Designer. Not always - sometimes I just get the right number.
I have disabled the drfit correction, but I still get the wrong number of stimulations leaving the Acq. Server.
I think the code below is problematic. It changes the number of stimulations and before that they seem fine (when drift correction disabled):
File: ovasCAcquisitionServer.cpp
Method: boolean CAcquisitionServer::loop(void)
Position: after
// Eventually builds up buffer and
// sends data to connected client(s)
"start" and "end" added by me for clarity.
Code: Select all
uint64 start = (((m_ui64SampleCount-m_vPendingBuffer.size() )+l_rInfo.m_ui64SignalSampleCountToSkip<<32)/m_ui32SamplingFrequency;
uint64 end = (((m_ui64SampleCount-m_vPendingBuffer.size()+m_ui32SampleCountPerSentBlock)+l_rInfo.m_ui64SignalSampleCountToSkip)<<32)/m_ui32SamplingFrequency;
OpenViBEToolkit::Tools::StimulationSet::appendRange(
l_oStimulationSet,
m_oPendingStimulationSet,
start,end);
OpenViBEToolkit::Tools::StimulationSet::copy(*ip_pStimulationSet, l_oStimulationSet, -int64(l_rInfo.m_ui64StimulationTimeOffset));
This sounds plausible because when both are the same then this could be the case when I do not have the problem.
What do you think?
-Anton