huge difference.
In this case, a missing '=' was what was keeping me (and presumably
anyone else using a V1718 USB bridge) from taking data. This line of code:
while ( ((long)(data_size-=4) >0) && (( read_events<
user_setting.m_num_events)|| (user_setting.m_num_events<= 0)))
is very complicated. So lets look at the important part:
while( ((long) (datasize-=4) > 0 .... )
This line subtracts 4 from the data_size value and checks to see if
the result is greater than zero. The effect is that when the data_size
variable is AT zero, the code stops executing. What this ends up doing
is cutting off the data acquisition process before the last line gets
out, and (in my experience) is a common mistake. Usually it would
read:
while( ((long) (datasize-=4) >= 0 .... )
which would execute it one last time when it has reached zero.
So I was thinking about this this morning when I received an email
from technicians in Italy:
"Hello Sean...
I did the test yesterday, finding your same problem: it is a software
bug and today we have found the solution.
Unfortunately, the person responsible for the software is traveling for work.
Then we will release the new software release (corrected) to return
from teh summer holidays at the end of August.
In the meantime, I tell you the problem.
I believe that you have not any problems to correct the source and
recompile all.
At line 485 of file maic.c you can find
>>>> while ( ((long)(data_size-=4) >0) && (( read_events< user_setting.m_num_events)|| (user_setting.m_num_events<= 0)))
You have to change it like this:
>>>> while ( ((long)(data_size-=4) >= 0) && (( read_events< user_setting.m_num_events)|| (user_setting.m_num_events<= 0)))
In the old version simply the last word transferred with the BLT was
not controlled and stored in the file. [...]"
...It would seem as though I discovered a major flaw in this companies
software, before their technicians did.
Everything is fine and dandy now. I can look at muon shapes to my
heart's content. I will be taking a data set over the weekend.
The best part is, I spent so much time waiting for them to get back to
me that I had already programmed the rest of the infrastructure. So
now all I need to do is take data. w00t.