Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Generating 4 analog output waveforms with different frequencies

Solved!
Go to solution

Hello all,

                  I was trying to generate 4 different waveforms at different frequencies say

1. first waveform is a sine wave with 5000 Hz,

2. second one with 8000Hz,

3. third one is a square waveform with 25Hz and

4. fourth one with  50 Hz triangular waveform

all the waveforms have to be generated simultanoeusly.

 

I have tried generating with single analog output task and sample clock (Clock rate is 100000). By crosschecking in oscilloscope i can see only 5000Hz and 8000Hz one were generated correctly and the rest of two waveforms were showing incorrect frequencies. 

 

I guess this is due to high sample clock rate for lower frequencies for ex 25Hz and 50Hz. If i scale down clock rate to get lower frequencies correctly then i can not generate higher frequencies correctly. (there is a clsh between frequencies and clock rate)

 

 

 

Is there any way of using DAQ board master sample clock and scaling down its magnitude (wherever it is needed for each waveform separately) to generate all the waveforms at different frequencies simultaneously in a single task?

 

 

0 Kudos
Message 1 of 65
(5,771 Views)

Hi,

 

first sorry I do not know your answer but I need your help as I am beginner using DAQs.

 

My question may seem elemenatry but I appreciate your help. Consider I use virtual instrument and a DAQ as well as signal conditioning to generate pulse wave. Using the DAQ and virtual instrument means that without a real pulse generator, I can have a pulse in output my DAQ that I can apply to my real DUT???

 

Thanks

0 Kudos
Message 2 of 65
(5,749 Views)

elahetal,

 

Since your question is not at all related to the thread and you are not providing an answer, start a NEW thread for your question.

0 Kudos
Message 3 of 65
(5,744 Views)

Hi viswa,

 

I expanded one of the shipping examples to allow the use of multiple channels.  This should be exactly what you need (assuming you are using LabVIEW):

 

Communities: Generate Multiple Channels of Analog Output with Different Frequencies

 

 

Regarding your question about the clock--all of the analog output lines share the same timing/triggering circuitry (and thus they must be put into the same task).  You cannot do hardware-timed Analog Output across multiple channels on the same device unless all of the lines are in the same task.  You can't set the sample rate on individual lines separately, so the way to go about this is to build software-defined waveforms for each channel based off of a given sample rate (as is done in the above example).

 

If you have any questions don't hesitate to post back.

 

 

-John

 

John Passiak
Message 4 of 65
(5,736 Views)

elahetal,

 

Dennis does have a point, it doesn't sound like your question is related to the original post. In the future you should start a new thread if you have an unrelated question.  I don't mind helping out in the meantime...

 

 

I'd have to know what device you're using to be more specific, but many of our DAQ devices have analog output lines that can indeed output a real pulse to your DUT.

 

If you're talking about generating TTL pulses (for triggering for instance), you could look into using digital output lines or a counter to generate the pulse.

 

 

There should be a number of shipping examples to help you get started with any of the above cases.  If you are using the DAQ to control an SCXI chassis you might need to use something like the 1180 feedthrough module to get access to the lines you need.

 

 

Best Regards,

John

Message Edited by John P on 10-30-2009 06:45 PM
John Passiak
Message 5 of 65
(5,734 Views)
Oops, gave the wrong link for the page that describes TTL logic levels.
John Passiak
0 Kudos
Message 6 of 65
(5,720 Views)

Hi John,

                  Thank you for the help. I tested the vi it is generating different frequncy waveforms as you explained in the previous post. I am little bit puzzled here to calculate actual and original sampling rate with buffer size for desired frequency. Please could you explain for me? i searched through help but not understood properly. I have attached few images here showing waveforms in oscilloscope. The output waveforms contains steps. I guess to avoid this we have to have optimised values for sampling rate and buffer size. 

 

Download All
0 Kudos
Message 7 of 65
(5,686 Views)

Hi viswa,

 

In this case the optimized solution is actually to update the output as quickly as possible. Right now, you are only updating at a 30 kHz sample rate (so your 5 kHz signal is only going to have 6 discrete levels per period, hence the very noticeable steps).

 

Didn't quite catch what hardware you were using, but assuming a 6229 (which has 4 analog outputs) you should be able to turn up the sample clock rate up to 625 kHz. A 6259 should be able to update at twice that rate, you will just need to increase the buffer size proportionally. I'd start with a ratio of about 5:1 which would be 125k sample buffer with a 625 kHz sample rate on the 6229.

 

 

Of course, any sampled output is going to have steps in it based off of the update rate. Sampling at a higher rate will make the steps shorter in duration and thus less noticeable. If the steps are still an issue after maxing out the sample rate, you could always look into adding an external lowpass filter to remove the sampling artifacts which will be much higher frequency than the signals you are trying to generate.

 

 

Best Regards,

John

Message Edited by John P on 11-02-2009 11:17 PM
John Passiak
Message 8 of 65
(5,665 Views)

Hi John,

                 Thanks for quick reply. I got one more complexity to the programme. I want to add two waveforms programmatically

 

for ex: one of the sine waves of frequency 5000Hz and square wave of 25Hz and generate added signal from 4 th analog output (previously explained in the first post that i want to generate a triangular waveform from 4th output, instead of it i want to generate now added waveform). Is it possible?

 

i guess if i can generate through software timing correctly the 2 sine waveforms and a square waveform in single task i should do this addition as well.

 

In addition to 4 analog outputs i have to generate two digital waveforms at 25Hz and 15kHz for controlling externally a  CCD camera. Could you tell me your views of possibility of these things simultaneously.

 

By the way i am using USB6229. 

0 Kudos
Message 9 of 65
(5,645 Views)

Hi viswa,

 

Do you mean that you need to generate an arbitrary waveform instead of the triangle waveform? If this is the case you just need to write the arbitrary waveform as the 4th element of the array instead of the triangle wave.

 

The example I posted does not use software timing--it does define the waveform to be generated on-the-fly but the update rate is defined by hardware.

 

 

The digital waveforms shouldn't be much of a problem, you can use the AI Sample clock as your clock for the digital outputs to synchronize everything together. Be sure to start the digital task before the analog task in software so that it is armed and ready to go by the time the first sample clock pulse is received from the AI task.

 

Do you mean the digital waveform is an arbitrary sampled waveform, or are you looking for a pulse train?  If you need a pulse train, the 6229 also has two counters available that can generate the pulse train if you need.

 

-John

Message Edited by John P on 11-04-2009 12:21 AM
John Passiak
0 Kudos
Message 10 of 65
(5,626 Views)