The fact that the amplitude components of your two signals are
detected correctly make you think that the VIs are used correctly.
Phase difference problems can be caused by different things like:
- If you are using two different boards, they need to be triggered.
Obviously the two signals need to be acquired at the same time to give
a meaningfull result.
- If you are using a multiplexed MIO board, you'll have to correct for
the multiplexing delay, that is the slight time difference between the
two acquisitions. This time is reflected by the difference in the two
signals timestamp (t0). The resulting phase error depends on the
frequency f of your signal, so overall you'll have to correct your
phase difference result with:
phi_correction(deg.) = (t0_1 - t0_0) * f * 360
- Finally your un-expected result could simply be wrapped around with
360 degrees (??)
If none of this helps you identify your problem, could you post a
simple VI with sample data and the results of your measurements?