Sending the Scanraw, followed by Frequencies, the displayed frequency list will not match the requested range. The software could calculate the frequencies, ignoring the floating point errors. It's blind faith...
scanraw use integer frequency arithmetic, there is no floating point error for integer arithmetic. It always calculate exactly the same value.
For example, if start frequency is 1000000 and frequency step is 1000. It is guaranteed that frequency list will be exactly the following:
1000000
1001000
1002000
1003000
1004000
...
The result is always predictable. This is why scanraw don't needs frequencies command.
Normally when running a sweep, setting the start frequency to 0Hz will cause the actual start to be whatever the lowest supported frequency is. With Scanraw, it will report out of range. I'm not sure why the commands don't work the same in this respect. As is, without the frequency tracking and lower limit not being coerced, without support for the original command set it would be difficult to find the lower limit.
scanraw returns requested frequency range only. It doesn't shift frequencies. If you requested start frequency 12345 Hz and frequency step 100 Hz, then scanraw guarantee that the first frequency will be always exactly 12345 Hz, the second frequency will be exactly 12345 + 100 = 12445 Hz, the third frequency will be exactly 12345 + 100 + 100 = 12545 Hz etc. Scanraw command guarantees that frequencies will be exactly the same as requested, with no shift, with no rounding error.
This is why scanraw returns error if requested range is out of device frequency range (10 kHz - 1500 MHz).
You can find supported frequencies by send sweep commands and then execute frequencies command:
sweep start 0
sweep stop 4000000000
frequencies
Just look for the first and last record and you will know device limit
![Smiley :)](https://www.eevblog.com/forum/Smileys/default/smiley.gif)
When using the Scanraw to average the data, there appears to be no user feedback that the Nano is doing anything. The LED stops flashing and the unit appears hung. Again, blind faith, pry it comes back in some amount of time..
it didn't hung. It just capture device for exclusive use during command execution time. When the command will be completed, the normal sweep operation will be restored and you will be able to continue use touch screen as usual.
Setting the average parameter to 0 causes an error. I would have expected that to disable the average. Again, trail and error. It's possible that not including the average parameter disables it. Just a guess.
average = 1 means no average, just single measurement.
average = 0 means zero measurement count and no data. This is why it returns error for zero average.
I would expect a new command like scanraw to use the start and stop frequencies along with span and such.
If you specify start/stop or center/span it leads to uncertainty. The frequency step will be calculated on NanoVNA side and it may have rounding error and you will need to request frequency list. As it used with usual sweep and data commands.
It leads to redundant transfer for frequency data and more long measurement time. And PC cannot control frequency step value, because it will be calculated on NanoVNA side with it's rounding precision. This is why using start/stop center/span is a bad idea.
scanraw uses start/step parameters in order to guarantee that the frequency list will be exactly as requested with no rounding and no shifting. It allows to exclude frequency data from data transfer, because frequency can be easily calculated on PC side and it will be exactly the same. Because it uses integer arithmetic and fixed frequency step. It allows to significantly improve data transfer and measurement speed. And excludes frequency step uncertainty.
Using the Scanraw and sending up 101 data points when compared with the original method appears to be very slow. I suspect the only gains are when using the average feature.
scanraw is introduced for a large datasets. For example if you request 1000 points, scanraw will be done in 6 seconds. If you use data command it will require about 15 seconds for 10 sweeps.
For 3000 points scanraw takes 17 seconds.
With 10x average, 1000 points measurement takes 15 seconds.
This is how it works
![Smiley :)](https://www.eevblog.com/forum/Smileys/default/smiley.gif)