ni.com is currently experiencing unexpected issues.

Some services may be unavailable at this time.

Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

N9320B ivi functions not working properly (averaging and ChannelPowerSpan)

I'm using the N9320B spectrum analyser and the ivi driver found on the ni website to measure the channel power of a desired frequency
To do that i'm doing the following actions

1)       agn9320ni_ConfigureMeasurementType (parameters are :  MeasurementType 2)

2)       agn9320ni_ConfigureAverage ( parameters are : AverageEnabled 1 ; AverageCount 5 ; AverageMode 1)

3)       agn9320ni_ConfigureFrequencyCenterSpan (parameters are : CenterFrequency xxHz ; Span 2.0MHz)

4)       agn9320ni_ConfigureCHP (parameters are : IntegrationBandwith 200KHz ; ChannelPowerSpan : 400KHz )

5)       agn9320ni_ConfigureSweepCoupling (parameters are : resolutionBWauto 0 ; resolutionBW 3000Hz ; VideoBWauto 0 ; VideoBW 3000Hz ; SweepTimeAuto 1 ; SweepTime 0.1002s )

6)       agn9320ni_ConfigureLevel (parameters are : amplitudeUnits ; inputImpedance 0 ; referenceLevel 0 ; ReferenceLevelOffset 0 ; AttenuationAuto 1 ; Attenuation 0 )

7)       agn9320ni_ReadMeasurementCHP (parameters are : MaxTime_ms ; MainchannelPower = output ; powerdensity = output )

Now I have some issues with step 2 not being applied and step 4 not changing the channelpower to 400KHz

0 Kudos
Message 1 of 15
(4,585 Views)

The IVI functions eventually translate to SCPI commands. Are the correct commands being sent?

0 Kudos
Message 2 of 15
(4,583 Views)

This i cannot tell.

What i did with the ivi source is prepare a dll and use this from whitin Teststand (4.2)

I can set the integrationBandwidth but the error on step 4 is on parameter 3 saying i cannot set the channelpowerspan to 400khz because this can only be set between the integration bandwidth and 10 times the integration bandwidth or the span.

About the averaging i'm having doubts if this is even possible to set when you are in CHP mode. (the averaging in this mode seems to be working)

0 Kudos
Message 3 of 15
(4,580 Views)

The IVI driver comes as a dll so I don't understand why you would prepare another. Second, you can turn on NI-Spy/I/O-Trace and view the actual commands being sent.

0 Kudos
Message 4 of 15
(4,578 Views)

as a dll?

What i got was a package containing a C-file, H-file and a fp file. From this i made a project and created a dll.

0 Kudos
Message 5 of 15
(4,575 Views)

What you should have gotten was an installer (.exe) that included the dll as well as the source code. Did you look in the IVI Foundation\IVI\Bin folder?

0 Kudos
Message 6 of 15
(4,571 Views)

@FVA0396 wrote:

as a dll?

What i got was a package containing a C-file, H-file and a fp file. From this i made a project and created a dll.



That sounds like you received something meant for LabWindows/CVI  which used *.fp files

0 Kudos
Message 7 of 15
(4,567 Views)

That is true. An IVI-C driver is written with LabWindows/CVI and if CVI is installed when you install an IVI driver, so are the source files.

 

edit - I don't have a current version of TestStand on this pc. Is there a step type for a spectrum analyzer in TestStand? If not, I would try the LabVIEW class driver.

0 Kudos
Message 8 of 15
(4,564 Views)

I managed using the dll and seperate SCPI commands to get the 2 functions working.

But I have something else that i cannot do (not even with SCPI commands) or it's not clear how to do it.

I'm pressing the MEAS button and then the BW/avg button and on the bottom of list you can set (manually) the Sweep type.

It is always set to FFT but i want it to be on SWEPT so i can in the Sweep/trig menu set the sweep time to 0.1002 seconds.

This all is working when you are trying to do this manually but using dll or SCPI commands always results in the message "can't auto-couple sweep time in zero span"

But both my span settings are set to full span.

Any ideas?

0 Kudos
Message 9 of 15
(4,548 Views)

[: SENSe]: FREQuency: SPAN <freq>
[: SENSe]: FREQuency: SPAN?
Set the frequency span. Setting the span to 0 Hz puts the analyzer into zero span.

 

You can try to use this command to set the SPAN to be a non-zero value. Thus it will absolutely not be in zero span mode.

Message 10 of 15
(4,538 Views)