10-19-2009 02:51 PM
Solved! Go to Solution.
10-19-2009 03:50 PM
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
10-19-2009 07:34 PM
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.
10-20-2009 11:59 AM
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
10-20-2009 01:13 PM
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.