PXI

cancel
Showing results for 
Search instead for 
Did you mean: 

[General] A+D I/O sync possible??

Hi,
I have a general problem which I try to solve since a lot and could not find a clear solution neither in the forums, help files, NI support.

Setup:
Labview, PXI machine,
2x AWG 5421, Digitizer 5122, DIO 6542

Request:
Synchronize the acquisition and generation of data, starting from a specific moment.




Conditions:
It may happen that all the devices have different sampling frequencies.
Eventually some of the Sampling frequencies are defined by external clocks.

Typical application:
Device characterization: Control digitally a board, then generate at the AWG frequency sweeps,
read in the output of an analog filter, read in the stream of an A/D converter to which the AWGs are connected

Limits encountered:
Using TClk synchronization the clocks of the different modules cannot be chosen at will, they have to stay in specific ratios.
If I want to generate an arbitrary wave at the AWG, TClk synchro does not work as expected, as there are some "delays" in the devices; to say it in other words: if I generate at the AWG a sinus with phase 0 then I observe at the Digitizer a phase that is not zero.

Compromises:
If the request is not possible, maybe an easier solution is leave all the clocks (sampling frequencies) not synchronized, and somehow generate a trigger signal that IMMEDIATELY starts generation/acquisition in all the devices.
In this case we may be vulnerable to clock drifts; is there a way then to generate timestamps for the acquired data?

Hope that is general enough to start some discussion.
ciao, Leodp
0 Kudos
Message 1 of 4
(3,396 Views)

Hi,

Best Approach for the application in hand:

Now discussing the problem in application level, Frequency Response can be done even without using TCLK Synchronization. In this approach you would use two channels of the scope. Please refer to the picture below or Frequency Response.jpg in the zip file for hardware connections.

In this approach we will be splitting the signal and feeding one of them to Digitizer and the other one to DUT>> Digitizer. We can measure phase delay& Amplitude introduced by the DUT easily by using the reference signal connected directly to the Digitizer. The two channels of the Digitizer can be used to acquire the signal simultaneously. In this approach, clocks of Waveform Generator and Digitizer need not be synchronized and is easy to use.

Example posted in this link can be used for this application:

http://zone.ni.com/devzone/cda/epd/p/id/5079

=========================================================

In regards to the questions posted in previous post:

I would definitely recommend using the example TCLK Synchronization attached to this post if you still want to use TCLK Synchronization approach

1) Why can't I select any Sampling Rate for this system?

When using TCLK Synchronization, the TCLK needs to find Highest Common Factor for the sample rates selected to produce an internal T-Clock. Refer to this website for more information on working of TCLK. http://zone.ni.com/devzone/cda/tut/p/id/3675

The error arises due to the selection of clocking mode as Automatic. There are two modes of CLoking on Waveform Generator: High-Resolution Clocking and Divide-by-Down Clocking Mode. Please refer to this webpage for more information on clocking. http://zone.ni.com/devzone/cda/tut/p/id/5535#toc5

For the sampling rates selected, the Arbitrary Waveform Generator might be using High-Resolution Clocking/DDS Mode to get clock rates closer to the values requested. For example requested sample rate on Digitizer might be 25MS/s and 15MS/s on Waveform Generator, the coereced smaple rate might be 14.9999998MS/s. The requested sample clock rate on Digitizer is 25MS/s. The TCLK might not find the Least Common Denominator.

If you select "Divide by Down" clocking explicitly on NI-FGEN for this application, sample rates will be coereced appropriately to use for TCLK Synchronization. However, this might not get close to the sampling rate required.

2) if I generate at the AWG a sinus with phase 0 then I observe at the Digitizer a phase that is not zero.
 There are two things which are happening here.

a) The scope's fetching should be set "Relative to Start". This will enable the acquisition occur right after the TCLK Start rather than the immediate trigger  which is the default case.

b) The Waveform Generator keeps generating DC signal at the last value for which the signal aborted. This means that when the digitizer acquires the last DC value still being generated by the Waveform Generator in the beginning of the record. To resolve this for the application, force the waveform to zero at the end or reset the device at the beginning of the NI-FGEN Session as shown in attached VI.

As discussed above the solution using two-channels of the scope is the best approach...

Please let me know if I am not clear on anything.

Thanks,

Kalyan



Message Edited by kalyanramuv on 12-10-2007 07:36 PM

Message Edited by kalyanramuv on 12-10-2007 07:36 PM

Message Edited by kalyanramuv on 12-10-2007 07:39 PM

Message Edited by kalyanramuv on 12-10-2007 07:40 PM
Kalyanramu Vemishetty
Automated Test Systems Engineer
National Instruments
Message 2 of 4
(3,349 Views)
Hi Kalyanramu Vemishetty,

first I would like to thank you for the detailed answer, that clarifies a lot the situation.
From what I see there's no general solution to the problem, because of the limitations in synchronizing different modules, but different setups require different approaches.
Apparently what I wanted to do is not possible with TClk, or at least not immediate.
In fact, apart from the problem of synchronizing modules with different sampling frequencies we have to consider that each module has a different latency. When the module (although synchronized by TClk routines) receives a trigger it does not immediately start acquiring/generating, but a certain amount of time is required (i.e.
43 sample clock periods + 110 ns for the 5412 AWG).
However this time delay is mainly deterministic, and it could be measured and accounted for, but this can be tricky for specific setups.

Anyhow, thanks again.
Leodp



0 Kudos
Message 3 of 4
(3,233 Views)
Hello,

My question is somewhat related to Leodp's:

Using PXI-5421, I would like to generate an arbitrary waveform consisting of 1000 different samples, at a rate of 1MHz, and trigger an external device after each sample has been generated.

The NI Signal Generators Help document (under Marker Events) suggests using Markers as Trigger Outputs. However if I put a marker at, say, sample 0, it will only signal to the external device that the first sample has been generated - I would like to have an "output ready" signal after each sample.

I have thought of generating a sequence list with 1000 sequences, each consisting of 8 identical values (to satisfy the conditions for min. sequence length and marker placement) at a rate of 8 MHz (to compensate for 8 values in sequence), setting the marker to sample 0 of each sequence, and triggering the sequence list in Single Trigger mode. Does this idea make sense, or is there a more elegant and straightforward solution?

Thanks a lot,
Pavle


0 Kudos
Message 4 of 4
(3,186 Views)