Signal Generators

cancel
Showing results for 
Search instead for 
Did you mean: 

one shot pulse PXI-5406 VB6 DAQmx

I have a one shot pulse that is generated by a counter that I need to trigger a one shot sine wave from a PXI-5406 function generator.
 
I have tried to do this using the Function Generator softpanel provided by NI and I was able to produce the single sinewave output.  When I tried to apply it using VB and DAQmx, it didn't work. 
 
I copied the settings to my program that I used in the FunctionGenerator SoftPanel.  The settings are as follow:
Mode---Frequency sweep of standard functions
TriggerType---Hardware
TriggerSource---PFI1
TriggerMode---Stepped
SignalOutput---Sinewave
StartFrequency---1000
StopFrequency---1000
Discrete Steps---2
Spacing---Linear
Amplitude---3
DCOffset---0 VDC
 
 
Below is my code that I am having problems with.  Please help me out.
 
    
    CheckError (niFgen_init("FunctionGenerator", True, True, GeneratorHandle))
    CheckError (niFgen_AbortGeneration(GeneratorHandle))
       
    CheckError (niFgen_ConfigureOutputMode(GeneratorHandle, NIFGEN_VAL_OUTPUT_FUNC))
    CheckError (niFgen_ConfigureStandardWaveform(GeneratorHandle, "0", NIFGEN_VAL_WFM_SINE, 3.0, 0, 1000, 0))
   
    CheckError (niFgen_ConfigureTriggerMode(GeneratorHandle, "0", NIFGEN_VAL_STEPPED))
    CheckError (niFgen_ConfigureDigitalEdgeStartTrigger(GeneratorHandle, "PFI1", NIFGEN_VAL_RISING_EDGE))
    
    CheckError (niFgen_ConfigureOutputEnabled(GeneratorHandle, "0", True))
    CheckError (niFgen_InitiateGeneration(GeneratorHandle))
 
Thanks in advance for all your help.    
0 Kudos
Message 1 of 2
(6,640 Views)

The settings you are using in the Soft Front Panel are using Frequency List Mode, not Standard Function Mode.  You should be able to achieve the same behavior in your VB code by changing it to use Frequency List Mode and the same settings as your Soft Front Panel.  For an example on how to program NI-FGEN Frequency List Mode in VB, see the VB example nifgenSweepGeneratorExample that gets installed with NI-FGEN.

Hope this helps.

Evan Cone
National Instruments
RF R&D
0 Kudos
Message 2 of 2
(6,612 Views)