05-13-2014 04:32 PM
I have created two pieces of code that run as desired independently. One creates a sine wave, reads an analog input waveform, and finds the relative phase. The other piece of code creates three square waves with independent settings (freq, duty cycle, etc). When I try to put them in the same vi only the first code runs. The Square waves are not generated from the second code.
Any ideas why???
I would not be surprised if my problem had something to do with the SCTL which is part of the square wave code. I have tried putting the SCTL inside the loop of the other code and square waves were still not produced.
attached is a .png file of my code.
Thanks in advance!
Solved! Go to Solution.
05-13-2014 04:42 PM
Did you double-check the stop condition for the SCL? If the default value was true the loop would appear to not run.
05-13-2014 05:09 PM - edited 05-13-2014 05:10 PM
The SCL stop condition is "stop if true" and the default is False
05-13-2014 05:40 PM
The control inputs of your SCTL are suspicious, as they won't update at run-time. If the host is late writing the parameters you could get stuck in the loop with a zero frequency or a reset permanently true, something like that. Have you tried moving your controls inside the SCTL?
05-14-2014 09:16 AM
I have tried putting the controls inside the SCTL. The code fails as before.
These are great ideas though...keep em coming!
05-14-2014 10:16 AM
I found a work around...I changed the IO nodes and now the square waves work the way I expect them to. See the attached png file for details
Thanks for everyones' input!
05-14-2014 04:53 PM
Yep, your original problem was that "Initialise" was only read at the start, so if it was True, then the square waves would re-initialise on every loop.