Data remaining is the same as scan backlog, so you're doing the right thing. AI SingleScan's opcodes "read newest" and "read oldest" should be used in the following manner:
During the first several iterations as the CPU cache adjusts itself to new instructions, you need to ignore the "scans remaining" parameter because the loop will not necessarily be able to keep up with the requested scan rate. While this is happening, use "read newest", which returns the newest scan from the onboard FIFO and flushes the remaining stale data from the FIFO.
After enough*** iterations have passed, switch the opcode to "read oldest", which will read the oldest data from the onboard FIFO. If the loop is keeping real-time
(i.e. keeping up with the scan rate), the oldest value will be the only value available. The reason you need to switch to "read oldest" is because this opcode allows the FIFO to fill up if your loop isn't keeping real-time. And the reason you want to allow your onboard FIFO to fill up is because that will allow you to monitor "scans remaining" to determine if you're keeping real-time.
By only calling "read newest", you'll never know if you're keeping real-time because that opcode flushes all data except for the newest point, which means "scans remaining" will always be zero.
***Note: How many iterations is enough? Depends on the application. For slow rates, you can read oldest data from iteration 0 onward. Usually, the faster your scan rate, the more warmup iterations you'll need. Try something greater than 10, which is the default used in the RT examples.