01-11-2012 06:28 AM
I need to create a loop to execute for a certain period of time.
The time for which the loop to be executed should be determined by two numeric values(basically difference between two variable)
Among the two numeric variable, 1st variable should be controllable (that is we can change the value of that) and 2nd variable should have the value 0 initially.
If I give value 5 in 1st controller I will get time of 5sec(5-0=5). For 5 sec I can execute one loop. But, after execution my 2nd variable should have the value equal to the 1st one.
So if I give 12 for 1st variable the time for execution of loop will be 7sec (12-5=7) and after execution the 2nd variable should have value equal to first one.
Can any one give one vi for the above condition.
Thank you
01-11-2012 06:35 AM
you can use wait function with an input is difference of a control ( the input given by you ) and second value to the difference function coming from a shift register initialize with zero.
shift register will be fed from control inside the loop.
01-11-2012 06:42 AM
Thank you for ur reply
can u give vi for that
I am new to labview
I have created wait function but i dont know how to use shift registor.
i have attached one vi .
If u give one vi with shift registor, i will use the output of difference function as "max time" in following vi.
01-11-2012 06:51 AM
If you are interested in elapsed time you can use time elapsed function ( available on timing palatte).
as I see you already used a shift register in your vi ( just not the way you required ).
What is the purpose of multiplying by 1.
you can try your own. Use the Labview help for information about shift register.
01-11-2012 06:56 AM
That vi also i got from the forum only.
i really confused.
can u give me the exact vi for that
01-11-2012 07:02 AM
The best way of learning is doing it yourself.
you have got a lot of help from the vi you posted.
just read labview help associated with that functions.
Make a vi yourself and post it.
01-11-2012 07:04 AM
Thank you
i will try and let you know
01-11-2012 07:10 AM
01-11-2012 07:19 AM
Yes Greg I mentioned it in my post.
but still i wanted him to learn
Anyways you gived him a new thing Feed back node
01-11-2012 07:45 AM
alok
i have created one vi
but it is not working