10-25-2009 04:15 AM
hii....
i am using two for loops and i want that each iteration for both for loops start at same time..
actually i want synchronisation between these two loops..
so when the each iteration of both loops will start at same time then these will be synchronised..
also if one loop take more time in one iteration then the other loop should pause until the other's iteration completes..
please hlp me...thanks...
Solved! Go to Solution.
10-25-2009 04:51 AM
10-25-2009 05:09 AM
hiii
you are right thatthe loops will be synhronised as Labview executes code via data flow.
here i mean of synchronisation is that i want each iteration to be started at same time only...
this is what i am not getting..
i have tried it to b done by defining a local variable in one loop and using its value in the other but it did not work..
i hav tried some more methods but in vain...
so i am here...
thanks..
10-25-2009 05:32 AM - edited 10-25-2009 05:34 AM
Well if you are using local variables like that you may have race conditions which will cause your program to have problems
can you post an example of your vi or the vi that is in question?
10-25-2009 08:56 AM
hii..
i am not having problems regarding race condition..as i have the solution for it...it is not of worry...
using local variables ::
if i place the local variable (say for output of add command) in the other vi then the problem is that the local variable also takes the previous value which is of no mean...i want that it takes the value until the output of first loop during first iteration is not coming ie it must ignore the previous value...
thanks...
10-25-2009 12:01 PM
Hi sahil,
two options:
1st: when both FOR loops should have same iteration times why not simply put all code in just one FOR loop?
2nd: when 1st isn't possible/wanted you can use a notifier. Set the notifier at iteration start of the first FOR loop and wait for the signal in the second loop...
3rd: use timed loops and synchronize them...
10-26-2009 12:44 AM
hii GerdW
thanks once again you have solved another problem of mine...thanks a lot..
what i say ?? i don't have the words to praise you...
thanks a lot..
10-26-2009 09:47 PM
Hey sahil
just click this link and you will get your answer regarding how to create a sub-vi.
(i am posting this here, though this thread is regarding something else but this is the only way i can communicate with sahil)