RIS requires that your input signal be periodic but that there be some
jitter in the periodicity. Imagine that you set the digitizer to
trigger when the input signal rising edge crosses 0 V. The analog
edge trigger circuitry will detect when this occurs very
precisely. However, the signal will not be sampled until the next
sample clock edge. The device can determine the time difference
between the trigger point and the sample point. The next time the
device acquires a record of the this signal, it is likely that the 0 V
crossing point occurs at a slightly different time relative to the
sample clock edge.
The important point is that the digitizer's sample clock does not
change. Further, we work hard to keep the jitter of this clock
very low. So to acquire enough bins to oversample the periodic
input signal, we rely on the jitter of the input signal. Because
this "phase noise" of the input signal is random, the order that the
bins get filled, and the time it takes to fill all bins, is
random. You could have several acquisitions that fall into the
same bin before you fill all the bins.
Unless you can precisely control the phase and jitter of the input
signal, you won't be able to write a program that fills the bins in
order.
One way you might speed up the acquisition is to change the
NISCOPE_ATTR_RIS_NUM_AVERAGES attribute. On most devices, the
default is 4, which means it attempts to fill each bin four times, then
averages the points in each bin. You can try setting that to a
smaller number.