Signal Generators

cancel
Showing results for 
Search instead for 
Did you mean: 

Unable to generate standard waveforms with PXI-5422

I am writing a software class that will control a PXI-5422 Function Generator via the IVI interface.
 
The Output of the 5422 is plugged into the input of a PXI 5922 Scope for testing purposes. ( the impedances are matched )
 
Currently I am unable to generate any standard waveforms (sine, square, etc).  I can generate arbitrary waveforms just fine, but when I configure a standard waveform i am receiving what appears to be noise. 
 
Any ideas why I would have this problem?
Are there additional set up steps for standard waveforms than there are arbitrary waveforms?
Could my hardware setup be causing the issue?
 
Here is the sequence I execute to generate a standard waveform:
1) IviFgen_ConfigureOutputMode()              // Set output mode to Function
2) IviFgen_ConfigureOutputEnabled()          // Enable output on the specified channel 
3) IviFgen_ConfigureStandardWaveform()  // Configure the Standard waveform
4) IviFgen_SetAttributeViReal64()                // Set Duty Cycle property for square waveforms
5) IviFgen_ConfigureOperationMode()         // Set Operation Mode to continuous
6) IviFgen_InitiateGeneration()                     // Starts the Generation
 
I do not receive any driver errors while configuring the waveform.
 
Any Ideas or suggestions would be greatly appreciated.
 
Thanks,
Anson
0 Kudos
Message 1 of 10
(8,559 Views)
Hello Anson,

I have setup a system and wrote a quick program to test it.  I have written the program in LabVIEW just to test functionality.  I have had no problems getting this to work.  I have posted a picture of this application below.  I have shown all the VI labels which let you see which functions you need to call and the order.

I verified in CVI that these same functions exist.  If this does not help, can you post your code that you are having problems with?

Regards,

Jesse O.
Applications Engineering
National Instruments
Jesse O. | National Instruments R&D
0 Kudos
Message 2 of 10
(8,539 Views)

Jesse O,

Thanks for the reply. 

I have adjusted my code to use the same sequence of function calls that you used in LabView, however I am still observing the same issue.  I cannot supply my code "as is", however I can supply the sequence of IVI functions ( As I did in my previous post ) with more detail.

IVI Function Calls:

IviFgen_InitWithOptions( (char *)GetObjectName(),                \\ IVI Logical Name
                                         VI_TRUE,
                                         VI_TRUE,
                                         (char *)m_pszInitString->c_str(),     \\ Empty String
                                         &m_hFGen )                                 \\ Returned Instrument Handle

IviFgen_GetChannelName( m_hFGen,
                                            Index,             \\ Value = 1
                                            256,
                                            pchName )      \\ Returned channel name used in following functions

IviFgen_ConfigureOperationMode( m_hFGen,
                                                        pchName ,
                                                        lOperationMode )     \\ Value = 0 (Continuous)

IviFgen_ConfigureOutputMode( m_hFGen, 
                                                   lOutputMode )  \\ Value = 0 (Function)

IviFgen_ConfigureStandardWaveform( m_hFGen, 
                                                             pchName ,
                                                             lWaveform,      \\ Value = 1 (Sine)
                                                             dAmplitude,    \\ Value = 3
                                                             dDCOffset,       \\ Value = 0
                                                             dFrequency,    \\ Value = 1000 ( I've tried many different frequencies with similar results )
                                                             dStartPhase )   \\ Value = 0

IviFgen_SetAttributeViReal64( m_hFGen, 
                                                 pchName ,
                                                 IVIFGEN_ATTR_FUNC_DUTY_CYCLE_HIGH,
                                                dDutyCycle )                                                        \\ Value = 50

IviFgen_ConfigureOutputEnabled( m_hFGen, 
                                                       pchName ,
                                                       bEnabled )  \\ Value = 1 (true)

IviFgen_InitiateGeneration(m_hFGen)

I've attached some screen shots.

Any feedback would be appreciated.

Thanks,

Anson Wooten

 

 

Download All
0 Kudos
Message 3 of 10
(8,507 Views)

Jesse O,

I noticed something interesting after my last posting.

If I open the NI-FGen soft front panel,  I can correctly generated standard waveforms using my PXI-5422 instrument.  However, If I open the NI supplied IVI FGen soft front panel I see the same erroneous results that I am receiving from my C++ class ( which also uses the IVI interface ).

I've double checked my IVI configuration and It appears to be good.  Also, I am able to generate arbitrary waveforms via the IVI interface with my current setup, so I believe it to be in working order.

Any Ideas why I would see this behavior. 

I am currently using NI-FGen version 2.4.0 and IVI compliance package 3.0 ( as reported in NI-MAX )

Thanks again,

Anson Wooten

0 Kudos
Message 4 of 10
(8,496 Views)


@A Wooten wrote:

Jesse O,

I noticed something interesting after my last posting.

If I open the NI-FGen soft front panel,  I can correctly generated standard waveforms using my PXI-5422 instrument.  However, If I open the NI supplied IVI FGen soft front panel I see the same erroneous results that I am receiving from my C++ class ( which also uses the IVI interface ).

I've double checked my IVI configuration and It appears to be good.  Also, I am able to generate arbitrary waveforms via the IVI interface with my current setup, so I believe it to be in working order.

Any Ideas why I would see this behavior. 

I am currently using NI-FGen version 2.4.0 and IVI compliance package 3.0 ( as reported in NI-MAX )

Thanks again,

Anson Wooten



Anson,

I used the code you supplied in a previous post, changed some variables to actual constants, and I had no issues generating a sine wave with a PXI-5442. I am using more recent versions of the drivers (NI-Fgen 2.5, and IVI Compliance package 3.1.0), so I still cannot rule out that there is some issue in any or all of the version that you are using.

You mentioned that you were able to generate arbitrary wavefor data via the IVI interface. Were you using the same IVI Logical Name (or Driver Session) for arbitrary generation as with standard function generation? If your code is not returning any errors, then I would guess that the IVI Driver Session is configured to simulate the device. Can you please check that?
Regrads,
Sead Suskic
National Instruments
0 Kudos
Message 5 of 10
(8,454 Views)

Hi Wooten,

I also tested your code by modifying it to constants and was able to get it working.

I agree with Saed's comments to check driver sessions.

Also on the scope side, can you please try with edge trigger in SFP so that you will not miss the signal as in Immediate Mode (Ignore it if you are already doing this).

Attached is the code which I was able to get working. The session name for the device in my code is "5421_ivi".

Kalyanramu Vemishetty
Automated Test Systems Engineer
National Instruments
0 Kudos
Message 6 of 10
(8,443 Views)
Sead \ Kalyanramu
 
Thanks for your responses.
 
To answer your questions:
  • I am using the same IVI Logical name\driver session for both standard and arbitrary waveforms.  This code is part of a larger application which retrieves the instrument handle on startup and does not release the handle untill shutdown. 
  • The driver session is not set to simulate.
  • I have tried setting the scope to edge trigger, but I receive similar waveforms as the ones I posted earlier.

It seems to me that since the NI IVI Soft Front Panel is demonstrating identical behavior as my code, ( and since you have both tested my code sequence and found no issues ) that something must be wrong with my configuration.

Kalyanramu :  What versions of NI-FGen and the IVI Compliance Package are you using?

Sead : You've identified that you are using NI-FGen 2.5 and IVI Compliance Package 3.1.0.

I would like to try these versions but have been unable to locate them on the NI website.  The newest versions I can find for download are the versions I currently have installed.  Where can I download these drivers?

Thanks,

Anson 

 

 
0 Kudos
Message 7 of 10
(8,440 Views)


@A Wooten wrote:

Sead : You've identified that you are using NI-FGen 2.5 and IVI Compliance Package 3.1.0.

I would like to try these versions but have been unable to locate them on the NI website.  The newest versions I can find for download are the versions I currently have installed.  Where can I download these drivers?

Thanks,

Anson 




Anson,

I apologize for the typos in my response. So, more accurately, I am using a PXI-5422, NI-FGEN 2.4, and ICP 3.0. Using your code, and the IVI Fgen soft-front panel, I am able to generate a standard function waveform.

Are you familiar with the NI-Spy utility? Look for its short-cut  in Start >> Program Files >> National Instruments. It might be able to tell us if there is something interesting going on with the IviFgen and niFgen calls.

Also, would you be willing to attach your IVI configuration file (it's %ProgramFiles%\IVI\Data\IviConfigurationStore.xml)?
Regrads,
Sead Suskic
National Instruments
0 Kudos
Message 8 of 10
(8,395 Views)

Hi Anson,

Can we contact you directly to solve this issue?

Thanks,

Kalyan

 

Kalyanramu Vemishetty
Automated Test Systems Engineer
National Instruments
0 Kudos
Message 9 of 10
(8,387 Views)

Attached is an NI-Spy capture of the following sequence:

  1. Start Software
  2. Configure Std Wfm Generation
  3. Enable Generation
  4. Disable Generation
  5. Close Software

Also attached is my current IVI configuration store.

Please feel free to contact me.  I am assuming you have my contact information on file.

Thanks,

Anson Wooten

 

Download All
0 Kudos
Message 10 of 10
(8,367 Views)