The other thing I've noticed in case anyone wants to try it is that :WAV:DATA? can only write out 128K at a time before it barfs. So to get everything you have to cycle around using :WAV:STAR and :WAV:STOP. Seems flaky. The :WAV:PRE? Doesn't tell you how many points there are. It tells you how many you have set. Duh.
Since I don't have a DS1000z I only can guess and it's similar to my DS2000 one.
You want to set the mode to raw to get the data in memory.
you can only read the internal memory when the scope is in the stop state (:STOP, not to be confused with :WAV:STOP)
Use the :WAV:PRE? to find out that you are indeed in RAW mode and other parameters associated to the waveforms in memory including the number of points set for the memory depth. If you are in stop state there should all be available (maybe not all filled with data but all available).
Use :WAV:START n and :WAV:STOP n to get chunks of the memory for n going from 1 to 12000000
if you are in Normal mode instead of Raw then there are only 1200 points and start defaults to 1 and stop defaults to 1200
:WAV:DATA? also returns a header #900000dddd where dddd is the number of bytes of the waveform data to be read.
There are too many variations on how to use it all so I guess it depends what format type and mode you want to read and if you want to be in running or stop state.
But there is a free project with source (C++ I think) in the first post of this thread:
https://www.eevblog.com/forum/testgear/free-ds6000ds1000z-software/Seems that covers a lot of the DS1000z functionality but I didn't look at the details
Maybe you can use what the author has done for reading waveforms from that code (Edit: save_data.cpp)