From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Signal Generators

cancel
Showing results for 
Search instead for 
Did you mean: 

Burst Mode waveform ( Sine wave followed by DC) generation using NI-5406

Hi,
 
Our application requires burst mode waveform generation, one of such requirements is as below
Burst Period: 2.0 Sec
Waveform Type: Sine
Frequency: 400Hz
Cycles: 400
This means we need to generate a 400Hz sine wave for for 1.0Sec and another 1.0Sec DC with zero voltage.
Pls anyone can suggest whether this can be achived with NI PXI-5406 Arbitrary function generator?
 We tried with the Frequecny List method, but here when Frequency of '0' is given for DC generation, the 5406 is generating a very low frequency sine wave, instead of exac 0V DC.
 
The portion of the code is as below
 
freqArray[0]=400.0;
freArray[1]=0.0
  durationArray[0]=1.0;
  durationArray[1]=1.0
niFgen_CreateFreqList(IviHandle, new_config.signal_type, frequencyListLength,freqArray,durationArray,&frequencyListHandle);
niFgen_ConfigureFreqList(IviHandle, VI_NULL,frequencyListHandle, new_config.amplitude,new_config.offset,new_config.phase);
 
Thanks
Prashantha
 

Message Edited by Puranik on 03-14-2007 01:38 AM

0 Kudos
Message 1 of 13
(12,168 Views)

Prashantha,

It looks like you are using LabWindows to do your programming. I would suggest starting with the example programs (Help » Find Example… » Hardware Input and Output » Modular Instruments » Arbitrary Waveform Generation). I used these and was able to produce sine, square, dc values, etc. Please let me know if you have further questions.

David L.
Systems Engineering
National Instruments
0 Kudos
Message 2 of 13
(12,144 Views)

Hi Prashantha,

I was wondering what is the frequency of the waveform 5406 is generating for 0 Hz on your side?

I made a simple example code with the parameters you have described and ran it. I couldn't see the behaviour you were describing.

Am I missing anything as how you are measuring the signal ?

I would recommend using NI-FGEN Soft Front Panel to create frequency list and generate the list to isolate the issue.

Thanks,

Kalyanramu Vemishetty
Automated Test Systems Engineer
National Instruments
0 Kudos
Message 3 of 13
(12,130 Views)

Hi David,

Thanks for your reply.

I again tried the example program (Help » Find Example… » Hardware Input and Output » Modular Instruments » Arbitrary Waveform Generation). I have few points to clarify here

1. We are using PXI-5406 which doesn't support for Arbitrary Waveform mode so we can use ONLY frequency-List metod. ( In arbitrary waveform we can generate SineWave followed by DC with 0V).

2. I used frequency-List method to generate the waveform using soft-front-panel and found that PANEL DOESN'T ALLOW to enter 0Hz as one of the frequencies in Frequency-list. It rounds off 0-Hz into 9.313mHz frequency which is minimal possible frequency.

So Pls clarify whether "we can use PXI-5406" for Burst wave generation ( i.e. Sine wave-400Hz for 1Sec followed by a 0V-DC for another 1 Sec and whole waveform is repetitive).

Thanks

Prashantha

 

0 Kudos
Message 4 of 13
(12,116 Views)

Hi,

Thanks for your reply.

I tried to gererate SINEE_WAVE and with frequency 400-Hz and SINE Wave with 0-Hz using NI-Soft front panel and here is the results.

1. I used frequency-List method to generate the waveform using soft-front-panel and found that PANEL DOESN'T ALLOW to enter 0Hz as one of the frequencies in Frequency-list. It rounds off 0-Hz into 9.313mHz frequency which is minimal possible frequency.

Pls let me know how you are able to get the proper waveform. I'll again specify our requirement,

Requirement: Sine wave-Burst.

Detail. 400-cycles of Sine wave of 400-Hz, ( i.e 400Hz-sine wave for 1.0 sec) followed by 0-V DC for 1.Sec. This whole waveform should be repetitive.

Note: This is one of the requirements under Burst-waveform , we have similar requirement for different frewuency and different duration.

Pls let me know you suggestion on this. Your input will help in great extent to take the decision.

Thanks

Prashantha

 

0 Kudos
Message 5 of 13
(12,115 Views)
Hi Prashantha,

Soft Front Panel can accepts a minimum of 1mHz. However, the NI-FGEN driver supports 0Hz.

I was wondering what is the frequency of the waveform you are observing on scope when you ask the 5406 to generate 0Hz.
You can create a frequency list with only 0Hz and observe it on the scope.

Can you please post the value of frequency you are observing/screenshot on the post. That would help us further assist you.

Thanks,


Kalyanramu Vemishetty
Automated Test Systems Engineer
National Instruments
0 Kudos
Message 6 of 13
(12,099 Views)

Hi,

I have experimented by creating different frequency list and I captured the waveform fro the following requirement.

Burst 400 Cycle, Frequency:400Hz, Period 2-Sec ( i.e 1-sec Sine wave of 400 Hz and 1-Sec silent , whole waveform is repetitive).

The channel 1 waveform is generated using Frequency-List method, and Channel-2 waveform is generated throuth HP-3314A Function generator ( exisitng Fgen and we are working on to replace this model).

You can notice these differences with the NI and HP (stand-alone- GPIB) function generators.

NI-Fgen --- Silent mode is not really silent it is a low frequency sine-wave ( it repeates over a period difficult get full cycle in one screen-shot). whereas HP silent mode is really silent. ( In HP-It's called N-Cycle mode and we can select thenumber of cycles, waveform type, amplitude, offset, frequency and in addtion to that WE CAN SELECT - TRIGGER INTERVAL ).

Pls let me know is there any way I can generate the waveform using NI-PXI-5406 which can match with the HP-3314A waveform?

I created the frequency List with only 0-Hz and found it's 0-Hz signal not a very low frequency signal. ( In above example i'm sine-wave amplitude is 1-Vpp)

Thanks

Prashantha ( prashantha.puranik@honeywell.com)

 

 

0 Kudos
Message 7 of 13
(12,088 Views)

Hi Prashantha,

Thanks for taking those screenshots. They really helped us understand the scenario well. When the function generator generates 0Hz, it simply holds the last generated value. When it jumps from 400 Hz to 0Hz, it is generating the last point in the 400 Hz sine waveform.

Before I jump into conclusion to explain the scenario here.

Can you please post the code you used for the test so that we can execute here rather than the code snippet? Then I can probably point the exact solution.

 

 

Kalyanramu Vemishetty
Automated Test Systems Engineer
National Instruments
0 Kudos
Message 8 of 13
(12,064 Views)

Hi,

Thanks for your inputs. Pls find the code below,

#include "nifgen.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <time.h>
#include <windows.h>

#define WFM_SIZE 1000
#define SEQ_SIZE 2

int main(int argc, char *argv[]) {
   ViChar Resource[256];
   long j=0;
   const ViChar * ChannelName = "0";
   ViReal64 freqArray[]={400.0,0.0},durationArray[]={1.0,1.0};
   ViReal64 freqArray2[]={0.0},durationArray2[]={1.0};
   ViInt32 frequencyListHandle;
   ViStatus error = VI_SUCCESS;
   ViSession vi=VI_NULL;
   ViReal64 amplitude=1.0,dcOffset=0.0;

       
      // set default values
      strcpy(Resource, "DAQ::5::INSTR");


   
   /*- Initialize the session ----------------------------------------------*/
   printf("Initializing %s\n", Resource);
   checkErr(niFgen_init(Resource, VI_TRUE, VI_TRUE, &vi));
//   niFgen_ConfigureTriggerMode (vi, VI_NULL, NIFGEN_VAL_STEPPED);

   /*- Configure output for sequence mode ----------------------------------*/ 
     checkErr(niFgen_ConfigureOutputMode(vi, 101));
  printf("Mode Value %d\r\n",NIFGEN_VAL_OUTPUT_FREQ_LIST);

   niFgen_CreateFreqList(vi, NIFGEN_VAL_WFM_SINE,\
   2,freqArray,durationArray,&frequencyListHandle);
   niFgen_ConfigureFreqList(vi, VI_NULL,frequencyListHandle,\
   amplitude,dcOffset,0);
  
   /*- Enable output and start generating ----------------------------------*/   
   checkErr(niFgen_ConfigureOutputEnabled(vi, ChannelName, VI_TRUE));
   checkErr(niFgen_InitiateGeneration(vi));
     
   // clear the input buffer, then wait for user input before closing the session.
   // (DAQmx devices will quit generating the output when the session is closed).
   fflush( stdin );
   printf("Press Enter to continue...\n");
   getchar();

Error:
   /*- Process any errors ---------------------------------------------------*/
   if(error != VI_SUCCESS) {
      ViChar errMsg[256];
      niFgen_ErrorHandler(vi, error, errMsg);
      printf("Error %x: %s\n", error, errMsg);
   }
   /*- Close the session ----------------------------------------------------*/
   if (vi) niFgen_close (vi);
   return 0;
}

Pls let me know is there any way we can generate the required waveform using frequencyList or using niFgen_DefineUserStandardWaveform method.

Thanks

Prashantha

 

0 Kudos
Message 9 of 13
(12,027 Views)
Prashantha,

I ran your code and did not see what your picture displays. I have attached a picture below displaying my resulting waveform. This is 1,000,000 samples at a rate of 10KS/s, which is taken over a period of about 100 seconds. I would like to ask that you please run the exe attached, and post back with a picture of the results you are getting. (Please note that I changed the file name to .cpp because we cannot upload exe's to the forums. You must rename the .cpp file to .exe) The exe was made in CVI 8.0.1, and the run-time engine can be found here if you do not already have it.
David L.
Systems Engineering
National Instruments
Download All
0 Kudos
Message 10 of 13
(12,003 Views)