02-13-2013 08:02 AM
I have build a code (see picture) to acquire AI using 9215 module and compact rio and FPGA, I need to acquire AI for 10 sec starting from 0 to 10 sec . I have chosed while loop to run this but i am not sure how to do that with while loop.
How can I do that using while loop?
Is there and possiple loop that can do the job?
Thanks
02-14-2013 08:01 AM
Hi wgkotb,
On your FPGA code you could use a "Tick Count" VI, found in your timing palette and then configure it to use mSec as its "Counter Unit" when you place it down. As this will then be counting millisecond readings back from your clock you can then compare it to a constant of 1000, and use the true output of the equals function to stop your loop.
Another way to stop the loop is by counting iterations. A frequency of 1kHz means you need 10000 iterations to run 5 secs. So compare the iterations of the loop to 10000
I have attached an image to help you understand what I am referring to. I would recommend reading the following guides for developing on an FPGA, they contain some good tips and just searchign through the guide can give you some good ideas on how to develop your program further in the future.