08-15-2017 07:35 AM
I have two signals that I would like to find the phase between. I'm not that concerned about the current phase value, but much more the average phase value. I used the instructions from NI to find phase of a square wave, and then used that output and put it into a mean ptbypt. However, I am getting the same values for the phase if I remove the mean ptbypt block. I'm not sure why it isn't finding the mean. Any help would be appreciated. I'm including the part of my vi that finds the phase and mean.
08-15-2017 07:45 AM - edited 08-15-2017 07:47 AM
08-15-2017 07:57 AM
Does your calculated phase even change? Add an indicator before the the Mean PtByPt and monitor that. A chart showing the before the mean and after the mean would be more telling.
08-15-2017 07:58 AM
08-15-2017 08:07 AM
The calculated Phase is what is inputted into the Mean ptbypt. I want it to run continually as data is being acquired. I'm including my Full VI, as well as the output before and after the Mean ptbypt, which as you can see is the exact same. Also, after looking at the graph of the calculated phase, I'm thinking there has to be a better was to accomplish that as well. The phase should be steady around 90 degrees. I'm not sure why it is jumping down as often as it is.
08-15-2017 08:10 AM
The signals are real.
08-15-2017 08:27 AM
PS: Use In Range and Coerce Rather than Is Less Than AND Is Greater Than.
08-15-2017 08:27 AM
Hi guy,
I want it to run continually as data is being acquired.
Ok. Where is the loop in your VI to have it run continuously?
Please don't use the "run continuously" button in the menu - it is just a debugging tool with side effects as you have learned by this experiment right now!
08-15-2017 08:35 AM
As Gerd mentioned, don't use Run Continuously. This Mean PtbyPt has an initialize sequence that on the first run, the average is reset. When you run continuously like you are doing, the average is reset every time and will output the same value as the input.
08-15-2017 08:39 AM
So does just the mean ptbypt need to be in a loop, or should I have the entire section that is finding the phase in a loop as well, or should the whole vi be in a loop, and then a subloop that has the mean calculation being done?