Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Simultaneous input and two outputs

Hi
 
I require to generate a 400 Hz sine signal and output it via a M6259 DAQ analog output. Then I take this signal via the analog input of the DAQ, do some processing to it and output it via another analog output of the DAQ.
I have attached a programme below to do this. However in it I don't get real time output with the input.That means the second output doesn't change simultaneously with the first output. There is a delay of a minuite. Further the output signal frequency is around 50 Hz. Can some one give some advice on this.
 
Thanks
 
 
Mal
0 Kudos
Message 1 of 4
(3,125 Views)

Hi Malkoba,

I had a look at your code and this is what I think is happening:

You have set up an aquire task that is taking 700K samples a second but only outputting 100K per second.  This will cause the data to be outputted 7 times slower than the orrigonal input.

You need to set the sample clock values to the same values for each of the tasks. (so 100K for both tasks).  This will ensure a quicker response time from your outputs.

Also if you set your buffer values to 5000 (both of them) then you will find that you will not get any more buffer overruns in your code.

I have attached an example of your code with the changes I have suggested.

Thanx

(Post back if this helps, or if you need more info)

AdamB

National Instruments

Applications Engineering Team Leader | National Instruments | UK & Ireland
0 Kudos
Message 2 of 4
(3,110 Views)
Hi
 
Thanks for your help. I tried the code. I get error 200279 at DAQmx readvi. And get an out put signal for a second and noise after that. For that second 5000 samples are written to the write vi. What do you think?
When I increased the read and write buffer sizes to 100000 the it works in the first iteration but I get a 200279 error in the second at the read viiteration and 200290 at the write vi.
 
Thanks
 
Mal
0 Kudos
Message 3 of 4
(3,104 Views)
What device are you using?
It might be the case that you can't sample at that rate.
Or that your computer can't read quick enough.
Try reducing the sampling rates?
If you still have a problem get back to me
 
Thanx
 
AdamB
Applications Engineering Team Leader | National Instruments | UK & Ireland
0 Kudos
Message 4 of 4
(3,099 Views)