From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Synch and Trigger DAQ with PXIe

Trying to synchronize 2 cards in a PXIe system - PXIe-4499 and PXIe-4300.  They can't be put in the same task so I was using some previous example vi's that show how to share the PXIe_100 reference clock and use ai/StartTrigger from the master to trigger the slave (see attached).  I don't get the trigger thing.  My understanding is that when the slave task is set to wait for the ai/StartTrigger signal from the master device and the slave task is started first, it puts it in an "armed and waiting state", then when the master task is started it would trigger both the master and slave to start acquiring data at the same time.

 

However, comparing the t0 timestamp of the waveform data after a DAQmx Read of the master and slave, the slave always starts about 40 milliseconds before the master. 

 

And if the slave is armed and waiting, shouldn't I be able to put a delay between the slave task start and the master task start and they should both still start acquiring data at the same time - when the master starts?  With a 3 sec wait, the slave timestamp is always 3 sec + about 40 ms earlier than the master t0 timestamp. 

 

This indicates that as soon as the slave task is started, it starts acquiring data to it's buffer and does not wait for the StartTrigger from the master.

 

So what am I missing?  Or is there a better way to get devices to start acquiring at the same time, using the same clock?  Thanks for the help!

0 Kudos
Message 1 of 4
(2,208 Views)

Hey cs11,

 

The behavior you are experiencing is most likely due to the fact that you are trying to synchronize a DSA(PXIe-4499) and non-DSA(PXIe-4300) device. The DSA device has a built in digital filter which needs to read a few samples and process them before returning a sample to the user. The reason your delay didn't work is due to the fact that you still only delayed the start trigger to both tasks and their reads still occurred at the same time. What needs to be done is a dummy read on the DSA task to get rid of the samples that are first read for the digital filter. Here is a Knowledge base that covers this topic:

 

http://ae.natinst.com/public.nsf/web/searchinternal/f989b25ff6ca55c386256cd20056e27d?OpenDocument

 

I hope this is useful.

 

Regards,

 

-Travis E

 

National Instruments
Product Marketer
0 Kudos
Message 2 of 4
(2,176 Views)

Travis -

Thank you for taking the time to review my question!  I will double-check, but I don't think it's because of the DSA/non-DSA issue.  I'm pretty sure the same thing happened when I tried 2 PXIe-4300s, using one as master and one as slave.

 

The 3 second wait in the vi between the DAQmxStart for the Slave and Master is solely to see if the slave does indeed wait for the trigger from the master.  Typically, I wouldn't use a wait at all.  And I'm using the t0 timestamp of the data after a DAQmxRead to see if it did wait.

 

I've attached another file that may help explain my question better (or just make it more confusing).  Shouldn't the slave wait for the trigger before it starts acquiring data and filling it's buffer?  It doesn't seem to.  The DAQmx Reads do start at about the same time, but because they read from the beginning of the buffers, and the slave buffer seems to begin filling as soon as the Save DAQmx Start is issued, the timestamp of data point 0 on the slave is much earlier (in my case, 3 seconds earlier just because that was an arbitrary number I chose) than the timestamp of data point 0 of the master.

 

If the slave doesn't wait for the trigger to begin acquiring data and filling it's buffer, then I don't understand the purpose of setting the trigger for the slave.

 

Or, maybe I don't get timestamps.  I assume when doing a DAQmxRead and get a wave form with t0, dt, and Y, that t0 is the timestamp of when the device actually acquired the first data point (not the time of the DAQmxRead).

 

Oh, I could not get to the KB article you referenced -- ae.natinst.com could not be resolved.

 

Thanks again!  Hope I'm not being too confusing.

0 Kudos
Message 3 of 4
(2,164 Views)

Hello cs11,

 

It is interesting you experience the same issue when running the code with two PXIe-4300 cards. My only thought at this point is that when the Start Task is called an automatic time stamp is made but since there is no data then you cannot progress using dt but you can once measurements start being sampled. I apologize for the link earlier, here is a corrected one:

 

http://digital.ni.com/public.nsf/allkb/F989B25FF6CA55C386256CD20056E27D

 

Take a look at this and give it a try. Try plotting both signals on the same graph as well as doing a single tone analysis to compare their phases.

 

Regards,

 

-Travis E

National Instruments
Product Marketer
0 Kudos
Message 4 of 4
(2,142 Views)