From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

DAQmx Acquire real-time data from analog input channel and send acquired data to analog output channels simultaniously

Solved!
Go to solution

Hello! I am new in Labview for data acquisition.
I have a NI USB 6259 DAQ (Labview Ver-2011).
I need to create DAQmx task that will continuously acquire data from (ai-0)
and send that acquired data, as it is, to output DAQ channels (ao-0 & ao-1) simultaneously, real-time.

input data (variable Frequency = 15Hz to 2KHz).
Anyone can help. I thank in advance for the help.
Regards,
Aamer.

0 Kudos
Message 1 of 6
(3,896 Views)
Solution
Accepted by topic author Aamer2k

Aamer2k, 

 

There are no internal routes available to do this automatically.

Why do you need to generate an output if it already exists and is going into an input on your device already? Could you just use the same wire that is going into ai0 instead of generating a redundant signal?

If you still need to do this, you could experiment with writing in the same values as you are reading out in two separate tasks. Look at the "Voltage - Continuous Input" and "Voltage - Continuous Output" examples. You could try wiring the data terminal from the read on the input example to the data terminal from the write on the output example.

 

VanCamp

0 Kudos
Message 2 of 6
(3,860 Views)
Spoiler
Spoiler
Thank you very much for your reply.
Spoiler
Basically first I need to read real-time signal (ai-0) at a rate of 5120 S/s, then out 2 signals at analog output (ao0:1) at same rate real-time, with no delay (upto 0.5ms delay is acceptable between input and output). But I am facing delay of 30ms. Can you send me a sample program, which help me to do this.
Regards,
0 Kudos
Message 3 of 6
(3,840 Views)

Hello:

I've tried what you said. First I used DAQmx Functions, at 1Hz input, output is 1Hz ok, but as i change input frequency the output wave shape is change. 1 to 10Hz input, output is ok, but >10Hz, output is not acceptable.

0 Kudos
Message 4 of 6
(3,831 Views)

When I used DAQ Assistant. Output wave shape is 100% ok as  input, 1 to 2kHz.

But problem is time difference between input and output is 50 milli seconds.

time should be less then 500 usec.

0 Kudos
Message 5 of 6
(3,830 Views)

Aamer2k,

 

Currently, your code is not synchronized because you have not shared a trigger or sample clock - your tasks just happen to be loading at approximately the same time.

 

Look at this article, which explains some synchronizations methods: http://www.ni.com/product-documentation/4322/en/

 

Specifically, I advise modifying your code to be similar to figure 2, which implements sample clock synchronization - add the sample clock VI's and merge your errors accordingly, which makes sure the input is ready to read before the output begins writing. Also, the "rate" control they implemented is what is necessary to preserve the shape of the signal - the default sample rate is too low for the signals you are trying to read. Try setting the rate to 100kHz.

 

VanCamp

0 Kudos
Message 6 of 6
(3,820 Views)