LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Sync ni tclk and daq digital input

so I am currently using 6672 to generate a square wave that triggers a frequency generator to produce a single chirp. I am trying to capture the chirp with a series of 5122. All the 5122 are synchronized using ni tclk, and they capture in continuous acquisition mode starting with the tclk initiate vi.

I am trying to capture the square wave using a 6572 using DAQ digital n samples read. The timing between the square wave and the chirp being recorded its crucial. If I use both a 5122 to record the square wave and a 6572 I get a two square waves that are nearly identical but are offset by a random amount of points. Is there any way to synchronize the start acquisition for both of these cards so that the captured data is the same? Or is there a way to record what this offset is with some kind of time step that records the exact time the start acquisition competes for these devices?

TlDR; can a 6572 daq input be tclkd to 4 5122s?
0 Kudos
Message 1 of 10
(3,849 Views)
Hello!
 
I have been looking in to this question and have a few things that might be helpful without seeing the code that you are using:
 
- TCLK should only be used with our MI Drivers (like NI-HSDIO, NI-FGEN, NI-SCOPE, etc.). This article describes TCLK in a bit more detail: http://www.ni.com/white-paper/5501/en/
 
- Just for clarification, is the chirp being used as a trigger to start the acquisition? Also, what kind of devices is the 6527 that you are using? I have not been able to find a device with these numbers, and unfortunately I haven't been able to look in to it's capabilities yet. 
 
- Here is an example that from the description sounds close to what you want to do. Is this similar to how your code is set up?: http://www.ni.com/example/29747/en/
 
- These are two other forums that discusses an unwanted trigger delay when using TCLK and gives a few suggestions for how to work around this: http://forums.ni.com/t5/PXI/Unwanted-trigger-delay-using-TClk-on-PXI-1033-chassis-with-PXI/m-p/23707...
 
 
Please take a look at these forums and examples and let me know if you have any questions. Also, you can post a picture of your code and the delay that you are seeing in order to continue to troubleshoot. 
 
Thanks!
Stephanie S.
Application Engineer
National Instruments
0 Kudos
Message 2 of 10
(3,800 Views)
It should read 6537, hazards of typing from a mobile.

I did find an example a few weeks back that allowed the coffee to get the session id of a daq card. I tried bundling it in an array with the 5122 sessions. But it doesn't appear tip sync them.

Our doesn't appear you can use tclk with daq cards
0 Kudos
Message 3 of 10
(3,772 Views)
Coder... not coffee
0 Kudos
Message 4 of 10
(3,765 Views)
The sampclkdelay doesn't appear to solve the problem. The delay between what the 5122 and the 6537 register appears to be random. I've experimented with offset under daq as well , but again a set number here almost never matches the random delay amount
0 Kudos
Message 5 of 10
(3,763 Views)
The chirp isn't starting the acq. It is the end signal. I am trying to capture the square wave coming out pfi0.

This project uses Doppler so the delay is very important.
0 Kudos
Message 6 of 10
(3,762 Views)

Here is the code i am using with a graph showing the delay.  I would consider this problem solved if i could some how associate each point one with a very accurate time stamp, i could then shift the results during post processing.  

Download All
0 Kudos
Message 7 of 10
(3,737 Views)

Thank you for providing the additional details! I think rather than using TCLK (which is primarily used to synchronize digitizers, signal generators, and digital waveform generator/analyzers that are based on SMC technology), you could try using NI-SYNC with your 6672 card. Using the timing and synchronization should give you the accuracy that you are looking for. You would need to send a trigger to trigger the 6572. Here are some examples that might help:

 

- In the NI Example Finder, go to Timing and Synchronization >> Signal Based >> Route Software Trigger.vi. This is a very basic example of how to set up a trigger using NI-SYNC. Here is a more in-depth example showing this functionality. I believe you can do something similar but using NI-SCOPE and DAQmx as opposed to NI-HSDIO and NI-FGEN:

 

https://decibel.ni.com/content/docs/DOC-14888

 

- If you want to move more towards finding the offset of the timestamp, take a look at this example to see if you can apply a similar method:

 

https://decibel.ni.com/content/docs/DOC-3421 

 

Take a look through these, hopefully they will help give a bit more insight in to how to set up your system. Thanks!

Stephanie S.
Application Engineer
National Instruments
0 Kudos
Message 8 of 10
(3,709 Views)

The last link doesnt work for me.

 

I wanted to include the vi i am using as well as another image showing some code i was running before the previous pictures.

 

I am already using ni-sync to set up the clock connections.

 

Not using ni-tclk isnt really an option because in the actual program that has a lot more stuff going on, i have four 5122's sync'd up with tclk.  The demo i threw together to show the problem doesnt need it, but i wanted the demo to be representative of the larger program.

 

In a previous post you linked to another forum post with a similar problem with delays, i dont believe there was any resolution in that thread either unless i misunderstand,

 

The 5122's are running in continuous (re triggerless) operation mode.  The only option i really have for capturing an event that would synchronize the two cards is the initial event that starts the acquisition process.  The sample clock for the 50MHz IO card is set to onboard, which is supposed to be the Clk10 on the backplane.  The NI-Tclk is supposed to sync cards using Clk10 on the backplane.  There must be some way to game labview so that each is trigger on the same falling edge of the Clk10 wave.

Download All
0 Kudos
Message 9 of 10
(3,689 Views)

Thank you for the additional information. Just so that I have an understanding moving forward, how sychronized do you need this application to be? How fast is your system running? TCLK is going to compensate for very small differences from the 10MHz clock and ensures that all of the cards synch'd with TCLK start at exactly the same time. Unfortunately, there is not a very easy way to use those compensated values to start another system (like your DAQ device) and will likely result in an offset between all of your readings. 

 

My best suggestion would be to use your timing and synchronization card to send a start trigger to the digitizers and to the DAQ device through the star trigger lines (speaking of which, what chassis are you using?). You could still use TCLK if necessary between the digitizers, but you will most likely still see that offset between the DAQ and the digitizers readings. A DAQmx triggering VI would also need to be inserted in order to set up a start trigger. If you decided not to use TCLK, as you said, the signals would not be synched to themselves.

 

This example, if tweeked so that it is using NI-SCOPE rather than FGEN or HSDIO along with DAQmx, is the best way that I can think of to do this:

 

https://decibel.ni.com/content/docs/DOC-14888

 

Using the NI-SYNC VI's in this example you need to send a trigger to PXI_Trig0 line (in your case, use star trigger lines if you have them available on your chassis. All of the lines have been trace length matched and should help avoid any kind of delays through the lines). Notice that the DAQmx is set to trigger off of this PXI_Trig0 signal. You will set up thet NI-SCOPE trigger the same way.

 

If this is not providing a good enough measurement, you might want to look at some of our HSDIO cards with SMC. These would allow you to use TCLK to sync both the digitizers and your HSDIO card.

 

Please let me know you have any additional questions!

 

Thanks,

Stephanie S.
Application Engineer
National Instruments
0 Kudos
Message 10 of 10
(3,657 Views)