Forum
Please or Register to create posts and topics.

OpenDevice Function Values

We use your product as a spectrum analyzer.

I use C++ to develop the control program of the product and carry out secondary development of the instrument.

Execute the following functions in order:

AARTSAAPI_Init(AARTSAAPI_MEMORY_MEDIUM);

//Start the SDK support library

AARTSAAPI_Open(&h);

//Gets a library handle for the application to use

AARTSAAPI_RescanDevices(&h, 2000);

//Rescan all devices controlled by the library

AARTSAAPI_EnumDevice(&h, L"spectranv6", 0, &dinfo);

//Matches the currently connected V6 device by name

AARTSAAPI_OpenDevice(&h, &d, L"spectranv6/sweepsa", dinfo.serialNumber);

//Control the current V6 device into spectrometer mode

I would like to ask, the above function of the function, can set the function of the spectrometer?  I'm not sure if the statement "spectran V6/sweepsa "in step 5 will get the V6 device into spectrometer mode.  That's the first question.

After solving the first problem, I also want to implement the following features:

  • Set the central frequency point;
  • Sets the Span;
  • Set the scanning time;
  • Set the reference level;
  • Sets theMax Hold;
  • Sets thepeaksearch , and get the power value of the current frequency point;
  • Sets thepeaknextsearch, and get the power value of the current frequency point;
  • Set the location of the moving sampling point, and get the power value of the current frequency point.
Quote from HHH on 30/05/2022, 12:11

I would like to ask, the above function of the function, can set the function of the spectrometer?  I'm not sure if the statement "spectran V6/sweepsa "in step 5 will get the V6 device into spectrometer mode.  That's the first question.

  • Set the central frequency point;
  • Sets the Span;

The OpenDevice function supports the following "type" values for receiving spectra data (for receiving/transmitting IQ data there are other modes):

  • "spectranv6/raw" - For receiving spectra data, frequency range is defined by setting center frequency, receiver clock and span factor (decimation). This means you cannot specify a specific span to measure, but only select indirectly from options defined by those settings.
  • "spectranv6/rtsa" - Similar to above, but allows to directly specify a frequency span and have span factor set automatically and filter the results accordingly. Span is still limited by the selected receiver clock setting.
  • "spectranv6/sweepsa" - This mode changes the frequency control to Start- and Stop-Frequency instead of Center and Span, but does not impose any limitations on the possible frequency range. If necessary, the driver will automatically perform multiple scans at different center frequencies to cover the defined frequency range.

Please check the ConfigTree example with each mode to see which exact settings are available.

Quote from HHH on 30/05/2022, 12:11
  • Set the scanning time;
  • Set the reference level;

Setting the reference level is supported in all modes listed above. Setting the scanning time directly is not supported in any mode, that is indirectly set based on the other parameters like span and rbw.

Quote from HHH on 30/05/2022, 12:11
  • Sets theMax Hold;
  • Sets thepeaksearch , and get the power value of the current frequency point;
  • Sets thepeaknextsearch, and get the power value of the current frequency point;

That is beyond the scope of this API as it has nothing to do with the device itself. The data processing is your responsibility.

Quote from HHH on 30/05/2022, 12:11
  • Set the location of the moving sampling point, and get the power value of the current frequency point.

Not quite sure what you mean with "moving sampling point".

I was wondering if you could set how many frequency points you can read back within a certain range.  Then the power values of all frequency points are read back to the PC.

I see the L"device/fft0/fftaggregate" statement in the routine. Does it set the number of frequency points for reading back?

I would like to ask if the packet.fp32 in the function CVI_AARTSAAPI_GetPacket(&d, 0, 0, &packet) is the frequency value read back by the spectrometer?

For example, if I set the range to 100-200MHz and then read 100,110,120,130,140,150,160,170,180,190,200MHz, what dBm are the values of these points, which  functions should I use?If I use AARTSAAPI_GetPacket(&d, 0, 0, &packet), in the routine it takes one value at a time, does it take it in order?

The fp32 field contains the power values. The frequency values for them need to be calculated with the information provided in the header (start-, stop- and step-frequency and the size parameter). As they are evenly distributed it would be a waste of space/bandwidth to list them explicitly (as we're talking about potentially millions of values per second).

I want to ask, is fp32 the maximum I gave in the frequency range?

For example, if I give a range of 100MHz-120MHz and use AARTSAAPI_GetPacket(&d, 0, 0, &packet) to fetch fp32 once, is this the maximum value in this range?

fp32 is an array of values, one for each sample point. The number of values is given in the size parameter in the packet header. Check the SweepSpectrum sample for getting the max value.

And I want to know, what are these values that I get for fp32? Is it on the central frequency?Or is it the value of Marker?

Already explained that in the previous post. In each sample (which covers the requested frequency range) you get "size" data points. The data points frequencies are evenly distributed and can be calculated from the parameters provided in the packet header (mainly start- and step-frequency). And the fp32 field contains the values of all data points as an array.

There is no marker anywhere when using the DLL. The DLL is not a full replacement for the RTSA, but only provides a low-level interface to the Spectran V6. You just get a constant datastream, it is your choice what you do with that.