LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Synchronize Analog Input and Output in DAQmx

Solved!
Go to solution

Hello,

 

I'm trying to write an analog output and read the input simultaneously. I used the Multi-Function-Synch AI-AO.vi example and connected the output of my PCI-4461 directly to the input with a short BNC cable. I've modified the VI a little to output a triangular wave and show both the input and output at the same time. It seems there input channels starts reading at some delay after the output:

Capture630.jpg

 

My problem is that I need them to start at the exact same time. Here is a screen shot of the modified VI (also attached).

 

Capture631.jpg

Any ideas???

 

Thanks,

 

Ran

0 Kudos
Message 1 of 4
(12,071 Views)
Solution
Accepted by topic author rvardimon

Hi Ran,

 

This knowledgebase explains where the delay comes from: Why Is My Data Delayed When Using DSA Devices?

 

One way to compensate for this is to discard the appropriate number of samples from the beginning of the AI acquisition.

 

Brad

---
Brad Keryan
NI R&D
0 Kudos
Message 2 of 4
(12,055 Views)

Hi Ran,

 

I had a similar problem earlier....I would suggest removing the data buffer as it is not required and also in the read vi inside the loop, instead of the data buffer specify a fraction of the sample rate or if that does not work the sample rate as it is as the "samples to read".

 

Also only one write vi will suffice you have two over here, unless you have another reason for that.

 

best of luck

sanju

 

 

0 Kudos
Message 3 of 4
(12,033 Views)

Thank you very much for both your comments, they were very helpful.

 

I've measured the delays of the PCI 4461, and they match the sum of the two delays mentioned in the specs.

Here's a table summarizing it:

 

Frequnecy Range ADC Filter Delay DAC filter delay Sum Measured delay Diff
3.2-6.4 35.875 37.4 73.275 74 0.725
6.4-12.8 39.75 38.5 78.25 78 -0.25
12.8-25.6 47.5 40.8 88.3 89 0.7
25.6-51.2 63 43.2 106.2 108 1.8
21.2-102.4 63 48 111 113 2
102.4-204.8 63 32 95 99 4

Also, sanju, your tip was very helpful. Writing the output once in the beginning and reading the input in loops is much better than writing the output every loop as well  - this caused all sorts of sporious delays.

 

Best,

 

Ran

0 Kudos
Message 4 of 4
(12,003 Views)