Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

2 AO sine-waves with time delay

hi,
 
i need help trying to output 2 identical sinewaves through AOs where the first wave is generated at time t=0 and the second is generated after in initial delay some time later, t.i have been able to achieve outputting 2 counter pulse trains with an initial delay between them, but become stuck with AOs.the only thing i have been able to do with the AOs is generate 2 sine waves that have some phase delay between them, however, this is no good because they are then both started/generated at time t=0 - i need to create a delay (about micro seconds to ns which can be specifically defined and varied in the program).i have given my program below.any help would be great.
 
regards,
 
stephen
0 Kudos
Message 1 of 9
(3,789 Views)

Hi there,

Well I have thrown together a vi that may help you out.

Now it's a little bit of a mess but you should get the picture if you dig down into the sub vi's I have also attached.  Pretty much all it is doing is creating an array each itteration, and that array is a sinewave which keeps it phase.  (You should see that if you set the delay to about 7ms the top graph display will show you both sine waves with one having a delay.

I have worked with arrays and producing arrays that have a fixed amount of elements (the samples per channel value).  The delay is simply a set number of samples that correspond to the delay time needed.  The sub vi, simply creates an array of elements (you can define the size) that keeps the phase from it's last output.  the great thing about this approach is that you can adjust the amplitude and frequency on the fly.

Delay-AO.vi is the main vi.

I hope this does help, but don't hesitate to post back if you need clarification.

Thanx

AdamB

Message Edited by AdamB on 01-18-2007 06:35 AM

Applications Engineering Team Leader | National Instruments | UK & Ireland
Download All
Message 2 of 9
(3,771 Views)

hi adam,

thanks for the reply, could you send me those files in labview 8?i'm afraid i don't have labview 8.2.

cheers,

stephen

0 Kudos
Message 3 of 9
(3,766 Views)
Here you are...
 
AdamB
Applications Engineering Team Leader | National Instruments | UK & Ireland
Download All
Message 4 of 9
(3,763 Views)

Hi,

Did these help at all?

AdamB

Applications Engineering Team Leader | National Instruments | UK & Ireland
0 Kudos
Message 5 of 9
(3,739 Views)

hi adam,

they were both a great help thanks:)

cheers,

steve

0 Kudos
Message 6 of 9
(3,731 Views)

hi,

i've tried changing a few things from the programs you gave me a while ago (shown above) to create my program to generate 2 AO waveforms with a time delay betwene them.however, when i run the program, it is telling me that the waveforms i want have been generated, but when i hook the AOs up to an oscilloscope to check, there is no signal.how can this be?my new program is given below.

steve

Download All
0 Kudos
Message 7 of 9
(3,696 Views)
Hi there,
 
You have the sample clock vi set up?
It is defaulted to finite samples so you will only produce a set number of samples then the program will stop.
You need to set the "sample mode"s to Continuous Aquisition.  (this is done on the sample clock vi's)
Right click the input>>Create>>Constant. then select the correct value.
 
Try this?
 
AdamB
 
P.s currently that code will only output a single array of delayed data once, and will then read off a number of analog channels.
Do you not want the output and input to occur at the same time?
Applications Engineering Team Leader | National Instruments | UK & Ireland
0 Kudos
Message 8 of 9
(3,692 Views)

hi adam,

thanks for the help.however, just changing the sample clock to continuous samples won't help though, will it?after i have generated the initial waveforms (array with delayed waveforms), wouldn't i need to somehow append new wavforms continuosly to the end of these waveforms?how could this be done?also, i thought that the program ensures that the AI and AO occur at the same time- as the AO trigger is set to start when it gets a pulse from the AI start.

steve

0 Kudos
Message 9 of 9
(3,674 Views)