LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Execute delay only once the entire time

I need ideas on how to execute a delay only once after start (and that's it, no more calling the delay ever again after start) in a while loop without affecting other codes in that same loop...

 

Something like this http://forums.ni.com/t5/LabVIEW/put-a-delay-for-executing-case-structure/m-p/1095396/highlight/true#... but it is not workingSmiley Frustrated

0 Kudos
Message 1 of 14
(3,191 Views)

It does not help if you say "it does not work". Please be more specific. What happens and what do you expect to happen instead?

Did you use the snippet or wire it up from scratch?

 

Please attach your non-working code!

0 Kudos
Message 2 of 14
(3,178 Views)

I tried to use the code as attached in the link. But the indicator just shows 0. The delay VI in the link can be found in the very last picture...

 

1.JPG2.JPG3.JPG4.JPG

 

0 Kudos
Message 3 of 14
(3,170 Views)

How do you expect the subVI to delay only once if the main loop has a 5000ms delay?

 

Please attach the VI, not pictures. Thanks

 

 

0 Kudos
Message 4 of 14
(3,164 Views)

Kindly run untitled 1.vi

 

delayed output.vi is for your reference.

 

Hope you can help, thanks in advanced

Download All
0 Kudos
Message 5 of 14
(3,161 Views)

Hi august,

 

why do you create new threads instead of continuing your old one?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 6 of 14
(3,155 Views)

Because I introduced a new VI so I do not want it to get messy

0 Kudos
Message 7 of 14
(3,153 Views)

@augustg wrote:

Kindly run untitled 1.vi

 

delayed output.vi is for your reference.


Your "delayed output.vi" is faulty. You did not copy it correctly. The loop condition needs to be TRUE instead of FALSE. In your case, the subVI runs forever and never returns control to the calling VI.

 

(I did not check the rest of your code)

0 Kudos
Message 8 of 14
(3,147 Views)

I've switched the event of the TRUE and FALSE in the case structure in the delayed output.vi but it's still not working in my untitled 1.vi

0 Kudos
Message 9 of 14
(3,142 Views)

Why? That makes no sense. You need to change the loop termination inside the subVI as I already mentioned.

 

0 Kudos
Message 10 of 14
(3,133 Views)