Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

output sine wave with frequency and amplitude set by input

Hello,

I have an Ni DAQ (USB 6289U) and am using labview to control it. I want to record an input (sinewave-like) and at the same time output a sinewave which frequency and amplitude will change dynamically proportionnaly to the input frequency. I can aquire the input, I can output a signal, and I am pretty sure I'll find a way to do both at the same time. But I don't know how to dynamicaly change my output. Right now what I am doing is creating my output waveform and creating a "task" with a analogue output channel with a bufer of the size of my waveform to output, then I with the DAQmx Write function to add my waveform to the task and I start the task. If I put this in a loop and try to change my sinewave between loops, I get gaps in my output. Anybody has hints on how to proceed or VI that do similar dynamic signal generation from which I could get inspiration?

Thanks

 

0 Kudos
Message 1 of 3
(4,361 Views)

Hi,

 

If you need to synchronize you’re your analog input task and your analog output task, I have found an example that can help you to move to the right way, the link is below. In this example, the analog output start trigger is used to start the analog input task. Since the tasks are on the same device, both sample clocks are derived from the same timebase and thus it is only necessary to share a start trigger to synchronize the devices

 

https://decibel.ni.com/content/docs/DOC-3882

 

Regards,

0 Kudos
Message 2 of 3
(4,342 Views)

Thanks Marand,

It will certainly be usefull for me to write my complete VI with both input and ouput. But I am still left with my main problem, dynamicaly change my output based on the input. So, if we take the example you point to, Marand, it would require changing the amplitude double and the cycles per buffer double based on measurement made in the input side of the VI...all this without having gaps in the output. I know it might be asking much, but in theory it shouldn't be that hard. If I could change whatever is in the output buffer in between two cycles of it being outputed I could output a continuously varying signal which properties depend on the input measurment.

But again, thanks Marand, the example you point out will become usefull.

Any suggestions for the "bigger" problem?

 

0 Kudos
Message 3 of 3
(4,335 Views)