Counter/Timer

cancel
Showing results for 
Search instead for 
Did you mean: 

Generate Continuous and Finite Sin waves on a 6229 PCA?

Is it possible to generate a Continuous Sin wave and a repetitous Finite Sin wave at the same time on a 6229 PCA?
 
For example, can I have a Continuous 5Khz Sin wave on 6229-AO0 and a 5Khz for 7 cycles every 50mSec on 6229-AO1?
 
Please see attached picture for clarification.
0 Kudos
Message 1 of 4
(4,047 Views)

Hi,

In your case both of the signals are continuous, the only difference is that signal coming out form AO1 is not a sine wave but a "arbitrary waveform" where first part of it is a sine wave and the other part a 0 Volt. At the end this waveform is going repeat continuously, right?

What you will need to do is to generate both of the waveforms separately and then load them into the card.  You are basically looking at two things, first the example: “Cont Gen Voltage Wfm-Int Clk-Non Regeneration.vi” and second the function: “Basic Function Generator.vi” with this VI you can create a 7 cycles of a 5 KHz sine wave play around with the sampling info input of this function.  Depending on your Fs “sampling rate” and "# of samples" you will generate a given # of cycles. Make sure you change the DAQmx write to "multiple channels" allowing you to input an array of waveforms.

I hope it helps.

Jaime Hoffiz
National Instruments
Product Expert
0 Kudos
Message 2 of 4
(4,036 Views)
Thank you Jaime - I have been able to create the waveforms but now comes the tough part - getting them to work together and aligning them.
 

Here is my real goal: (I have done many of the following Steps in baby steps but my ultimate challenge is to combine it all so it works together.)

  1. Create a 20Hz sin wave on channel 6229-AO. I have created a Vi to accomplish this. J

  2. Create a second 20Hz sin wave on channel 6229-A1 that is 90deg out of phase to the 20Hz in Step 1. I have created a Vi to accomplish Step 1 and 2 that are 90deg out of phase. J

  3. Create a 7 cycle 5KHz burst every 50mSec on channel 6229-A2. I have created a VI that accomplishes this Step 3 by itself. J (Ultimately, this burst must occur 180deg later than the start of Step 1)

  4. Create another 7 cycle 5KHz burst every 50mSec on channel 6229-A3. I have created a Vi that combines Step 3 and 4 and gives simultaneous bursts on both channels, in other words they occur at the same time. J (Ultimately, this burst must occur 270deg later than the start of Step 1)

 

The attached ‘All Signals.jpg’ is a visual of how the 4 Steps must work timing wise.

The attached ‘Waveform Troubles.jpg’ is showing my next attempt to combine Step 1 and 2 with Step 3 and 4 without regard to its relationship with Step 1.

The attached ‘-50103 error.jpg’ is a visual of the Reserve error that appears when trying to run this Vi. It appears that once the DAQmx Timing.Vi is executed, it stops any other opportunity to run other waveforms producing a Reserve error, -50103.

 

Using another PCA such as a PCI6713 helps with the resource issue but the ability to line up the signals has not been found. I tried using a Digital Trigger, but it doesn’t seem to work with the Finite Generation waveform. (Can this waveform be re-triggerable and will there be a level of confidence that it can be lined up with the Sin wave in Step 1?)



Message Edited by j.masse on 02-07-2008 05:16 AM
0 Kudos
Message 3 of 4
(4,030 Views)

Hi,

The PCI-6229 has four Analog Outputs so you should be able to generate all your signals from one card, this way we don’t have to worry about synchronization between cards.

Your problem with this setup is that your are trying to configure two different sampling rates on the DAQMX timing VI for the analog output task when your card, even though it has four analog output channels, it only has one timing engine.  Only and only one sampling clock can be configure, from the picture I can infer that the 20 Hz signal has a different sampling rate than the 5Khz and you have two  DAQmx timing.vi's  setting up the clock from the waveforms information to the same card.

So from here you have two options either you build all the waveforms with the same sampling rate or two of the signal are generated with the 6229 and the other two with the 6713.

If you choose the first option your problem will be to find a balance between both signals since you have to build the 5 kHz signal at a rate no less than 10 KHz (Nyquist), and as a consequence  the number of samples needed to build a 20 Hz might exceed the available space for the samples.

Your second option using the both cards one to generate a pair of the samples and the other card the other pair you can take a look at these examples:  NI-DAQmx: Synchronize Analog Output across Multiple Devices Using LabVIEW and NI-DAQmx: Multiple Analog Output Tasks Simultaneously.

I hope it helps

Jaime Hoffiz
National Instruments
Product Expert
0 Kudos
Message 4 of 4
(4,018 Views)