The first time I run this example C++ code, I get the data I expect from my single-ended source. Then, subsequent runs fill the data file with 00 F8 00 F8 00 F8 00 F8...etc. To get the right data, I have to power off the machine, not just restart.
I modified the code so that it makes 3 acquisitions and concatenates the results to the same file, and again, the same result: it works the first time, but not again until I turn the machine off and on again.
So it seems to be something on the board doesn't get reset or cleaned up when the program exits, and I can get it out of this state only by power cycling.