LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

FPGA Square Wave Generator hijacks loop timing

Solved!
Go to solution

Problem Description :


I have a simple while loop with a case structure inside. In one case I have the
FPGA Sinewave generator sending output data to AO0, in the other case I have
the FPGA Square Wave generator sending output to AO0. Both Sine and Square
waves are set to run at 10 kHz

I also have a shift register that changes the state of DIO0 every loop thru.
That way I can look at DIO0 on my scope and tell how fast the loop is running.

When I choose the SineWave generator, the output on AO0 is what I  expect. That
is I have a sine wave at 10kHz and the loop speed is about 1 us. All is good.

Then I switch to the Square wave. I get a 10 kHz square wave which is good. But
my loop speed has been way slowed down to 50 us (it tracks the square wave
exactly) That is: one time through the loop sets the square wave to  FS and the
next time through the loop it sets the square wave to -FS.

My problem is that when I generate a square wave I would expect the loop speed
to stay fast as it does for the sine wave. You can see that if my loop speed
slows to 50 us (for a 10 kHz square wave) then all my calculations that should
go in parallel with the square wave will be exceedingly slowed down also.

Please help me with my understanding of the use of the FPGA Square Wave sub-VI

Thanks
Rich

NI Software :  LabVIEW FPGA Module  version 2013 SP1
NI Hardware :  R Series device USB-7855R

0 Kudos
Message 1 of 3
(3,175 Views)
Solution
Accepted by topic author JOmega

If you dig into the express VI, it loops a SSTL until there is a change in value.  The sine wave doesn't need to do that since the value will change constantly.

 

If you can, I would recommend making your While loop a SSTL and configure the express VIs accordingly.  This will work as long as the rest of your code in the loop can execute in a single clock cycle.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 2 of 3
(3,142 Views)

Crossrulz

 

Thank you, that helped me understand how the square wave VI works.

 

Rich

0 Kudos
Message 3 of 3
(3,105 Views)