LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

FPGA (PXI-7852R) Loops

Solved!
Go to solution

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!

 

 

0 Kudos
Message 1 of 7
(2,862 Views)

Did you double-check the stop condition for the SCL? If the default value was true the loop would appear to not run.

0 Kudos
Message 2 of 7
(2,854 Views)

The SCL stop condition is "stop if true" and the default is False

0 Kudos
Message 3 of 7
(2,848 Views)

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?

0 Kudos
Message 4 of 7
(2,834 Views)

I have tried putting the controls inside the SCTL. The code fails as before.

 

These are great ideas though...keep em coming!

0 Kudos
Message 5 of 7
(2,785 Views)
Solution
Accepted by dthrash

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!

0 Kudos
Message 6 of 7
(2,775 Views)

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.

0 Kudos
Message 7 of 7
(2,744 Views)