I've recently started with the SAL demo code to interface with the N6841A RF sensor and I wanted to know where in the code I would go to have the option of increasing the span above 20MHz to say a useful span of 40MHz and have it show as a 40MHz span in the demo plots of frequency vs power.
Use salStartSweep2(), defined in agSalFrequency.h:
SAL_API salStartSweep2(salHandle *measHandle, salSensorHandle sensorHandle, salSweepParms *parms,
salFrequencySegment *pSegmentTable,
salFlowControl *pFlowControl,
SAL_SEGMENT_CALLBACK dataCallback);
To scan 40 MHz (example from 100 MHz -> 140 MHz), you create an array of 2 salFrequencySegment structs, and set the first segment's center freq to 110 MHz, then the second segment's center freq to 130 MHz. In the salSweepParms struct, you set salSweepParms.numSegments to 2, indicating there are two segments in the sweep. This will cause the sensor firmware to scan 20 MHz wide centered at 110 MHz (100 MHz -> 120 MHz), then 20 MHz wide centered at 130 MHz (120 MHz -> 140 MHz).
Note that these segments do not need to be consecutive. You can set the first center freq to 110 MHz (100 MHz -> 120 MHz), the second center freq to 710 MHz (700 MHz -> 720 MHz), etc. This is useful if you want to scan multiple bands at different freqs.