08-10-2009 08:10 AM
I want to know how can we synchronize two independent while loops in a FPGA vi. I have a data inputs coming from the same control but as these are two different while loops some times one loop starts earlier than the other. But what I wanted was to start these two loops at the same time though they are independent of each other. How can we achieve this.
08-10-2009 09:04 AM
Simply create a handshaking. E.g. use a boolean which you set in the first loop and let the second loop in a beginning state poll this flag.
Christian
08-11-2009 01:05 AM - edited 08-11-2009 01:06 AM
Hi kpraveen,
The best way to synchronize two while loops is using a notifier. However LabVIEW FPGA doesn't support this feature, but there is another feature called as 'occurance'.
This is what LabVIEW help says about using occurances:
"In particular, use these functions when you want one VI or part of a block diagram to wait until another VI or part of a block diagram finishes a task without forcing LabVIEW to poll.
You can perform the same task using global variables, with one loop polling the global variable until its value changes. However, global variables use more overhead because the loop that waits uses execution time. With occurrences, the second loop becomes idle and does not use processor time. When the first loop sets the occurrence, LabVIEW activates the second loop and any other block diagrams that wait for the specified occurrence."
As you need to synchronize two loops i have made some logic.
It is made for a normal VI, but same can work for FPGA; excet you will need to use a different timing function.
Hope it helps.
Regards,
Ujjval Shah
08-11-2009 02:37 AM
Ignore the previous VI,
it wont work under all circumstances.
Use the one attached here..
this will work for sure.
08-20-2009 06:02 AM