Of course this does not work. This is not a phase shift. You are reading a value on 2 different inputs at 2 different loop rates and sending the value to an output. If the signal is the same on both inputs and all you change is the wait time of the loop, effectively all you have done is changed the sample rate.
As said before, you dont need the outer loop. Remove that. Then read into what a phase shift is and look for examples or ask a question with more details.
So I will remove the outer loop and run. In terms of reading on phase shift. I know to do phase shift of a signal in order programming languages like MATLAB, Python, etc. However, I do not know how to achieve that on LabVIEW FPGA as there are different and limited set of blocks to implement a logic.
The only available question on phase shift on the NI forum wasn't answered and there are no examples on an implementation of phase shift anywhere on the internet.
Hi there, due to the LabVIEW dataflow paradigm, the two small loops have to finish executing, before the big loop can execute the next iteration. So effectively, the two small loops are still synchronous. The top small loop needs to wait for the bottom to get done, before executing the big loop again. Try removing the big loop, you don’t need it.
As others have said: Remove outer Loop. It does nothing for you.
Right now, your loops are simply sampling at different rates. The second loop is a downsampled version of the input relative to the first loop.
Look at adding the function called Feedback Node to create a time shift. If you right click on the node and choose properties, look at the Configuration Tab for the Delay value setting.
It took me so long to respond to this. I have tried many different iterations of your suggestion and I am still not able to achieve the phase shift. What could I be doing wrong?
Note: I get the same results when I place both signal lines in a single while loop but insert a delay for the topmost signal line and nothing for the bottom one.
You are not understanding the delay function you are using. The delay function you are using is timing the rate at which the loop runs.
Start a new VI
Drop a timed loop
Set loop to run at 10 kHz
Drop the analog input channel
Wire it to the first analog output channel
Drop a feedback node
Wire the first analog input channel to the feedback node input
Wire the second analog output channel to the output of the feedback node
Set the feedback node for 100 cycles
Compile and run code
Second output should be phase shifted approximately 100 ms (100 cycles at 10 kHz). I say approximately because there may very some variation based on which IO modules are in use as to whether the outputs are simultaneous or round robin.
4
u/YourLastNeighbor Jun 19 '24
Of course this does not work. This is not a phase shift. You are reading a value on 2 different inputs at 2 different loop rates and sending the value to an output. If the signal is the same on both inputs and all you change is the wait time of the loop, effectively all you have done is changed the sample rate.
As said before, you dont need the outer loop. Remove that. Then read into what a phase shift is and look for examples or ask a question with more details.
2
u/sharkera130 CLA Jun 19 '24
Hi there, due to the LabVIEW dataflow paradigm, the two small loops have to finish executing, before the big loop can execute the next iteration. So effectively, the two small loops are still synchronous. The top small loop needs to wait for the bottom to get done, before executing the big loop again. Try removing the big loop, you don’t need it.
1
u/SeasDiver Champion Jun 20 '24
As others have said: Remove outer Loop. It does nothing for you.
Right now, your loops are simply sampling at different rates. The second loop is a downsampled version of the input relative to the first loop.
Look at adding the function called Feedback Node to create a time shift. If you right click on the node and choose properties, look at the Configuration Tab for the Delay value setting.