Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Generating a square waveform of 100 KHz from one of the Anolog output channels of PXI-6713 ?

Hi

I am trying to generate a square waveform from one of the anolog output channels of PXI 6713.

I am developing my application in VC++

My requirement is a continous 100 KHz square waveform with 90% duty cycle and 1.5 V amplitude.

The following is the code i have used (i have removed error handling code):

***** code *******

i16 deviceNumber = 6; // PXI 6713 Device Id as per NI-MAX
i16 deviceNumberCode; // to be returned by Init_DA_Brds function
i16 chan = 2; // DAC channel 2
i16 numChans = 1; // only one channel is used for
i16 chanVect[1] = {2}; // DAC Channel 2
f64 gain = 1.0;
i16 binArray[10] = {0};
i16 group = 1; // default for most of the devices
u32 count = 10; // 10 data points

// 9 data points ON and 1 data point OFF constituting 90% duty cycle
f64 voltArray[10] = {1.5,1.5,1.5,1.5,1.5,1.5,1.5,1.5,1.5,0};

u32 iterations = 0; // Repeat waveform indefinitely
i16 mode = 0; // Disable FIFO mode / delay mode
f64 rate = 100000; // 100,000 points / sec
i16 units = 0; // points / sec
i16 timebase;
u32 updateInterval;
i16 whichclock = 0; // update clock
i16 operation = 1; // Start waveform initiation

Init_DA_Brds (deviceNumber, &deviceNumberCode);

WFM_Scale (deviceNumber, chan, count, gain, voltArray, binArray);

WFM_Group_Setup (deviceNumber, numChans, chanVect, group);

WFM_Load (deviceNumber, numChans, chanVect, binArray, count, iterations, mode);

WFM_Rate (rate, units, &timebase, &updateInterval);

WFM_ClockRate (deviceNumber, group, whichclock, timebase, updateInterval, mode);

WFM_Group_Control (deviceNumber, group, operation);

**************

If I try to generate 10 KHz waveform with the same 90% duty cycle and 1.5 V amplitude, the waveform gets generated continously....

But for 100 KHz, itz generating continously....but only few waveforms....

Is there any hardware limitations ? I've tried changing the value of the timebase ( points / sec) and update interval etc...

plz help me

thanx in advance

sriram.
0 Kudos
Message 1 of 2
(2,341 Views)
Sriram;

The best way to get started is to run one of the NI-DAQ shipping examples. You can find a good example at
C:\Program Files\National Instruments\NI-DAQ\Examples\VisualC\Ao. Take the one named WFMDoubleBuf.c.

On that example, you will just need to change the data written to the buffer to met your application's pulse train requirement.

Hope this helps.
Filipe A.
Applications Engineer
National Instruments
0 Kudos
Message 2 of 2
(2,341 Views)