Showing results for 
Search instead for 
Did you mean: 

Phase measurement with MyRIO



I want to phase measurement for two sine wave. 


İnput signals is constant. (Generetad with Digilent Analog discovery)


Ch1 500mV / 500Hz 0 degree

Ch2 500mV / 500Hz 45 degree


Amplitude and frequency is steady and wrong. Phase measurements is unconformable.  How to can I fix it?

Download All
0 Kudos
Message 1 of 4

Learn to use DAQmx, and output your sampled data as a waveform, which is a LabVIEW construct for sampled data that includes the sampling time (and implicitly, 1/dt = sampling frequency).  It is almost always a "beginner's mistake" to use the Dynamic Data Wire (the checkered wire that you used as inputs and outputs of the Tone Measurement Express VIs.  Learn to not use Express VIs when LabVIEW provides you with other (better) routines (look in the Waveform Palette, but you don't yet have Waveform data ...).


If you go on the Web, you can find good tutorials for DAQmx.  One of my favorites has a title something like "Learn 10 Functions in NI-DAQmx and Handle 80 Percent of your Data Acquisition Applications".  It teaches you about DAQmx, about using MAX with your device to "understand your device", about creating Tasks (in MAX, or programmatically), and other useful things.


Bob Schor

0 Kudos
Message 2 of 4

Thanks Bob.


This page says: "DAQmx VIs will not work for myRIO because it runs off the NI-RIO Driver."


I am Electric-Electronic Engineer. I know basic mathematics and physics rules. I don't understand why Labview functions are so incomprehensible. Therefore, I could not like Labview. I act by thinking that labview functions work like electronic simulation programs.

0 Kudos
Message 3 of 4

Phase is a referenced measurement, that is, you measure the phase relative to a known standard, starting point, etc. I don't know how the express VIs are measuring, think they are doing a FFT, but they are separate processes. If I look at the values you got, and wrap the phase, the difference between the two is about 45 degrees, give or take.


There are a few ways you can go:

  1. Unwrap the phase the you are measuring, then determine the difference. Note the phase may jump around. To avoid that try always measuring a integer multiple of waves.
  2. Pick one of the sin waves as your reference and determine the phase difference with respect to the second one. This is how a Lock-in works. Search for Lock-in. You could also count zero crossings, etc, but the Lock-in (mixer then LP filter) method works well.
  3. Plot the Lissajous Curve, for 45 degrees the shape is known.


0 Kudos
Message 4 of 4