Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Streaming AO from manipulated copy of AI: PCI 6115

Solved!
Go to solution
I would like to stream an analog output of a manipulated copy of an analog input, but I can't seem to get anywhere close with the available examples.  It might well be an impossible task with DAQmx.
0 Kudos
Message 1 of 5
(3,394 Views)

Hi aldoa,

 

If you need hardware-timed input and output signals, you will need to program a delay between AI and AO such that the input/processing can keep up with the generation.  You can take a look at this following example to get started (just add your processing inside the while loop between the DAQmx Read and the DAQmx Write):

 

Use AO to Output Delayed Version of AI in DAQmx

 

 

 

If you are manipulating and outputting a single sample at a time (software-timed update rates) the code becomes much more simple.  It would still look similar to the above example, but you wouldn't need any timing functions and would not need to pre-load the output buffer with 0s.

 

 

Best Regards,

John

John Passiak
Message 2 of 5
(3,387 Views)
Solution
Accepted by topic author aldoa

Thanks John, I am able to get it to work with the delay; this would certainly work if I actually had a stream of data.  I described my system incorrectly.  There are timing issues that will not allow for a delay in the AI and the AO without incurring errors.  Nonetheless, it works as prescribed, making me wish I had a streaming application to use it on.  No worries though, I have a solution that will still be able to manipulate the data in real time using an AO channel and some hardware.

 

If there is a real time solution to this problem, let me know.

0 Kudos
Message 3 of 5
(3,373 Views)

Hi aldoa,

 

What amount of delay is acceptable for your application?  Regardless of how you implement the system, it will always take time to process input data before outputting a modified version.  Nothing is going to be truly instantaneous.  What type of modification are you making to the input and what are the input and output signals?

 

My recommendation would be based on the answers to the above questions, but it sounds like a hardware solution might be what you are looking for.  If the modifications you need are simple, you could build a circuit or possibly find an IC that suits your needs.  For more complex and customizable processing you might want to consider an FPGA solution.

 

 

Best Regards,

John

John Passiak
Message 4 of 5
(3,352 Views)

John--

 

I made the necessary modifications in hardware.  My application is to amplitude modulate a packet stream to create random burst errors in Ethernet.  Any delay would affect the performance of the simulation because that delay time would skew the statistics.  I had it working with a 20 ms delay, but the performance did not make my boss happy.  The hardware solution is much more elegant.

0 Kudos
Message 5 of 5
(3,343 Views)