NetGnome Posted January 22, 2010 Report Share Posted January 22, 2010 I am using a FPGA card with Labview. I want to use a square wave to control the execution of some code in a while loop. So when the square wave is high the loop executes. When it is low it does not. The square wave will be about 1Khz. I tried the square wave function, but it only will work for me when it is in it own loop. When I try to control the loop from the outside it stops working. Thanks Quote Link to comment
Ryan Podsim Posted January 22, 2010 Report Share Posted January 22, 2010 I'm not sure I follow what you what to do. Do you want to execute your loop on the rising edge of the square wave? or have it execute as fast as possible when the square wave is high? I'm going to assume you intend to use the square wave as a clock signal, in which case I don't believe that is possible in the traditional sense. What you can do is poll the signal and check for a transition from low to high(false to true) and place your code in a case statement that only executes on that transition. An example of what I mean is below. If you want you code to execute as long as fast as possible when the signal is high simply wire the I/O directly to a case statement. Quote Link to comment
NetGnome Posted January 22, 2010 Author Report Share Posted January 22, 2010 Thanks That worked for me. Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.