LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to give a delay between two booleans

Hi all,

 

I want to generate time delay of 2 sec between operation of 2 booleans...

 

I tried sequence structure with 'wait' but it stops whole VI for 2 sec.

 

I want just delay between two booleans irrespctive of whole VI

 

Can u guide me?

Vaibhav Gandhi
,
B.E. Instrumentation & Control,
INDIA
0 Kudos
Message 1 of 9
(4,020 Views)

Hi Vaibhav,

 

stop to create duplicate posts, especially when you have marked a solution for the same question!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 9
(4,012 Views)

Mr. GerdW,

 

its not duplicate post, With earlier solution the whole VI is taking delay. This time I have indicated that I want this delay just between two booleans in whole VI.

 

if u can help

 

Thanks

Vaibhav Gandhi
,
B.E. Instrumentation & Control,
INDIA
0 Kudos
Message 3 of 9
(4,007 Views)

Hi Vaibhav,

 

wasn't a sequence structure like this suggested?

sequence.png

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 4 of 9
(4,005 Views)

I have tried this  logic but by the application of it, my whole VI is taking delay.

 

I need that this delay should take place between two booleans irrespective of VI's other work.

 

I have tried to use case structure along with this.

Vaibhav Gandhi
,
B.E. Instrumentation & Control,
INDIA
0 Kudos
Message 5 of 9
(3,977 Views)

Hello, The solution given (the vi snippet) will work. Just a create seperate subvi and plce the code in this so that the main vi is not dependent on this (what i mean to say here is do not pass anything "out" from this subvi to the main vi) or call this sub vi as a top level in a new thread dynamically so that your whole vi does not wait for 2 seconds.

 

 

Guru

Message Edited by Guruthilak on 01-18-2010 12:15 PM
Regards
Guru (CLA)
0 Kudos
Message 6 of 9
(3,967 Views)

Vaibhav G wrote:

I want to generate time delay of 2 sec between operation of 2 booleans...

 

I tried sequence structure with 'wait' but it stops whole VI for 2 sec.

 

I want just delay between two booleans irrespctive of whole VI


I agree with Gerd that this is just a clarification to the earlier question, so you should have continued in the other thread and unmarked the earlier solution since it apparently isnt. 😉

 

Please be more clear in you problem description. What is an "operation of 2 booleans"? Are these controls? indicators? what kind of "operations"? What should happen after 2 seconds? Should it start over after 4 seconds?

 

Such a 3 frame sequence will only delay code that has a direct data dependency to it. All you need to do is make sure that parts of the code that should run in parallel are not in the same loop, so they don't need to wait. LabVIEW is great for parallel operations, it's just a matter of programming it right.

 

Can you attach your VI so we can have a better idea what this is all about? Thanks! 🙂

 

(And please keep it all in this thread!) 😉

0 Kudos
Message 7 of 9
(3,949 Views)

As I said, you need two parallel structures if they should not block each other. Here's a very simple example (LV 8.0):

 

  • The lower loop switches two booleans every 2 seconds.
  • The upper loop increments a number every 100ms and increments another number whenever a button is pressed.

 

Both processes occur independently and in parallel because there is no data dependency. I am sure you can solve your problem along those lines.

0 Kudos
Message 8 of 9
(3,939 Views)

You could try adding something similar to below inside your main loop - you could use this to drive a case structure for example.

 

untitled.jpg

However, the best way of implementing a delay depends on you application, architecture and what you are trying to do

David
www.controlsoftwaresolutions.com
0 Kudos
Message 9 of 9
(3,936 Views)