LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Synchronization of two different loops in FPGA VI's

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.

0 Kudos
Message 1 of 5
(3,869 Views)

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

0 Kudos
Message 2 of 5
(3,855 Views)

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

Message Edited by Ujjval Shah on 08-11-2009 11:35 AM
Message Edited by Ujjval Shah on 08-11-2009 11:36 AM
0 Kudos
Message 3 of 5
(3,831 Views)

Ignore the previous VI,

 

it wont work under all circumstances.

 

Use the one attached here..

 

this will work for sure.

 

0 Kudos
Message 4 of 5
(3,818 Views)
Sorry for the delay in response. Can you please send  the code in 8.5.
0 Kudos
Message 5 of 5
(3,761 Views)