LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to create a vi for following requirement

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

0 Kudos
Message 1 of 13
(3,045 Views)

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.

Message 2 of 13
(3,040 Views)

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.

0 Kudos
Message 3 of 13
(3,035 Views)

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.

 

0 Kudos
Message 4 of 13
(3,030 Views)

That vi also i got from the forum only.

i really confused.

can u give me the exact vi for that

0 Kudos
Message 5 of 13
(3,026 Views)

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. 

0 Kudos
Message 6 of 13
(3,022 Views)

Thank you

i will try and let you know 

0 Kudos
Message 7 of 13
(3,019 Views)

Hi ramkis,

 

wait, there's a function called "Elapsed Time" on the timing functions palette. Why not use it?

check.png

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 8 of 13
(3,016 Views)

Yes Greg I mentioned it in my post.

but still i wanted him to learn

Anyways you gived him a new thing Feed back nodeSmiley Very Happy

0 Kudos
Message 9 of 13
(3,012 Views)

alok

i have created one vi

but it is not working

0 Kudos
Message 10 of 13
(3,003 Views)