From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

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,860 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,852 Views)

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

0 Kudos
Message 3 of 7
(2,846 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,832 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,783 Views)
Solution
Accepted by topic author 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,773 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,742 Views)