LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

PXIe1073 with two NI-4461 cards

Hello, I have 2 cards 4461, in PXIe1073. I try to synch. between 2 AI of Card#1 and the 2 AI of Card#2. I mean, that if I Use 200Khz, after few minutes I am suppose

to get the same Samples numbers from both cards and the same.

Now, if I am inject to them the same wave (from Signal Generator - 40Hz Saw Wave), and I take from them the same Samples Numbers, I suppose to see them together, the same Signal. But No, after few minute's a 1%-2% delay start to occur. And if I`ll wait more, the different get bigger. 

How can I synch the 2 Cards to use the same Analog Input Clock (of samples or of Analog Inputs Device internal Clock?) ?

0 Kudos
Message 1 of 18
(324 Views)

Here, I think the best approach is also the simplest. Use channel expansion which allows you to add all the 4461 ai channels to the same analog input task. DAQmx will start- and clock- synchronize all the input channels.

 

The DSA Soft Front Panels use channel expansion to synchronize DSA channels. Use the DSA Soft Front Panel to verify that the synchronization works for you. Then, you can implement the changes (simplification) in your code knowing they will produce synchronized input channels.

Doug
Enthusiast for LabVIEW, DAQmx, and Sound and Vibration
0 Kudos
Message 2 of 18
(300 Views)

Hello, I have 2 cards 4461, in PXIe1073.I will explain it again.

If I synch. them to start together, and they work in 200khz samples rate, so I except that after 2 minutes I will get from both of them exactly the same amount of Samples.

I connect the 4 CHs to the same signal (for example triangle wave), if every 1 sec, I take 200,000 samples from each card, in continuous mode, after 2 minutes I suppose to see the same wave from both cards. What I saw, that 1 of the card start to late with the Shape of the triangle wave relative to the other card. Like 200,000 samples in 200kHz take 1.000001 Sec and not exactly 1.000000 Sec.

0 Kudos
Message 3 of 18
(253 Views)

Doug, I can`t connect 4 CHs from 2 different Cards, the init DAQmx VIs refuse to "OK" it.

0 Kudos
Message 4 of 18
(252 Views)

Show your code, I do what Doug described all the time.

Are the cards in the same chassis? If not, then Doug's suggestion will not work. I believe that Channel Expansion takes care of any routing through the PXIe chassis for triggers, sample clocks, etc, across any PCI bridge, but maybe Doug can confirm. (I use it in cDAQ) If it doesn't take care of routing, then you will need to do it in MAX or in your code.

0 Kudos
Message 5 of 18
(232 Views)

Hello mcduff,

 

I don`t tell all the details,  to simplify the problem, and this cause the different...

My original VI is with writing 2 CHs and reading 4 CHs. When I take all the 4 RD CHs (Analog Inputs-> "RD") and get them together into the "DAQmx Flatten Channel String.vi" (through "Build Array"  VI) it gives the error -200106 "Property must have the same value for all channels on this device".

 

If I use only RD_4CHs.vi than indeed you can get all the 4 CHs together. But this not my case (the vi I need is the "Read 4 CHs and WR 2CHs.vi")

Download All
0 Kudos
Message 6 of 18
(222 Views)

In between meetings and don't have any time to make modifications, but:

  1. Delete one of your AI tasks before doing channel expansion, you should have 1 AI task and 1 AO task.
  2. Rather than use the Channel Flatten function, use what is shown below. You will still need to connect the wire for range, etc. Make sure you use a shift register for the task.

mcduff_0-1753989254051.png

 

0 Kudos
Message 7 of 18
(210 Views)

Tamirsh, here is your VI modified to use a single ai task, and all channels added in the single physical channel control for each task.

Read 4 CHs (ChannelExpansion) and WR 2CHs.png

 

Also, if you have access to the Sound and Vibration Toolkit, you can reuse the synchronization subVIs used in the Stimulus Response examples.

Doug
Enthusiast for LabVIEW, DAQmx, and Sound and Vibration
Message 8 of 18
(194 Views)

oh, in the modified VI, I did switch to finite just so that the VI would write and read all the samples, so I could verify functionality through wrapped-back data on a couple of the channels. 

Doug
Enthusiast for LabVIEW, DAQmx, and Sound and Vibration
Message 9 of 18
(175 Views)

@tamirsh wrote:

Hello, I have 2 cards 4461, in PXIe1073.I will explain it again.

If I synch. them to start together, and they work in 200khz samples rate, so I except that after 2 minutes I will get from both of them exactly the same amount of Samples.

I connect the 4 CHs to the same signal (for example triangle wave), if every 1 sec, I take 200,000 samples from each card, in continuous mode, after 2 minutes I suppose to see the same wave from both cards. What I saw, that 1 of the card start to late with the Shape of the triangle wave relative to the other card. Like 200,000 samples in 200kHz take 1.000001 Sec and not exactly 1.000000 Sec.


Depending on the internal clock it might not hit 200kHz exactly, so that small difference from 1 sec is probably not a biggie.

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 10 of 18
(116 Views)