LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

DAQmx Synchronous Reading and Writing

Hi Gokul,

could ya try one more thing for me.  Get rid of the trigger vi in the AO task and set the AO to use the AI sample clock.  Make sure to set the AI task to use the onboard clock.  I am curious about the synchronization when not using the trigger. Also, try flipping it around and set AO task to use the onboard clock and AI to use the AO sample clock.  I am curious as to what phase error exists and if its different for the 2 cases.  You might also want to try flipping the clocking in your current code using the trigger to start the AO.  All should be quick and painless tests and I will be interested to hear the results.

Drew

0 Kudos
Message 11 of 15
(1,124 Views)
Hi Drew..
I tried the different connections as you suggested and I observed the following:

Case 1: Using ai sample clock for ao and onboard clock for ai and removing the trigger VI of ao. The amplitude remained the same but the phase still remained at -7.2 degrees.

Case 2: Using ao sample clock for ai and onboard clock for ao and removing the trigger VI of ao. The amplitude remained the same but the phase varied every time I start executing the VI but remains constant throughout the run (till I press stop).

Case 3: For the original VI, changing the trigger from ao to start ai. I get the following error.

    "An attempt has been made to perform a route when the source and the destination are the same terminal. In many cases, such as when configuring an external clock or a counter source, you must select a PFI, PXI Trigger, or RTSI line as the source terminal."

If this problem of constant phase lag still exists, shall I add (-1)*value to it and make it zero ? Coz now I know the phase is zero between them rite? Will that cause some problem when the system is put to actual use?

Thnx.
Gokul.
0 Kudos
Message 12 of 15
(1,119 Views)

Hi Gokul,

If you have a system in place that provides a constant phase relationship then you can simply do some shifting of the waveform to realign the phase.  Again, if you are using a dual-phase lockin, that is multiplying the measured signal by the reference and another reference that is 180 deg out of phase (usually a sine and cosine waveform) and adding the results after LPF in quadrature, then the relative phase between your signal and the reference signals doesn't matter.  A single phase lockin, on the other hand, needs the reference and measured signal to be in phase to maximize the signal.

Drew

0 Kudos
Message 13 of 15
(1,106 Views)
Hi..
Thnx for the info. I am making both Single and Dual Phase lock-in amplifier. So I need to know watz happening.. So I thought since, I know that the phase difference is zero, I can correct tis by adding a number to make it zero. But will that work for a single phase. I guess it should.
But I am not sure. Will tell you once I do the actual measurement.
Post in if u have any idea abt tis phase problem.
Thnx.
Bye.
Gokul.
0 Kudos
Message 14 of 15
(1,073 Views)

Hi Gokul,

I would suggest checking out this thread, it is a very similar problem to yours with the differnce being multiple channel AI versus single channel.  The last couple posts are particularly helpful in showing how to calculated how many points your measured phase lag refers to.  I guess it would be impossible to identically measure the same signal for AI and AO when using the same clock since there will be some physical distance between the two and I don't know what kind of cabling you are using.  At any rate, since you are measuring a constant phase difference the easiest thing to do will be to delete a point(s) from the beginning or end of the measured signal (depending on the sign of the phase shift) and do the opposite on the reference signal to maintain the same number of points in both arrays.

http://forums.ni.com/ni/board/message?board.id=250&message.id=30860

 

Drew

0 Kudos
Message 15 of 15
(1,047 Views)